IDocumentClient.ReadMediaAsync(String, CancellationToken) Method

Definition

Retrieves the specified attachment content (aka media) from the Azure Cosmos DB service.

public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.MediaResponse> ReadMediaAsync (string mediaLink, System.Threading.CancellationToken cancellationToken = default);
abstract member ReadMediaAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.MediaResponse>
Public Function ReadMediaAsync (mediaLink As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of MediaResponse)

Parameters

mediaLink
String

The link for the media to read. E.g. /media/media_rid

cancellationToken
CancellationToken

(Optional) A CancellationToken that can be used by other objects or threads to receive notice of cancellation.

Returns

The task object representing the service response for the asynchronous operation.

Exceptions

If mediaLink is not set.

If mediaLink is not in the form of /media/{mediaId}.

Applies to

See also