EasyAF_Http_SystemTextJson_HttpResponseMessageExtensions
Provides extension methods for HttpResponseMessage to deserialize JSON responses using System.Text.Json. Includes support for both success and error response handling with configurable serializer options.Syntax
Inheritance
Methods
DeserializeResponseAsync<T>
Parameters
- message HttpResponseMessage: The HTTP response message to deserialize.
- settings JsonSerializerOptions: The JSON serializer options 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 JsonSerializerOptions: The JSON serializer options 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.