What are HTTP Headers?
HTTP headers are key-value pairs sent with every request and response. They carry metadata about the content, connection, caching, authentication, and security policies.
Common Request Headers
Host— the domain being requested (required in HTTP/1.1)User-Agent— identifies the browser or clientAccept— content types the client can handleAuthorization— credentials, e.g.Bearer <token>Content-Type— the format of the request body (e.g.application/json)Cookie— cookies sent to the server
Common Response Headers
Content-Type— format of the response bodyCache-Control— caching rules (e.g.max-age=86400)Location— redirect target URL (used with 301/302 status codes)Set-Cookie— sets a cookie in the browserStrict-Transport-Security— forces HTTPS for future visitsX-Frame-Options— prevents clickjacking by controlling iframe embeddingContent-Security-Policy— restricts what resources the page can load
Inspect the HTTP headers returned by any URL: Open HTTP Headers Checker →
Frequently Asked Questions
What is Content-Type?
Content-Type tells the recipient what format the body is in — application/json for JSON, text/html for HTML, multipart/form-data for file uploads.
What is CORS and how do headers enable it?
Cross-Origin Resource Sharing (CORS) allows or restricts cross-origin requests. The server controls it with the Access-Control-Allow-Origin response header. Without it, browsers block cross-origin API calls by default.
Related Terms
- HTTP Redirects — Use the Location header to send browsers to a new URL.
- SSL/TLS — Headers like HSTS enforce HTTPS connections.