# http: 响应体过大

- **ID:** `go/http-response-body-too-large`
- **领域:** go
- **类别:** network_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

服务器发送的响应体超过了客户端配置的限制，通常是由于缺少 Content-Length 头。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 1.17 | active | — | — |
| 1.18 | active | — | — |
| 1.19 | active | — | — |

## 解决方案

1. **** (90% 成功率)
   ```
   Use io.LimitReader on the response body with a reasonable limit.
   ```
2. **** (85% 成功率)
   ```
   Set MaxBytesReader on the server side to limit request sizes.
   ```

## 无效尝试

- **** — This may cause memory exhaustion. (60% 失败率)
- **** — The response is incomplete and may cause parsing errors. (80% 失败率)
