Search tools...
Developer Tools

Common HTTP Request & Response Headers: Security, CORS, Caching & Auth

A practical reference for HTTP request and response headers — what they do, when to use them, and common values.

8 min readUpdated September 18, 2026HTTP, Web, API, Developer

An HTTP headers reference is the cheat sheet every backend, frontend, and DevOps engineer keeps within reach. Headers control caching, CORS, authentication, security, content negotiation — almost every cross-cutting concern in HTTP.

This guide groups the headers you'll actually use, explains what each does, and lists common values.

Free Tool

HTTP Headers Reference — Free

Searchable reference for every HTTP header. Copy examples instantly.

Open HTTP Headers Reference ->

Common Request Headers

HeaderPurpose
AuthorizationCredentials (Bearer token, Basic auth)
AcceptContent types client can handle
Accept-LanguagePreferred languages
Accept-EncodingSupported compressions (gzip, br)
Content-TypeBody format on POST/PUT (application/json)
User-AgentClient identification string
CookieSession and persistent state
RefererURL that linked to the request
If-None-MatchConditional GET (ETag)
If-Modified-SinceConditional GET (date)

Common Response Headers

HeaderPurpose
Content-TypeResponse body format
Content-LengthBody size in bytes
Cache-ControlCaching directives (max-age, no-store)
ETagResource version identifier
Last-ModifiedLast change timestamp
Set-CookieSets a cookie on client
LocationRedirect target (3xx)
ServerServer software version

Security Headers (Essential)

HeaderPurpose
Content-Security-PolicyWhitelist allowed scripts/sources
Strict-Transport-SecurityForce HTTPS (HSTS)
X-Content-Type-Optionsnosniff — prevent MIME sniffing
X-Frame-OptionsDENY/SAMEORIGIN — clickjacking protection
Referrer-PolicyControl Referer leak
Permissions-PolicyDisable browser APIs (camera, mic)

Modern sites should set all of these. Use a tool like securityheaders.com to audit.

CORS Headers

HeaderPurpose
Access-Control-Allow-OriginAllowed origin (* or specific URL)
Access-Control-Allow-MethodsPermitted methods (GET, POST, ...)
Access-Control-Allow-HeadersPermitted custom headers
Access-Control-Allow-CredentialsAllow cookies in cross-origin requests
Access-Control-Max-AgeCache preflight response (seconds)
Origin (request)Sent by browser on cross-origin requests

CORS errors? You're missing one of these on the server response.

Caching Headers

Cache-Control directives:

  • public — Cacheable by any cache (CDN, browser).
  • private — Browser only, not shared caches.
  • no-store — Never cache.
  • no-cache — Cache but revalidate before serving.
  • max-age=N — Cache for N seconds.
  • must-revalidate — Stale must check origin.
  • immutable — Never check, never changes (use with hash-based filenames).

Best-practice for hashed assets: Cache-Control: public, max-age=31536000, immutable

Authorization Header Formats

SchemeFormat
BasicAuthorization: Basic base64(user:pass)
Bearer (JWT, OAuth2)Authorization: Bearer eyJhbGc...
DigestAuthorization: Digest username="...",...
API Key (custom)X-API-Key: your-key-here

How to Use the Tool (Step by Step)

  1. 1

    Pick Category

    Request, response, security, CORS, caching.

  2. 2

    Browse Headers

    See purpose, valid values, example.

  3. 3

    Search

    Find specific header by name.

  4. 4

    Copy Examples

    Use in your server config or fetch call.

  5. 5

    Validate

    Test with curl or browser DevTools.

Frequently Asked Questions

Which security headers should every site have?+

CSP, HSTS, X-Content-Type-Options: nosniff, X-Frame-Options: DENY, Referrer-Policy. Audit with securityheaders.com.

How do I fix a CORS error?+

Add Access-Control-Allow-Origin (and Allow-Methods, Allow-Headers if needed) to the server response.

What's the difference between no-cache and no-store?+

no-store never caches. no-cache caches but always revalidates before serving.

Can I see a request's headers in the browser?+

Yes — DevTools > Network tab > pick a request > Headers section shows both request and response headers.

What's a good cache strategy for static assets?+

Hash the filename and use Cache-Control: public, max-age=31536000, immutable. Browser never re-checks until filename changes.

Free — No Signup Required

HTTP Headers Reference — Free

Searchable reference for every HTTP header. Copy examples instantly.

Open HTTP Headers Reference ->

Related Guides