MultipartFormDataContent.SerializeToStreamAsync Method

Definition

Serialize and write the content provided in the constructor to an HTTP content stream as an asynchronous operation.

C#
protected override System.Threading.Tasks.Task SerializeToStreamAsync(System.IO.Stream stream, System.Net.TransportContext? context, System.Threading.CancellationToken cancellationToken);

Parameters

stream
Stream

The target stream.

context
TransportContext

Information about the transport, like channel binding token. This parameter may be null.

cancellationToken
CancellationToken

The cancellation token to cancel the operation.

Returns

The task object representing the asynchronous operation.

Exceptions

The cancellation token was canceled. This exception is stored into the returned task.

Remarks

This operation does not block. When the returned Task object completes, the whole content has been written to the stream parameter.

Applies to

Produkt Verzie
.NET 5, 6, 7, 8, 9, 10