Class BlobEndpoint
Endpoint for a binary blob that can be downloaded or uploaded.
public class BlobEndpoint : EndpointBase, IBlobEndpoint, IEndpoint
- Inheritance
-
BlobEndpoint
- Implements
- Inherited Members
- Extension Methods
Constructors
BlobEndpoint(IEndpoint, string)
Creates a new blob endpoint.
public BlobEndpoint(IEndpoint referrer, string relativeUri)
Parameters
referrer
IEndpointThe endpoint used to navigate to this one.
relativeUri
stringThe URI of this endpoint relative to the
referrer
's. Add a./
prefix here to imply a trailing slashreferrer
's URI.
BlobEndpoint(IEndpoint, Uri)
Endpoint for a binary blob that can be downloaded or uploaded.
public BlobEndpoint(IEndpoint referrer, Uri relativeUri)
Parameters
referrer
IEndpointThe endpoint used to navigate to this one.
relativeUri
UriThe URI of this endpoint relative to the
referrer
's.
Properties
DeleteAllowed
Indicates whether the server has specified DeleteAsync(CancellationToken) is currently allowed.
public 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.
public 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.
public 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.
public Task DeleteAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenUsed to cancel the request.
Returns
Exceptions
- InvalidDataException
- AuthenticationException
- UnauthorizedAccessException
- KeyNotFoundException
- HttpRequestException
Other non-success status code.
DownloadAsync(CancellationToken)
Downloads the blob's content to a stream.
public Task<Stream> DownloadAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenUsed to cancel the request.
Returns
Exceptions
- AuthenticationException
- UnauthorizedAccessException
- KeyNotFoundException
- HttpRequestException
Other non-success status code.
ProbeAsync(CancellationToken)
Queries the server about capabilities of the endpoint without performing any action.
public Task ProbeAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenUsed to cancel the request.
Returns
Exceptions
- AuthenticationException
- UnauthorizedAccessException
- KeyNotFoundException
- HttpRequestException
Other non-success status code.
UploadFromAsync(Stream, string?, CancellationToken)
Uploads data as the blob's content from a stream.
public Task UploadFromAsync(Stream stream, string? mimeType = null, CancellationToken cancellationToken = default)
Parameters
stream
StreamThe stream to read the upload data from.
mimeType
stringThe MIME type of the data to upload.
cancellationToken
CancellationTokenUsed to cancel the request.
Returns
Exceptions
- InvalidDataException
- AuthenticationException
- UnauthorizedAccessException
- HttpRequestException
Other non-success status code.