# net/http: request canceled (Client.Timeout exceeded while awaiting headers)

- **ID:** `go/deadline-exceeded-http-client`
- **Domain:** go
- **Category:** network_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

HTTP client request timed out because the server took longer than the configured Timeout or context deadline to send response headers.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Go 1.18 | active | — | — |
| Go 1.19 | active | — | — |
| Go 1.20 | active | — | — |

## Workarounds

1. **Set a reasonable Timeout on the http.Client and use a context with deadline for the request** (85% success)
   ```
   Set a reasonable Timeout on the http.Client and use a context with deadline for the request
   ```
2. **Implement retry logic with exponential backoff and jitter for transient network issues** (90% success)
   ```
   Implement retry logic with exponential backoff and jitter for transient network issues
   ```

## Dead Ends

- **** — This masks the underlying issue; if the server is slow or misconfigured, the request still fails eventually or blocks resources. (70% fail)
- **** — Retrying without backoff can overwhelm the server and cause cascading failures. (85% fail)
