HttpContent.ReadAsStreamAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
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
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.