StringContent.SerializeToStreamAsync Metodo

Definizione

Consente di serializzare e scrivere la stringa specificata nel costruttore in un flusso di contenuto HTTP come operazione asincrona.

protected:
 override System::Threading::Tasks::Task ^ SerializeToStreamAsync(System::IO::Stream ^ stream, System::Net::TransportContext ^ context, System::Threading::CancellationToken cancellationToken);
protected override System.Threading.Tasks.Task SerializeToStreamAsync (System.IO.Stream stream, System.Net.TransportContext? context, System.Threading.CancellationToken cancellationToken);
override this.SerializeToStreamAsync : System.IO.Stream * System.Net.TransportContext * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Protected Overrides Function SerializeToStreamAsync (stream As Stream, context As TransportContext, cancellationToken As CancellationToken) As Task

Parametri

stream
Stream

Il flusso di destinazione.

context
TransportContext

Informazioni relative al trasporto, ad esempio il token di associazione del canale. Questo parametro può essere null.

cancellationToken
CancellationToken

Token di annullamento per annullare l'operazione.

Restituisce

Oggetto dell'attività che rappresenta l'operazione asincrona.

Eccezioni

Il token di annullamento è stato annullato. Questa eccezione viene archiviata nell'attività restituita.

Commenti

Questa operazione non viene bloccata. Al termine dell'oggetto restituito Task , l'intera stringa è stata scritta nel stream parametro .

Si applica a