> This page is for SDK, version Legacy.
> For other versions, use one of these documentation indexes:
> - Current (default): https://buildwithfern.com/learn/sdks/current/llms.txt
> - Legacy: https://buildwithfern.com/learn/sdks/legacy/llms.txt

> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt.

## 2.16.0

**`(feat):`** 添加使用 `.WithRawResponse()` 访问原始 HTTP 响应数据和类型化响应对象的支持。

HTTP 端点方法现在返回 `WithRawResponseTask<T>`，提供两种使用模式：

* **默认行为**：直接 `await` 仅返回类型化数据（零分配快速路径）
* **原始响应访问**：使用 `.WithRawResponse()` await 返回数据和 HTTP 元数据

使用示例：

```csharp
// 默认行为 - 仅返回数据
var userData = await client.Users.GetAsync("user-123");

// 访问原始响应元数据
var result = await client.Users.GetAsync("user-123").WithRawResponse();
var data = result.Data;
var statusCode = result.RawResponse.StatusCode;  // HttpStatusCode
var headers = result.RawResponse.Headers;        // ResponseHeaders
var url = result.RawResponse.Url;                // Uri

// 访问特定标头（不区分大小写）
if (headers.TryGetValue("X-Request-Id", out var requestId))
{
    Console.WriteLine($"Request ID: {requestId}");
}

// 检查内容类型和长度
var contentType = headers.ContentType;
var contentLength = headers.ContentLength;
```

新类型：

* `WithRawResponseTask<T>` - 支持两种使用模式的可等待任务包装器
* `WithRawResponse<T>` - 数据 + 原始响应元数据的容器
* `RawResponse` - HTTP 响应元数据（状态代码、标头、URL）
* `ResponseHeaders` - 带有枚举支持的不区分大小写标头集合

优势：

* 不需要原始响应访问时零开销
* 向后兼容 - 支持到 `Task<T>` 的隐式转换
* 调试或日志记录时类型安全地访问 HTTP 元数据
* 遵循 HTTP 标准的不区分大小写标头查找