Interface IHttpContentDeserializer
Represents an element which is able to deserialize .NET objects from an HttpContent instance.
Consider deriving from HttpContentSerializer instead of implementing this interface directly.
Namespace: ReqRest.Serializers
Assembly: ReqRest.dll
Syntax
public interface IHttpContentDeserializer
Methods
DeserializeAsync(Nullable<HttpContent>, Type)
Deserializes an object of the specified contentType from
the httpContent.
Declaration
Task<object? > DeserializeAsync(HttpContent? httpContent, Type contentType)
Parameters
| Type | Name | Description |
|---|---|---|
| Nullable<HttpContent> | httpContent | An HttpContent instance from which the content should be serialized. This can be null. |
| Type | contentType | The target type of the object which is supposed to be deserialized. |
Returns
| Type | Description |
|---|---|
| Task<Nullable<Object>> | An object of type |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
| HttpContentSerializationException | Deserializing the content failed. |