logo
logo

Class HttpContentExtensions

Extension methods for the class.

Inheritance
System.Object
HttpContentExtensions
Namespace: Stylelabs.M.Sdk.WebClient.Http
Assembly: Stylelabs.M.Sdk.WebClient.dll
Syntax
public static class HttpContentExtensions : object

Methods

ReadAsJsonAsync(HttpContent)

Reads the content as a .

Declaration
public static async Task<JToken> ReadAsJsonAsync(this HttpContent content)
Parameters
Type Name Description
HttpContent content

The .

Returns
Type Description
Task<JToken>

An .

ReadAsJsonAsync<T>(HttpContent)

Parses the content as json and deserializes it to T.

Declaration
public static async Task<T> ReadAsJsonAsync<T>(this HttpContent content)
Parameters
Type Name Description
HttpContent content

The .

Returns
Type Description
Task<T>

The response as json.

Type Parameters
Name Description
T

Type to deserialize to.

Can we improve this article ? Provide feedback