TypedRest for .NET 1.3.5
build type-safe fluent-style REST API clients
TypedRest.Endpoints.Raw.IBlobEndpoint Interface Reference

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

Inheritance diagram for TypedRest.Endpoints.Raw.IBlobEndpoint:
TypedRest.Endpoints.IEndpoint TypedRest.Endpoints.Raw.BlobEndpoint

Public Member Functions

Task ProbeAsync (CancellationToken cancellationToken=default)
 Queries the server about capabilities of the endpoint without performing any action. More...
 
Task< Stream > DownloadAsync (CancellationToken cancellationToken=default)
 Downloads the blob's content to a stream. More...
 
Task UploadFromAsync (Stream stream, string? mimeType=null, CancellationToken cancellationToken=default)
 Uploads data as the blob's content from a stream. More...
 
Task DeleteAsync (CancellationToken cancellationToken=default)
 Deletes the blob from the server. More...
 
- Public Member Functions inherited from TypedRest.Endpoints.IEndpoint
IReadOnlyList<(Uri uri, string? title)> GetLinks (string rel)
 Resolves all links with a specific relation type. Uses cached data from last response. More...
 
Uri Link (string rel)
 Resolves a single link with a specific relation type. Uses cached data from last response if possible. Tries lazy lookup with HTTP HEAD on cache miss. More...
 
Uri LinkTemplate (string rel, IDictionary< string, object > variables)
 Resolves a link template with a specific relation type. Uses cached data from last response if possible. Tries lazy lookup with HTTP HEAD on cache miss. More...
 
Uri LinkTemplate (string rel, object variables)
 Resolves a link template with a specific relation type. More...
 

Properties

bool? DownloadAllowed [get]
 Shows whether the server has indicated that DownloadAsync is currently allowed. More...
 
bool? UploadAllowed [get]
 Shows whether the server has indicated that UploadFromAsync is currently allowed. More...
 
bool? DeleteAllowed [get]
 Shows whether the server has indicated that DeleteAsync is currently allowed. More...
 
- Properties inherited from TypedRest.Endpoints.IEndpoint
Uri Uri [get]
 The HTTP URI of the remote resource.
 
HttpClient HttpClient [get]
 The HTTP client used to communicate with the remote resource.
 
MediaTypeFormatter Serializer [get]
 Controls the serialization of entities sent to and received from the server.
 
IErrorHandler ErrorHandler [get]
 Handles errors in responses.
 
ILinkExtractor LinkExtractor [get]
 Extracts links from responses.
 

Detailed Description

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

Member Function Documentation

◆ DeleteAsync()

Task TypedRest.Endpoints.Raw.IBlobEndpoint.DeleteAsync ( CancellationToken  cancellationToken = default)

Deletes the blob from the server.

Parameters
cancellationTokenUsed to cancel the request.
Exceptions
InvalidDataExceptionHttpStatusCode.BadRequest
AuthenticationExceptionHttpStatusCode.Unauthorized
UnauthorizedAccessExceptionHttpStatusCode.Forbidden
KeyNotFoundExceptionHttpStatusCode.NotFound or HttpStatusCode.Gone
HttpRequestExceptionOther non-success status code.

Implemented in TypedRest.Endpoints.Raw.BlobEndpoint.

◆ DownloadAsync()

Task< Stream > TypedRest.Endpoints.Raw.IBlobEndpoint.DownloadAsync ( CancellationToken  cancellationToken = default)

Downloads the blob's content to a stream.

Parameters
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.

Implemented in TypedRest.Endpoints.Raw.BlobEndpoint.

◆ ProbeAsync()

Task TypedRest.Endpoints.Raw.IBlobEndpoint.ProbeAsync ( CancellationToken  cancellationToken = default)

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

Parameters
cancellationTokenUsed to cancel the request.
Exceptions
AuthenticationExceptionHttpStatusCode.Unauthorized
UnauthorizedAccessExceptionHttpStatusCode.Forbidden
KeyNotFoundExceptionHttpStatusCode.NotFound or HttpStatusCode.Gone
HttpRequestExceptionOther non-success status code.

Implemented in TypedRest.Endpoints.Raw.BlobEndpoint.

◆ UploadFromAsync()

Task TypedRest.Endpoints.Raw.IBlobEndpoint.UploadFromAsync ( Stream  stream,
string?  mimeType = null,
CancellationToken  cancellationToken = default 
)

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

Parameters
streamThe stream 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
HttpRequestExceptionOther non-success status code.

Implemented in TypedRest.Endpoints.Raw.BlobEndpoint.

Property Documentation

◆ DeleteAllowed

bool? TypedRest.Endpoints.Raw.IBlobEndpoint.DeleteAllowed
get

Shows whether the server has indicated that DeleteAsync is currently allowed.

Uses cached data from last response.

Returns
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.

◆ DownloadAllowed

bool? TypedRest.Endpoints.Raw.IBlobEndpoint.DownloadAllowed
get

Shows whether the server has indicated that DownloadAsync is currently allowed.

Uses cached data from last response.

Returns
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.

◆ UploadAllowed

bool? TypedRest.Endpoints.Raw.IBlobEndpoint.UploadAllowed
get

Shows whether the server has indicated that UploadFromAsync is currently allowed.

Uses cached data from last response.

Returns
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.

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