← Cheat Sheets

HTTP Headers Cheat Sheet

Request and response headers you will meet.

# HTTP Headers Cheat Sheet

Request and response headers you will meet.

| Header | Purpose |
|---|---|
| `Content-Type` | Format of the body (`application/json`) |
| `Accept` | Formats the client wants |
| `Authorization` | Credentials, e.g. `Bearer <token>` |
| `Cache-Control` | Caching rules (`max-age`, `no-store`, `no-cache`, `public`, `private`) |
| `ETag` / `If-None-Match` | Conditional requests |
| `Set-Cookie` / `Cookie` | Cookies |
| `Location` | Redirect target |
| `Origin` | Where a cross-origin request comes from |
| `Access-Control-Allow-Origin` | CORS permission |
| `Content-Length` | Body size in bytes |
| `Accept-Encoding` / `Content-Encoding` | Compression (`gzip`, `br`) |
| `Retry-After` | When to retry (429, 503) |
| `User-Agent` | Client software |
| `Host` | Requested host |

**Cookie attributes:** `Secure`, `HttpOnly`, `SameSite=Lax|Strict|None`, `Max-Age`, `Path`, `Domain`.