2.16.0
(feat): Add support for accessing raw HTTP response data alongside typed response objects using .WithRawResponse().
HTTP endpoint methods now return WithRawResponseTask<T>, which provides two usage patterns:
- Default behavior: Direct
awaitreturns just the typed data (zero-allocation fast path) - Raw response access: Await with
.WithRawResponse()returns both data and HTTP metadata
Example usage:
New types:
WithRawResponseTask<T>- Awaitable task wrapper supporting both usage patternsWithRawResponse<T>- Container for data + raw response metadataRawResponse- HTTP response metadata (status code, headers, URL)ResponseHeaders- Case-insensitive header collection with enumeration support
Benefits:
- Zero overhead when raw response access isn’t needed
- Backward compatible - implicit conversion to
Task<T>supported - Type-safe access to HTTP metadata when debugging or logging
- Case-insensitive header lookups following HTTP standards