EasyAF_Http_NewtonsoftJson_HttpResponseMessageExtensions
Provides extension methods for HttpResponseMessage to deserialize JSON responses using Newtonsoft.Json. Includes support for both success and error response handling with automatic contract resolver configuration.Syntax
Inheritance
Methods
DeserializeResponseAsync<T>
Parameters
- message HttpResponseMessage: The HTTP response message to deserialize.
- settings
JsonSerializerSettings: The JSON serializer settings to use for deserialization.
Returns
Task<(T Response, string ErrorContent)> A tuple containing either the deserialized response object or error content string.DeserializeResponseAsync<T>
Parameters
- message HttpResponseMessage: The HTTP response message to deserialize.
Returns
Task<(T Response, string ErrorContent)> A tuple containing either the deserialized response object or error content string.DeserializeResponseAsync<TResponse, TError>
Parameters
- message HttpResponseMessage: The HTTP response message to deserialize.
- settings
JsonSerializerSettings: The JSON serializer settings to use for deserialization.
Returns
Task<(TResponse Response, TError ErrorContent)> A tuple containing either the deserialized response object or deserialized error object.DeserializeResponseAsync<TResponse, TError>
Parameters
- message HttpResponseMessage: The HTTP response message to deserialize.