# http: nil body in request

- **ID:** `go/http-client-do-with-nil-body`
- **Domain:** go
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Passing a nil body to http.NewRequest or http.Client.Do, which is not allowed; use http.NoBody instead.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.20 | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   req, _ := http.NewRequest("GET", url, nil) // nil is fine for GET
   ```
2. **** (90% success)
   ```
   Use http.NoBody explicitly: http.NewRequest("POST", url, http.NoBody)
   ```

## Dead Ends

- **** — Still creates a non-nil body that may send Content-Length: 0 (60% fail)
- **** — Panics occur (100% fail)
