Condividi tramite


HttpContent.ReadAsStringAsync Metodo

Definizione

Overload

Nome Descrizione
ReadAsStringAsync()

Serializzare il contenuto HTTP in una stringa come operazione asincrona.

ReadAsStringAsync(CancellationToken)

Serializzare il contenuto HTTP in una stringa come operazione asincrona.

ReadAsStringAsync()

Origine:
HttpContent.cs
Origine:
HttpContent.cs
Origine:
HttpContent.cs
Origine:
HttpContent.cs
Origine:
HttpContent.cs

Serializzare il contenuto HTTP in una stringa come operazione asincrona.

public:
 System::Threading::Tasks::Task<System::String ^> ^ ReadAsStringAsync();
public System.Threading.Tasks.Task<string> ReadAsStringAsync();
member this.ReadAsStringAsync : unit -> System.Threading.Tasks.Task<string>
Public Function ReadAsStringAsync () As Task(Of String)

Restituisce

Oggetto attività che rappresenta l'operazione asincrona.

Commenti

Questa operazione non verrà bloccata. L'oggetto restituito Task<TResult> verrà completato dopo che tutto il contenuto è stato scritto come stringa.

Al termine dell'operazione, la Result proprietà nell'oggetto attività restituito contiene la stringa con il contenuto HTTP.

Si noti che questo metodo memorizza internamente nel buffer il contenuto tramite LoadIntoBufferAsync().

Si applica a

ReadAsStringAsync(CancellationToken)

Origine:
HttpContent.cs
Origine:
HttpContent.cs
Origine:
HttpContent.cs
Origine:
HttpContent.cs
Origine:
HttpContent.cs

Serializzare il contenuto HTTP in una stringa come operazione asincrona.

public:
 System::Threading::Tasks::Task<System::String ^> ^ ReadAsStringAsync(System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<string> ReadAsStringAsync(System.Threading.CancellationToken cancellationToken);
member this.ReadAsStringAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<string>
Public Function ReadAsStringAsync (cancellationToken As CancellationToken) As Task(Of String)

Parametri

cancellationToken
CancellationToken

Token di annullamento per annullare l'operazione.

Restituisce

Oggetto attività che rappresenta l'operazione asincrona.

Eccezioni

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

Commenti

Questa operazione non verrà bloccata. L'oggetto restituito Task<TResult> verrà completato dopo che tutto il contenuto è stato scritto come stringa.

Al termine dell'operazione, la Result proprietà nell'oggetto attività restituito contiene la stringa con il contenuto HTTP.

Si noti che questo metodo memorizza internamente nel buffer il contenuto tramite LoadIntoBufferAsync().

Si applica a