Table of Contents

Class UploadEndpointExtensions

Namespace
TypedRest.Endpoints.Raw
Assembly
TypedRest.dll

Provides extension methods for IUploadEndpoint.

public static class UploadEndpointExtensions
Inheritance
UploadEndpointExtensions
Inherited Members

Methods

UploadFromAsync(IUploadEndpoint, string, string?, CancellationToken)

Uploads data to the endpoint from a file.

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

Parameters

endpoint IUploadEndpoint

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.