HttpContent.CopyToAsync HttpContent.CopyToAsync HttpContent.CopyToAsync Method

Definition

Serialize the HTTP content into a stream of bytes and copies it to the stream object provided as the stream parameter.

Overloads

CopyToAsync(Stream) CopyToAsync(Stream) CopyToAsync(Stream)

Serialize the HTTP content into a stream of bytes and copies it to the stream object provided as the stream parameter.

CopyToAsync(Stream, TransportContext) CopyToAsync(Stream, TransportContext) CopyToAsync(Stream, TransportContext)

Serialize the HTTP content into a stream of bytes and copies it to the stream object provided as the stream parameter.

Remarks

This operation does not block.

CopyToAsync(Stream) CopyToAsync(Stream) CopyToAsync(Stream)

Serialize the HTTP content into a stream of bytes and copies it to the stream object provided as the stream parameter.

public:
 System::Threading::Tasks::Task ^ CopyToAsync(System::IO::Stream ^ stream);
public System.Threading.Tasks.Task CopyToAsync (System.IO.Stream stream);
member this.CopyToAsync : System.IO.Stream -> System.Threading.Tasks.Task

Parameters

stream
Stream Stream Stream

The target stream.

Returns

The task object representing the asynchronous operation.

Remarks

This operation will not block. The returned Task object will complete after all of the content has been written to the stream object passed as the stream parameter.

CopyToAsync(Stream, TransportContext) CopyToAsync(Stream, TransportContext) CopyToAsync(Stream, TransportContext)

Serialize the HTTP content into a stream of bytes and copies it to the stream object provided as the stream parameter.

public:
 System::Threading::Tasks::Task ^ CopyToAsync(System::IO::Stream ^ stream, System::Net::TransportContext ^ context);
public System.Threading.Tasks.Task CopyToAsync (System.IO.Stream stream, System.Net.TransportContext context);
member this.CopyToAsync : System.IO.Stream * System.Net.TransportContext -> System.Threading.Tasks.Task

Parameters

stream
Stream Stream Stream

The target stream.

context
TransportContext TransportContext TransportContext

Information about the transport (channel binding token, for example). This parameter may be null.

Returns

The task object representing the asynchronous operation.

Remarks

This operation will not block. The returned Task object will complete after all of the content has been written to the stream object passed as the stream parameter.

Applies to