# Get "http://example.com": 上下文截止时间已超过（等待响应头时客户端超时）

- **ID:** `go/http-client-timeout-while-reading`
- **领域:** go
- **类别:** network_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

HTTP客户端在等待服务器响应头时超时，可能由服务器缓慢或网络拥塞导致。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 1.21 | active | — | — |

## 解决方案

1. **** (90% 成功率)
   ```
   Use context.WithTimeout and set a reasonable timeout based on SLA
   ```
2. **** (80% 成功率)
   ```
   Implement circuit breaker to stop hitting slow endpoints
   ```

## 无效尝试

- **** — May hide underlying issues and cause user frustration (40% 失败率)
- **** — Requests will fail consistently (90% 失败率)
