Class HttpContentDeserializerExtensions
Extends the IHttpContentDeserializer with default extension methods.
Namespace: ReqRest.Serializers
Assembly: ReqRest.dll
Syntax
public static class HttpContentDeserializerExtensions
Methods
DeserializeAsync<T>(IHttpContentDeserializer, Nullable<HttpContent>)
Deserializes an object of the specified type T from
the httpContent.
Declaration
public static Task<T> DeserializeAsync<T>(this IHttpContentDeserializer serializer, HttpContent? httpContent)
Parameters
| Type | Name | Description |
|---|---|---|
| IHttpContentDeserializer | serializer | The serializer. |
| Nullable<HttpContent> | httpContent | An HttpContent instance from which the content should be serialized. This can be null. |
Returns
| Type | Description |
|---|---|
| Task<T> | An object of type |
Type Parameters
| Name | Description |
|---|---|
| T | The target type of the object which is supposed to be deserialized. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
| InvalidCastException | The serializer returned an object which is not of type |
| HttpContentSerializationException | Deserializing the content failed. |