Content. Copy To(Stream, TransportContext, CancellationToken) Method
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.
Serializes the HTTP content into a stream of bytes and copies it to
public: void CopyTo(System::IO::Stream ^ stream, System::Net::TransportContext ^ context, System::Threading::CancellationToken cancellationToken);
public void CopyTo (System.IO.Stream stream, System.Net.TransportContext? context, System.Threading.CancellationToken cancellationToken);
member this.CopyTo : System.IO.Stream * System.Net.TransportContext * System.Threading.CancellationToken -> unit
Public Sub CopyTo (stream As Stream, context As TransportContext, cancellationToken As CancellationToken)
The target stream.
Information about the transport (for example, the channel binding token). This parameter may be
The cancellation token to cancel the operation.
The cancellation token was canceled. This exception is stored into the returned task.
This method uses SerializeToStream(Stream, TransportContext, CancellationToken) internally to serialize the content into the given stream. If the content has been previously buffered, for example, by calling LoadIntoBufferAsync(), the method will return the buffered content and not call the serialization method.