Table of Contents

Class BlobEndpointExtensions

Namespace
TypedRest.Endpoints.Raw
Assembly
TypedRest.dll

Provides extension methods for IBlobEndpoint.

public static class BlobEndpointExtensions
Inheritance
BlobEndpointExtensions
Inherited Members

Methods

DownloadAsync(IBlobEndpoint, string, CancellationToken)

Downloads the blob's content to a file.

public static Task DownloadAsync(this IBlobEndpoint endpoint, string path, CancellationToken cancellationToken = default)

Parameters

endpoint IBlobEndpoint

The blob endpoint.

path string

The path of the file to write the download data to.

cancellationToken CancellationToken

Used to cancel the request.

Returns

Task

A stream with the blob's content.

Exceptions

IOException

Failed to write the file.

AuthenticationException

Unauthorized

UnauthorizedAccessException

Forbidden

KeyNotFoundException

NotFound or Gone

HttpRequestException

Other non-success status code.

UploadFromAsync(IBlobEndpoint, string, string?, CancellationToken)

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

public static Task UploadFromAsync(this IBlobEndpoint endpoint, string path, string? mimeType = null, CancellationToken cancellationToken = default)

Parameters

endpoint IBlobEndpoint

The blob endpoint.

path string

The path of the file to read the upload data from.

mimeType string

The MIME type of the data to upload.

cancellationToken CancellationToken

Used to cancel the request.

Returns

Task

Exceptions

IOException

Failed to read the file.

InvalidDataException

BadRequest

AuthenticationException

Unauthorized

UnauthorizedAccessException

Forbidden

KeyNotFoundException

NotFound or Gone

HttpRequestException

Other non-success status code.