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

Endpoint that accepts binary uploads. More...

Inheritance diagram for TypedRest.Endpoints.Raw.IUploadEndpoint:
TypedRest.Endpoints.IEndpoint TypedRest.Endpoints.Raw.UploadEndpoint

Public Member Functions

Task UploadFromAsync (Stream stream, string? fileName=null, string? mimeType=null, CancellationToken cancellationToken=default)
 Uploads data to the endpoint from a stream. 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...
 

Additional Inherited Members

- 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 that accepts binary uploads.

Member Function Documentation

◆ UploadFromAsync()

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

Uploads data to the endpoint from a stream.

Parameters
streamThe stream to read the upload data from.
fileNameThe name of the uploaded file.
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.

Implemented in TypedRest.Endpoints.Raw.UploadEndpoint.


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