← Back to DevKit

HTTP Headers Reference

HTTP HEADERS · REFERENCE

A reference of 60+ common request and response headers with usage, examples and security notes — filterable live by name, direction and category.

68 rows
HEADERDIRCATDescriptionExample
AuthorizationreqAuthRequest credentials: Basic / Bearer / Digest schemesBearer eyJhbGciOi…
Proxy-AuthorizationreqAuthCredentials for a proxy serverBasic dXNlcjpwYXNz
WWW-AuthenticateresAuthDeclares the auth method in 401 responsesBearer realm="api"
CookiereqOtherSends stored cookies back to the serversid=abc123; theme=dark
Set-CookieresOtherSets cookies with HttpOnly / Secure / SameSite attributessid=abc; HttpOnly; SameSite=Lax
X-Api-KeyreqAuthDe-facto API key header (non-RFC)ak_live_9f2e…
X-CSRF-TokenreqAuthCSRF protection token (framework convention)9f8e7d6c-…
Cache-ControlbothCachingMaster caching policy: max-age / no-cache / immutable…public, max-age=31536000, immutable
PragmabothCachingHTTP/1.0 legacy equivalent of no-cacheno-cache
ETagresCachingResource fingerprint, pairs with If-None-Match for 304"a3f2-19"
ExpiresresCachingAbsolute expiry (HTTP/1.0 legacy, weaker than Cache-Control)Wed, 21 Oct 2026 07:28:00 GMT
AgeresCachingSeconds the object has sat in a proxy cache24
VaryresCachingRequest headers that key the cache entryAccept-Encoding, User-Agent
Clear-Site-DataresCachingClears browser site data (cache / cookies / storage)"cache", "cookies"
If-None-MatchreqConditionalCarries the last ETag; 304 when it matches"a3f2-19"
If-Modified-SincereqConditionalDate-based conditional request (weaker than ETag)Wed, 21 Oct 2026 07:28:00 GMT
If-MatchreqConditionalOptimistic locking: apply only if the ETag matches"a3f2-19"
If-Unmodified-SincereqConditionalDate-based optimistic lockingWed, 21 Oct 2026 07:28:00 GMT
If-RangereqConditionalGuards Range requests: serve the slice only if unchanged"a3f2-19"
Content-TypebothContentBody media type and charsetapplication/json; charset=utf-8
Content-LengthbothContentBody size in decimal bytes3481
Content-EncodingresContentBody compression: gzip / br / zstdbr
Content-LanguagebothContentLanguage the body is intended forzh-CN
Content-DispositionresContentInline display vs attachment download with filenameattachment; filename="a.pdf"
Content-RangeresContentByte range served in 206 responsesbytes 0-1023/146515
Content-LocationresContentAlternate location for the returned body/docs/en/index.html
AcceptreqContentAcceptable media types (content negotiation)application/json, text/*;q=0.8
Accept-EncodingreqContentAcceptable compressionsgzip, deflate, br
Accept-LanguagereqContentPreferred languages with weightszh-CN, en;q=0.8
Accept-RangesresContentAdvertises support for Range requestsbytes
OriginreqCORSRequest origin (scheme+host+port); sent with CORS and POSThttps://dev.miaokit.tech
Access-Control-Allow-OriginresCORSOrigins allowed to read the response cross-originhttps://dev.miaokit.tech
Access-Control-Allow-MethodsresCORSPreflight response: allowed HTTP methodsGET, POST, PUT
Access-Control-Allow-HeadersresCORSPreflight response: allowed request headersContent-Type, Authorization
Access-Control-Allow-CredentialsresCORSAllows credentialed requests (origin cannot be *)true
Access-Control-Expose-HeadersresCORSExtra response headers readable by JSX-Request-Id
Access-Control-Max-AgeresCORSHow long the preflight result may be cached86400
Timing-Allow-OriginresCORSPermits Resource Timing high-resolution timings*
HostreqOtherTarget host and port; mandatory in HTTP/1.1 (vhost routing)dev.miaokit.tech
User-AgentreqOtherClient software identifierMozilla/5.0 … Chrome/130.0
RefererreqOtherReferring page (historic misspelling, fixed by spec)https://dev.miaokit.tech/
Referrer-PolicybothOtherControls how much referrer is sentstrict-origin-when-cross-origin
RangereqConditionalByte range of the body (resumable downloads)bytes=1048576-
ConnectionbothOtherConnection management: keep-alive / closekeep-alive
UpgradereqOtherProtocol upgrade (with Connection, e.g. WebSocket)websocket
Transfer-EncodingresOtherChunked transfer encodingchunked
ViabothOtherProxies and gateways traversed1.1 example-proxy
DatebothOtherTime the message was producedWed, 21 Oct 2026 07:28:00 GMT
ExpectreqOtherClient expectation (100-continue for large bodies)100-continue
X-Forwarded-ForreqOtherOriginal client IP chain recorded by reverse proxies203.0.113.7, 70.41.3.18
X-Forwarded-ProtoreqOtherOriginal scheme recorded by reverse proxieshttps
X-Request-IdbothOtherCorrelation ID for request tracingf4e1d2c3-0001
X-Requested-WithreqOtherAjax-era marker (XMLHttpRequest), rarely needed nowXMLHttpRequest
Idempotency-KeyreqOtherIdempotency key: retries never double-applyb3c1d9e2-…
ServerresOtherServer software banner (consider minimizing)openresty
LocationresOtherRedirect target (3xx) or new resource (201)/en/t/json/
Retry-AfterresOtherSuggested wait after 503/42930
AllowresOtherSupported methods listed in 405 responsesGET, HEAD, PUT
LinkresOtherResource relations (pagination next/prev, preload)</page/2>; rel="next"
RefreshresOtherNon-standard timed refresh/redirect5; url=/new
Strict-Transport-SecurityresOtherHSTS: force HTTPS duration and subdomainsmax-age=31536000; includeSubDomains
Content-Security-PolicyresOtherCSP: allowlist for scripts, styles and moredefault-src 'self'
X-Content-Type-OptionsresOtherDisables MIME sniffing (nosniff)nosniff
X-Frame-OptionsresOtherAnti-framing (DENY/SAMEORIGIN; superseded by CSP frame-ancestors)DENY
Permissions-PolicyresOtherBrowser feature grants: camera, geolocation…camera=(), geolocation=(self)
X-RateLimit-LimitresOtherRate-limit quota (usually with Remaining/Reset)600
X-RateLimit-RemainingresOtherQuota remaining in the window587
X-RateLimit-ResetresOtherWhen the quota resets (seconds or timestamp)1729900000
The DIR column: req / res / both. Security notes are folded into the descriptions: never log Authorization, credentialed CORS cannot use *, and HSTS binds you once sent.

>_ USAGE GUIDE

Debugging an API usually means staring at headers: why did auth fail, why isn't the cache hitting, why is the cross-origin request blocked? This reference bundles 60+ common headers — request-side, response-side and bidirectional — each with a direction badge, category, bilingual description and example value, filterable live by keyword, direction and category. The data is bundled locally and works offline.

  1. Filter by keyword: type auth, cache or cors; name-prefix matches rank first
  2. Narrow by direction: switch to Request or Response; both headers like Cache-Control always stay
  3. Focus by category: Auth / Caching / Content / CORS / Conditional / Other
  4. Read the examples: values you can paste almost verbatim, such as public, max-age=31536000, immutable

>_ FAQ

Q1 · What is the correct Bearer format for Authorization?

Authorization: Bearer <token> — one space after Bearer, no quotes around the token. Basic auth is Basic base64(user:password). When debugging a 401, verify the format here before doubting the key itself; format errors usually surface as a vague "invalid credentials".

Q2 · Which response headers does CORS require?

The minimum is Access-Control-Allow-Origin; with cookies you also need Access-Control-Allow-Credentials: true and a specific origin (never *). Preflight (OPTIONS) responses require Access-Control-Allow-Methods and Access-Control-Allow-Headers; to read custom headers like X-Request-Id from JS, add Access-Control-Expose-Headers.

Q3 · What are the common Cache-Control recipes?

Hashed static assets: public, max-age=31536000, immutable. HTML entry pages: no-cache (revalidate every time). Sensitive APIs: no-store. Note that no-cache does not mean "never cache" — it means "validate before each use"; max-age=0, must-revalidate is similar but stricter.

Q4 · X-Frame-Options or CSP frame-ancestors?

Both prevent clickjacking. X-Frame-Options is the legacy standard with only DENY and SAMEORIGIN; CSP's frame-ancestors supports origin allowlists and richer semantics. Modern browsers prefer CSP; send both (the legacy header covers old browsers) — the description column notes this.

Q5 · ETag or Last-Modified for 304s?

ETag is a content fingerprint (strong or weak); Last-Modified is a second-resolution timestamp. Prefer ETag — it senses content changes while mtimes can be unreliable after deployments. When both are sent, If-None-Match takes precedence over If-Modified-Since; a matching conditional request returns 304 without a body.

Embed code

Paste the code below into your page to embed this tool as an iframe (nav and footer auto-hidden).

Heightpx
This tool runs entirely in your browser — input never leaves your device. Press Ctrl K to switch tools anytime.