JsonWebResponseUtility.GetJsonAsAsync method (1 of 4)

Parses the JSON into an object of the specified type.

public static Task<object?> GetJsonAsAsync(this HttpResponseMessage response, Type type)
parameter description
response The response.
type The type.

Return Value

An object of the specified type.

Exceptions

exception condition
WebServiceException The response content does not use the JSON content type, or the content is empty, or the text is not valid JSON, or the JSON cannot be deserialized into the specified type.

Remarks

Use JToken as the type to parse arbitrary JSON.

See Also


JsonWebResponseUtility.GetJsonAsAsync method (2 of 4)

Parses the JSON into an object of the specified type.

public static Task<object?> GetJsonAsAsync(this HttpResponseMessage response, Type type, 
    JsonSettings? jsonSettings)
parameter description
response The response.
type The type.
jsonSettings The JSON settings.

Return Value

An object of the specified type.

Exceptions

exception condition
WebServiceException The response content does not use the JSON content type, or the content is empty, or the text is not valid JSON, or the JSON cannot be deserialized into the specified type.

Remarks

Use JToken as the type to parse arbitrary JSON.

See Also


JsonWebResponseUtility.GetJsonAsAsync<T> method (3 of 4)

Parses the JSON into an object of the specified type.

public static Task<T> GetJsonAsAsync<T>(this HttpResponseMessage response)
parameter description
T The specified type.
response The response.

Return Value

An object of the specified type.

Exceptions

exception condition
WebServiceException The response content does not use the JSON content type, or the content is empty, or the text is not valid JSON, or the JSON cannot be deserialized into the specified type.

Remarks

Use JToken as the type to parse arbitrary JSON.

See Also


JsonWebResponseUtility.GetJsonAsAsync<T> method (4 of 4)

Parses the JSON into an object of the specified type.

public static Task<T> GetJsonAsAsync<T>(this HttpResponseMessage response, 
    JsonSettings? jsonSettings)
parameter description
T The specified type.
response The response.
jsonSettings The JSON settings.

Return Value

An object of the specified type.

Exceptions

exception condition
WebServiceException The response content does not use the JSON content type, or the content is empty, or the text is not valid JSON, or the JSON cannot be deserialized into the specified type.

See Also