Udostępnij za pośrednictwem


HttpMessageExtensions.ReadContentAsJsonAsync<T> Method

Definition

Reads the JSON content from the http response message.

public static System.Threading.Tasks.Task<T> ReadContentAsJsonAsync<T> (this System.Net.Http.HttpResponseMessage message, bool rewindContentStream = false);
static member ReadContentAsJsonAsync : System.Net.Http.HttpResponseMessage * bool -> System.Threading.Tasks.Task<'T>
<Extension()>
Public Function ReadContentAsJsonAsync(Of T) (message As HttpResponseMessage, Optional rewindContentStream As Boolean = false) As Task(Of T)

Type Parameters

T

The type of object contained in the JSON.

Parameters

message
HttpResponseMessage

The response message to be read.

rewindContentStream
Boolean

Rewind content stream if set to true.

Returns

Task<T>

An object of type T instantiated from the response message's body.

Applies to