HttpContent.ReadAsStreamAsync Method

Definition

Overloads

ReadAsStreamAsync()

Serialize the HTTP content and return a stream that represents the content as an asynchronous operation.

ReadAsStreamAsync(CancellationToken)

Serialize the HTTP content and return a stream that represents the content as an asynchronous operation.

ReadAsStreamAsync()

Serialize the HTTP content and return a stream that represents the content as an asynchronous operation.

public:
 System::Threading::Tasks::Task<System::IO::Stream ^> ^ ReadAsStreamAsync();
public System.Threading.Tasks.Task<System.IO.Stream> ReadAsStreamAsync ();
member this.ReadAsStreamAsync : unit -> System.Threading.Tasks.Task<System.IO.Stream>
Public Function ReadAsStreamAsync () As Task(Of Stream)

Returns

Task<Stream>

The task object representing the asynchronous operation.

Remarks

This operation will not block. The returned Task<TResult> object will complete after all of the stream that represents content has been read.

Once the operation completes, the Result property on the returned task object contains the stream that represents the HTTP content. The returned stream can then be used to read the content using various stream APIs.

Applies to

ReadAsStreamAsync(CancellationToken)

Serialize the HTTP content and return a stream that represents the content as an asynchronous operation.

public:
 System::Threading::Tasks::Task<System::IO::Stream ^> ^ ReadAsStreamAsync(System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<System.IO.Stream> ReadAsStreamAsync (System.Threading.CancellationToken cancellationToken);
member this.ReadAsStreamAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.IO.Stream>
Public Function ReadAsStreamAsync (cancellationToken As CancellationToken) As Task(Of Stream)

Parameters

cancellationToken
CancellationToken

The cancellation token to cancel the operation.

Returns

Task<Stream>

The task object representing the asynchronous operation.

Remarks

This operation will not block. The returned Task<TResult> object will complete after all of the stream that represents content has been read.

Once the operation completes, the Result property on the returned task object contains the stream that represents the HTTP content. The returned stream can then be used to read the content using various stream APIs.

Applies to