Table of Contents

Interface IBlobEndpoint

Namespace
TypedRest.Endpoints.Raw
Assembly
TypedRest.dll

Endpoint for a binary blob that can be downloaded or uploaded.

public interface IBlobEndpoint : IEndpoint
Inherited Members
Extension Methods

Properties

DeleteAllowed

Indicates whether the server has specified DeleteAsync(CancellationToken) is currently allowed.

bool? DeleteAllowed { get; }

Property Value

bool?

true if the method is allowed, false if the method is not allowed, null If no request has been sent yet or the server did not specify allowed methods.

Remarks

Uses cached data from last response.

DownloadAllowed

Indicates whether the server has specified DownloadAsync(CancellationToken) is currently allowed.

bool? DownloadAllowed { get; }

Property Value

bool?

true if the method is allowed, false if the method is not allowed, null If no request has been sent yet or the server did not specify allowed methods.

Remarks

Uses cached data from last response.

UploadAllowed

Indicates whether the server has specified UploadFromAsync(Stream, string?, CancellationToken) is currently allowed.

bool? UploadAllowed { get; }

Property Value

bool?

true if the method is allowed, false if the method is not allowed, null If no request has been sent yet or the server did not specify allowed methods.

Remarks

Uses cached data from last response.

Methods

DeleteAsync(CancellationToken)

Deletes the blob from the server.

Task DeleteAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Used to cancel the request.

Returns

Task

Exceptions

InvalidDataException

BadRequest

AuthenticationException

Unauthorized

UnauthorizedAccessException

Forbidden

KeyNotFoundException

NotFound or Gone

HttpRequestException

Other non-success status code.

DownloadAsync(CancellationToken)

Downloads the blob's content to a stream.

Task<Stream> DownloadAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Used to cancel the request.

Returns

Task<Stream>

A stream with the blob's content.

Exceptions

AuthenticationException

Unauthorized

UnauthorizedAccessException

Forbidden

KeyNotFoundException

NotFound or Gone

HttpRequestException

Other non-success status code.

ProbeAsync(CancellationToken)

Queries the server about capabilities of the endpoint without performing any action.

Task ProbeAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Used to cancel the request.

Returns

Task

Exceptions

AuthenticationException

Unauthorized

UnauthorizedAccessException

Forbidden

KeyNotFoundException

NotFound or Gone

HttpRequestException

Other non-success status code.

UploadFromAsync(Stream, string?, CancellationToken)

Uploads data as the blob's content from a stream.

Task UploadFromAsync(Stream stream, string? mimeType = null, CancellationToken cancellationToken = default)

Parameters

stream Stream

The stream 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

InvalidDataException

BadRequest

AuthenticationException

Unauthorized

UnauthorizedAccessException

Forbidden

HttpRequestException

Other non-success status code.