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.
Deserializes the HTTP response message content to the specified type using System.Text.Json with custom options.
Returns either the deserialized response or error content as a string.
public static Task<(T Response, string ErrorContent)> DeserializeResponseAsync<T>(this HttpResponseMessage message)
Deserializes the HTTP response message content to the specified type using System.Text.Json with default options.
Returns either the deserialized response or error content as a string.
public static Task<(TResponse Response, TError ErrorContent)> DeserializeResponseAsync<TResponse, TError>(this HttpResponseMessage message, JsonSerializerOptions settings)
Deserializes the HTTP response message content to strongly-typed response and error objects using System.Text.Json with custom options.
Provides type-safe error handling by deserializing error responses to a specific error type.
public static Task<(TResponse Response, TError ErrorContent)> DeserializeResponseAsync<TResponse, TError>(this HttpResponseMessage message)
Deserializes the HTTP response message content to strongly-typed response and error objects using System.Text.Json with default options.
Provides type-safe error handling by deserializing error responses to a specific error type.