Class HttpContentExtensions

Extension methods for the class.

Inheritance
object
HttpContentExtensions
Namespace: StylelabsStylelabs.MSdkWebClientHttp
Assembly: Stylelabs.M.Sdk.WebClient.dll
Syntax
RequestResponse

public static class HttpContentExtensions

Methods

ReadAsJsonAsync(HttpContent)

Reads the content as a .

Declaration
RequestResponse

public static Task<JToken> ReadAsJsonAsync(this HttpContent content)
Parameters
TypeNameDescription
HttpContentcontent

The .

Returns
TypeDescription
Task<>JToken

An .

ReadAsJsonAsync<T>(HttpContent)

Parses the content as json and deserializes it to T.

Declaration
RequestResponse

public static Task<T> ReadAsJsonAsync<T>(this HttpContent content)
Parameters
TypeNameDescription
HttpContentcontent

The .

Returns
TypeDescription
Task<>

The response as json.

Type Parameters
NameDescription
T

Type to deserialize to.

Do you have some feedback for us?

If you have suggestions for improving this article,