HttpContent.CopyTo(Stream, TransportContext, CancellationToken) Method
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.
Serializes the HTTP content into a stream of bytes and copies it to stream
.
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)
- stream
- Stream
The target stream.
- context
- TransportContext
Information about the transport (for example, the channel binding token). This parameter may be null
.
- cancellationToken
- CancellationToken
The cancellation token to cancel the operation.
The stream
was null
.
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.
Produkt | Versjoner |
---|---|
.NET | 5, 6, 7, 8, 9 |
.NET-tilbakemelding
.NET er et åpen kilde-prosjekt. Velg en kobling for å gi tilbakemelding: