All tools

HTTP Headers Reference

Common HTTP headers with what they do.

HeaderDirectionPurpose
AcceptrequestMedia types the client can handle (e.g., application/json)
Accept-EncodingrequestCompression methods (gzip, br, deflate)
Accept-LanguagerequestPreferred languages (en-US, en;q=0.9)
AuthorizationrequestCredentials (Bearer token, Basic, etc.)
Cache-ControlbothCaching directives (no-cache, max-age, no-store)
Content-EncodingresponseCompression applied (gzip, br)
Content-LengthbothBody size in bytes
Content-TypebothMedia type of the body
CookierequestCookies to send
Set-CookieresponseCookies to set
DateresponseWhen the message was sent
ETagresponseEntity tag for caching
HostrequestDomain being requested
If-Modified-SincerequestConditional GET
If-None-MatchrequestConditional based on ETag
Last-ModifiedresponseWhen the resource was last changed
LocationresponseURL for redirect (3xx) or new resource (201)
OriginrequestWhere the request came from (CORS)
RefererrequestURL the request came from
ServerresponseServer software identifier
User-AgentrequestClient software identifier
X-Forwarded-ForrequestOriginal client IP through proxies
Access-Control-Allow-OriginresponseCORS - which origins can read the response
Access-Control-Allow-MethodsresponseCORS - which HTTP methods are allowed
Strict-Transport-SecurityresponseHSTS - require HTTPS
Content-Security-PolicyresponseCSP - allowed sources of scripts, images, etc.
X-Frame-OptionsresponseAllow / deny embedding in iframes
X-Content-Type-Optionsresponsenosniff prevents MIME type sniffing
VaryresponseHeaders the response varies on (Accept-Encoding)
ConnectionbothKeep-alive vs close
UpgraderequestSwitch protocols (websocket)

Reference for common HTTP headers. Headers prefixed with X- are non-standard but widely used. The IETF moved away from X- prefixes in 2012, but they persist in legacy systems.

About

Reference table of 30+ HTTP headers (Accept, Cache-Control, Content-Type, etc.) with their direction (request, response, both) and purpose.

How to use

  1. Skim for what you need.

FAQ

What about non-standard X- headers?+

X-Forwarded-For and X-Frame-Options are widely used despite the X- prefix. The IETF recommends new headers skip X- per RFC 6648.