MultipartContent.CreateContentReadStreamAsync MultipartContent.CreateContentReadStreamAsync MultipartContent.CreateContentReadStreamAsync MultipartContent.CreateContentReadStreamAsync Method

Definition

Serializes the HTTP content to a stream using the multipart/* encoding as an asynchronous operation.

protected:
 override System::Threading::Tasks::Task<System::IO::Stream ^> ^ CreateContentReadStreamAsync();
protected override System.Threading.Tasks.Task<System.IO.Stream> CreateContentReadStreamAsync ();
override this.CreateContentReadStreamAsync : unit -> System.Threading.Tasks.Task<System.IO.Stream>
Protected Overrides Function CreateContentReadStreamAsync () As Task(Of Stream)

Returns

The task object representing the asynchronous operation.

Remarks

This method overrides HttpContent.CreateContentReadStreamAsync to use a custom stream that contains an array, with each HTTP content and its boundary encoded and serialized to a MemoryStream instance.

This operation will not block. The returned Task<TResult> object will complete after all of the content has been written to the memory stream.

Once the operation completes, the Task<TResult>.Result property on the returned task object contains the stream that represents the multipart/* encoded HTTP content. The returned stream can then be used to read the content using various stream APIs.

Applies to