HTTP Headers Reference

A practical guide to common HTTP headers used for auth, caching, security, and content negotiation.

General Headers

Key / CodeDescription
DateTimestamp when the message was generated.
ConnectionControl connection options like keep-alive.
Transfer-EncodingSpecify transfer encodings such as chunked.
UpgradeRequest protocol upgrade (e.g., WebSocket).
ViaTrack proxies/gateways between client and server.

Request Headers

Key / CodeDescription
AcceptMedia types acceptable for the response.
Accept-EncodingSupported compression (gzip, br).
AuthorizationCredentials for authenticating a user agent.
Content-TypeMedia type of the request body.
User-AgentClient identifier string.
OriginOrigin of the request (CORS).

Response Headers

Key / CodeDescription
Content-TypeMedia type of the response body.
Set-CookieSet a cookie on the client.
LocationRedirect target for 3xx responses.
WWW-AuthenticateAuth challenge for 401 responses.
ServerServer software identifier.

Caching Headers

Key / CodeDescription
Cache-ControlCaching directives (max-age, no-store).
ETagResource version identifier for validation.
Last-ModifiedLast modification date for conditional requests.
If-None-MatchValidate cache using ETag.
ExpiresAbsolute expiry time for cache.
VaryCache key based on request headers.

Security Headers

Key / CodeDescription
Strict-Transport-SecurityEnforce HTTPS for future requests.
Content-Security-PolicyRestrict resource loading to reduce XSS.
X-Content-Type-OptionsPrevent MIME sniffing (nosniff).
X-Frame-OptionsMitigate clickjacking (DENY/SAMEORIGIN).
Referrer-PolicyControl referrer information in requests.
Permissions-PolicyEnable/disable browser features.
Knowledge is power.