TypedRest for .NET 1.3.6
build type-safe fluent-style REST API clients
TypedRest.Endpoints.Raw.BlobEndpointExtensions Class Reference

Provides extension methods for IBlobEndpoint. More...

Static Public Member Functions

static async Task DownloadAsync (this IBlobEndpoint endpoint, string path, CancellationToken cancellationToken=default)
 Downloads the blob's content to a file. More...
 
static async Task UploadFromAsync (this IBlobEndpoint endpoint, string path, string? mimeType=null, CancellationToken cancellationToken=default)
 Uploads content as the blob's content from a file. More...
 

Detailed Description

Provides extension methods for IBlobEndpoint.

Member Function Documentation

◆ DownloadAsync()

static async Task TypedRest.Endpoints.Raw.BlobEndpointExtensions.DownloadAsync ( this IBlobEndpoint  endpoint,
string  path,
CancellationToken  cancellationToken = default 
)
inlinestatic

Downloads the blob's content to a file.

Parameters
endpointThe blob endpoint.
pathThe path of the file to write the download data to.
cancellationTokenUsed to cancel the request.
Returns
A stream with the blob's content.
Exceptions
InvalidDataExceptionHttpStatusCode.BadRequest
AuthenticationExceptionHttpStatusCode.Unauthorized
UnauthorizedAccessExceptionHttpStatusCode.Forbidden
KeyNotFoundExceptionHttpStatusCode.NotFound or HttpStatusCode.Gone
HttpRequestExceptionOther non-success status code.

◆ UploadFromAsync()

static async Task TypedRest.Endpoints.Raw.BlobEndpointExtensions.UploadFromAsync ( this IBlobEndpoint  endpoint,
string  path,
string?  mimeType = null,
CancellationToken  cancellationToken = default 
)
inlinestatic

Uploads content as the blob's content from a file.

Parameters
endpointThe blob endpoint.
pathThe path of the file to read the upload data from.
mimeTypeThe MIME type of the data to upload.
cancellationTokenUsed to cancel the request.
Exceptions
InvalidDataExceptionHttpStatusCode.BadRequest
AuthenticationExceptionHttpStatusCode.Unauthorized
UnauthorizedAccessExceptionHttpStatusCode.Forbidden
KeyNotFoundExceptionHttpStatusCode.NotFound or HttpStatusCode.Gone
HttpRequestExceptionOther non-success status code.

The documentation for this class was generated from the following file: