docs.rodeo

MDN Web Docs mirror

HTTP headers

{{HTTPSidebar}} 

HTTP headers let the client and the server pass additional information with a message in a request or response. In HTTP/1.X, a header is a case-insensitive name followed by a colon, then optional whitespace which will be ignored, and finally by its value (for example: Allow: POST). In HTTP/2 and above, headers are displayed in lowercase when viewed in developer tools (accept: */*), and prefixed with a colon for a special group of pseudo-headers (:status: 200). You can find more information on the syntax in each protocol version in the HTTP messages page.

Custom proprietary headers have historically been used with an X- prefix, but this convention was deprecated in 2012 because of the inconveniences it caused when nonstandard fields became standard in RFC 6648; others are listed in the IANA HTTP Field Name Registry, whose original content was defined in RFC 4229. The IANA registry lists headers, including information about their status.

Headers can be grouped according to their contexts:

Headers can also be grouped according to how {{Glossary("Proxy_server", "proxies")}}  handle them:

Authentication

Caching

Conditionals

Connection management

Content negotiation

For more details, refer to the Content negotiation article.

Controls

Cookies

CORS

For more information, refer to the CORS documentation.

Downloads

Integrity digests

Message body information

Proxies

Range requests

HTTP range requests allow the client to request a portion of a resource from the server. Range requests are useful for applications like media players that support random access, data tools that know they need only part of a large file, and download managers that let the user pause and resume a download.

Redirects

Request context

Response context

Security

Fetch metadata request headers

{{Glossary("Fetch metadata request header", "Fetch metadata request headers")}}  provide information about the context from which the request originated. A server can use them to make decisions about whether a request should be allowed, based on where the request came from and how the resource will be used.

The following request headers are not strictly “fetch metadata request headers”, but similarly provide information about the context of how a resource will be used. A server might use them to modify its caching behavior, or the information that is returned:

Server-sent events

Transfer coding

WebSockets

Headers used by the WebSockets API in the WebSocket handshake:

Other

Experimental headers

Attribution reporting headers

The Attribution Reporting API enables developers to measure conversions — for example when a user clicks an ad embedded on one site and then proceeds to purchase the item over on the vendor’s site — and then access reports on those conversions. It does this without relying on third-party tracking cookies, instead relying on various headers to register sources and triggers that are matched to indicate a conversion.

Client hints

HTTP Client hints are a set of request headers that provide useful information about the client such as device type and network conditions, and allow servers to optimize what is served for those conditions.

Servers proactively requests the client hint headers they are interested in from the client using {{HTTPHeader("Accept-CH")}} . The client may then choose to include the requested headers in subsequent requests.

The different categories of client hints are listed below.

User agent client hints

The UA client hints are request headers that provide information about the user agent, the platform/architecture it is running on, and user preferences set on the user agent or platform:

[!NOTE] User-agent client hints are not available inside fenced frames because they rely on permissions policy delegation, which could be used to leak data.

Device client hints

Network client hints

Network client hints allow a server to choose what information is sent based on the user choice and network bandwidth and latency.

Privacy

Security

Server-sent events

Topics API

The Topics API provides a mechanism for developers to implement use cases such as interest-based advertising (IBA). See the Topics API documentation for more information.

Other

Non-standard headers

Deprecated headers

Contributing

You can help by writing new entries or improving the existing ones.

See also

In this article

View on MDN