// HTTP HEADER CHEAT SHEET

You clicked header.name in code. Now read about headers.

In HTTP, a request or response carries metadata in headers — key-value pairs likeContent-Type or Authorization. In code, that map is usually called header, and its name field is — you guessed it — header.name.

Request headers

Sent by the client

AcceptMedia types the client can understand
Accept-EncodingCompression the client supports (gzip, br)
AuthorizationCredentials or bearer token
Cache-ControlCaching directives (no-cache, max-age)
Content-TypeMedia type of the request body
CookieSession cookie sent by the client
HostTarget host and port (required, HTTP/1.1)
OriginOrigin of the request (CORS)
RefererPrevious page URL
User-AgentClient software identifier

Response headers

Sent by the server

Cache-ControlHow the response may be cached
Content-TypeMedia type of the response body
ETagValidator for conditional requests
LocationRedirect target (3xx)
ServerServer software identifier
Set-CookieCookie to store client-side
WWW-AuthenticateChallenge for authentication (401)
X-Forwarded-ForClient IP seen by origin (via proxy)

// header.name IN THE WILD

JavaScript (Fetch API)

const res = await fetch('https://api.example.com', {
  headers: { 'Content-Type': 'application/json' }
})
const type = res.headers.get('content-type')

Python (requests)

import requests
r = requests.get('https://api.example.com',
    headers={'Accept': 'application/json'})
print(r.headers.get('content-type'))

Go (net/http)

req.Header.Get("Content-Type")
// header.name — the Name property of a Header map

Rust (axum)

HeaderMap::from(&req.headers())
// headers.get(header::CONTENT_TYPE)

This page exists because .name is a real TLD and auto-linkers turnheader.name into a link. While you are here — why not make a header?

Make my header →

Pro tip: you can fetch this page in plain text with curl https://header.name/.