HTTP headers allow the client and the server to pass additional information with the request or the response. A request header consists of its case-insensitive name followed by a colon ':', then by its value (without line breaks). Leading white space before the value is ignored.

Custom proprietary headers can be added using the 'X-' prefix, but this convention was deprecated in June 2012, because of the inconveniences it caused when non-standard fields became standard in RFC 6648; others are listed in an IANA registry, whose original content was defined in RFC 4229. IANA also maintains a registry of proposed new HTTP message headers.

Headers can be grouped according to their contexts:

  • General header: Headers applying to both requests and responses but with no relation to the data eventually transmitted in the body.
  • Request header: Headers containing more information about the resource to be fetched or about the client itself.
  • Response header: Headers with additional information about the response, like its location or about the server itself (name and version etc.).
  • Entity header: Headers containing more information about the body of the entity, like its content length or its MIME-type.

The following list summaries HTTP headers by their usage category. For an alphabetical list, see the navigation on the left side.

Authentication

WWW-Authenticate
...
Authorization
...
Proxy-Authenticate
...
Proxy-Authorization
...

Caching

Age
...
Cache-Control
Specifies directives for caching mechanisms in both, requests and responses.
Expires
...
Pragma
...
Warning
...

Client hints

Accept-CH
...
Content-DPR
...
DPR
...
Downlink
...
Save-Data
...
Viewport-Width
...
Width
...

Conditionals

Last-Modified
...
ETag
...
If-Match
...
If-None-Match
...
If-Modified-Since
...
If-Unmodified-Since
...

Connection management

Connection
Controls whether or not the network connection stays open after the current transaction finishes.

Content negotiation

Accept
...
Accept-Charset
...
Accept-Encoding
...
Accept-Language
...

Content security policy (CSP)

Content-Security-Policy
Controls resources the user agent is allowed to load for a given page.
Content-Security-Policy-Report-Only
...

Controls

Expect
...
Max-Forwards
...

Cookies

Cookie
...
Set-Cookie
...
Cookie2
...
Set-Cookie2
...

CORS

Access-Control-Allow-Origin
...
Access-Control-Allow-Credentials
...
Access-Control-Expose-Headers
...
Access-Control-Max-Age
...
Access-Control-Allow-Methods
...
Access-Control-Allow-Headers
...
Origin
...
Access-Control-Request-Method
...
Access-Control-Request-Headers
...

Do Not Track

DNT
...

Downloads

Content-Disposition
Is a response header if the ressource transmitted should be displayed inline (default behavior when the header is not present), or it should be handled like a download and the browser should present a 'Save As' window.

HSTS

Strict-Transport-Security
...

Message body information

Content-Length
indicates the size of the entity-body, in decimal number of octets, sent to the recipient.
Content-Type
Indicates the media type of the resource.
Content-Encoding
Used to specify the compression algorithm.
Content-Language
Describes the language(s) intended for the audience, so that it allows a user to differentiate according to the users' own preferred language.
Content-Location
Indicates an alternate location for the returned data.

Message routing

Via
Added by proxies, both forward and reverse proxies, and can appear in the request headers and the response headers.

Redirects

Location
...

Request context

From
Contains an Internet email address for a human user who controls the requesting user agent.
Host
Specifies the domain name of the server (for virtual hosting), and (optionally) the TCP port number on which the server is listening.
Referer
The address of the previous web page from which a link to the currently requested page was followed.
User-Agent
Contains a characteristic string that allows the network protocol peers to identify the application type, operating system, software vendor or software version of the requesting software user agent. See also the Firefox user agent string reference.

Response context

Allow
...
Server
Contains information about the software used by the origin server to handle the request.

Range requests

Accept-Ranges
...
Ranges
...
If-Range
...
Content-Range
...

Server-sent events

Ping-From
...
Ping-To
...
Last-Event-ID
...

Transfer coding

Transfer-Encoding
Specifies the the form of encoding used to safely transfer the entity to the user.
TE
Specifies the transfer encodings the user agent is willing to accept.
Trailer
Allows the sender to include additional fields at the end of chunked message.

WebSockets

Sec-WebSocket-Key
...
Sec-WebSocket-Extensions
...
Sec-WebSocket-Accept
...
Sec-WebSocket-Protocol
...
Sec-WebSocket-Version
...

Other

Date
...
Link
...
Retry-After
...
Upgrade
...
Vary
...
X-Frame-Options
indicates whether or not a browser should be allowed to render a page in a <frame>, <iframe> or <object>.
X-UA-Compatible
...
X-DNS-Prefetch-Control
...
X-Content-Duration
...
X-Requested-With
...

Browser compatibility

Feature Chrome Edge Firefox Internet Explorer Opera Safari Servo
Cache-Control(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
Connection(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
Content-Encoding(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
Content-Disposition(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
Content-Language(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
Content-Length(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
Content-Location(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
Content-Type(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
From(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
Host(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
Referer(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
Server(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
TE(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
Trailer(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
Transfer-Encoding(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
User-Agent(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
Via(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
X-Frame-Options4.0(Yes)1.9.28.010.504.0(Yes)
Feature Android Chrome for Android Edge Mobile Firefox for Android IE Mobile Opera Mobile Safari Mobile
Cache-Control(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
Connection(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
Content-Encoding(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
Content-Disposition(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
Content-Language(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
Content-Length(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
Content-Location(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
Content-Type(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
From(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
Host(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
Referer(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
Server(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
TE(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
Trailer(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
Transfer-Encoding(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
User-Agent(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
Via(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
X-Frame-Options(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)

See also

Document Tags and Contributors

 Last updated by: fscholz,