HTTP Headers Guide

Request Headers

HeaderPurposeExample
AcceptContent types client acceptstext/html, application/json
AuthorizationAuth credentialsBearer {token}
Content-TypeBody formatapplication/json; charset=utf-8
User-AgentClient software infoMozilla/5.0 ...
CookieSession cookiessession=abc123
RefererOrigin page URLhttps://example.com/page
Cache-ControlCaching directivesno-cache, max-age=3600
Accept-LanguagePreferred languageen-US,en;q=0.9

Response Headers

HeaderPurposeExample
Content-TypeResponse body formatapplication/json
Set-CookieSets browser cookieid=a3; HttpOnly; Secure
LocationRedirect URL (3xx)https://example.com/new
Cache-ControlCaching policypublic, max-age=86400
ETagResource version tag"33a64df5"
X-Frame-OptionsClickjacking protectionDENY or SAMEORIGIN
CORS (Access-Control-Allow-Origin)Cross-origin access* or https://allowed.com
Strict-Transport-SecurityForce HTTPS (HSTS)max-age=31536000; includeSubDomains
Content-Security-PolicyAllowed resource sourcesdefault-src 'self'