HTTP headers are a means for a client, server, and any intermediaries to exchange information during the HTTP request-response process.
- HTTP header categories and names
- Client Hints
- Network client hints
- Connection Management
- Content negotiation
- Message body information
- Request context
- Response context
- Range requests
- Fetch metadata request headers
- Server-Sent events
- Transfer coding
HTTP headers are a pillar of HTTP messages. Servers and clients alike rely on the information exchanged in HTTP headers regardless of whether they are in the HTTP request or HTTP response. There are HTTP request-specific headers that might contain information about the client, HTTP response-specific headers that may contain details about the host, and HTTP headers that are common on both sides of the conversation. A representational HTTP header, for example, contains information about the body of the resource such as how it is encoded. There are also payload headers, which hold representation-independent information such as the size of the message body.
HTTP headers can be further characterized by their scope within the message chain. An end-to-end header that is sent by the client must be transmitted to the server, unmodified by intermediaries, and stored by caches as appropriate. Conversely, a hop-by-hop header is only relevant between nodes, and as such, not forwarded or stored by caches.
There are many different types of HTTP headers that describe or govern processes such as authentication, caching, message body information, and proxies. For example, Cookies are transmitted via HTTP headers, and they are responsible for maintaining the current client’s state in a stateless system.
HTTP header categories and names
Network client hints
Message body information
- Cross-Origin-Embedder-Policy (COEP)
- Cross-Origin-Opener-Policy (COOP)
- Cross-Origin-Resource-Policy (CORP)
- Content-Security-Policy (CSP)
- Strict-Transport-Security (HSTS)
Fetch metadata request headers
HTTP headers are part of the HTTP messaging architecture, with both client and server relying on them for information, direction, and general assistance.