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. |
An object of the specified type.
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. |
Use JToken as the type to parse arbitrary JSON.
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. |
An object of the specified type.
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. |
Use JToken as the type to parse arbitrary JSON.
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. |
An object of the specified type.
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. |
Use JToken as the type to parse arbitrary JSON.
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. |
An object of the specified type.
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. |