List of HTTP header fields
{{Short description|None}}
{{Use mdy dates|date=June 2019}}
{{Use American English|date=June 2019}}
{{HTTP}}
HTTP header fields are a list of strings sent and received by both the client program and server on every HTTP request and response. These headers are usually invisible to the end-user and are only processed or logged by the server and client applications. They define how information sent/received through the connection are encoded (as in Content-Encoding), the session verification and identification of the client (as in browser cookies, IP address, user-agent) or their anonymity thereof (VPN or proxy masking, user-agent spoofing), how the server should handle data (as in Do-Not-Track or Global Privacy Control), the age (the time it has resided in a shared cache) of the document being downloaded, amongst others.
General format
In HTTP version 1.x, header fields are transmitted after the request line (in case of a request HTTP message) or the response line (in case of a response HTTP message), which is the first line of a message. Header fields are colon-separated key-value pairs in clear-text string format, terminated by a carriage return (CR) and line feed (LF) character sequence. The end of the header section is indicated by an empty field line, resulting in the transmission of two consecutive CR-LF pairs. In the past, long lines could be folded into multiple lines; continuation lines are indicated by the presence of a space (SP) or horizontal tab (HT) as the first character on the next line. This folding was deprecated in RFC 7230.{{Cite ietf |date=June 2014 |rfc=7230 |title=Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing |section=3.2.4 |sectionname=Field Parsing}}
HTTP/2{{cite ietf |rfc=9113 |title=HTTP/2 |date=June 2022}} and HTTP/3 instead use a binary protocol, where headers are encoded in a single HEADERS
and zero or more CONTINUATION
frames using HPACK{{cite journal|url=https://tools.ietf.org/html/rfc7541|title=HPACK: Header Compression for HTTP/2|publisher=IETF|date=May 2015|doi=10.17487/RFC7541 |access-date=2021-12-13|last1=Peon |first1=R. |last2=Ruellan |first2=H. }} (HTTP/2) or QPACK (HTTP/3), which both provide efficient header compression. The request or response line from HTTP/1 has also been replaced by several pseudo-header fields, each beginning with a colon (:
).
Field names
A core set of fields is standardized by the Internet Engineering Task Force (IETF) in {{IETF RFC|9110|9111|leadout=and}}. The [https://www.iana.org/assignments/http-fields/http-fields.xhtml#field-names Field Names], [https://www.iana.org/assignments/message-headers/message-headers.xml#perm-headers Header Fields] and [https://www.iana.org/assignments/message-headers/message-headers.xml#prov-headers Repository of Provisional Registrations] are maintained by the IANA. Additional field names and permissible values may be defined by each application.
Header field names are case-insensitive.{{Cite ietf |date=June 2022 |rfc=9110 |title=HTTP Semantics |section=5.1 |sectionname=Field Names}} This is in contrast to HTTP method names (GET, POST, etc.), which are case-sensitive.{{Cite ietf |date=June 2022 |rfc=9110 |title=HTTP Semantics |section=9.1 |sectionname=Methods: Overview}}
HTTP/2 makes some restrictions on specific header fields (see below).
Non-standard header fields were conventionally marked by prefixing the field name with X-
but this convention was deprecated in June 2012 because of the inconveniences it caused when non-standard fields became standard.{{cite journal|url=http://tools.ietf.org/html/rfc6648|title=RFC 6648|author=Internet Engineering Task Force|date=2012-06-01|doi=10.17487/RFC6648 |access-date=2012-11-12}} An earlier restriction on use of Downgraded-
was lifted in March 2013.{{cite web|url=https://www.iana.org/assignments/message-headers/message-headers.xml |title=Message Headers |publisher=Iana.org |date=2014-06-11 |access-date=2014-06-12}}
Field values
A few fields can contain comments (i.e. in User-Agent, Server, Via fields), which can be ignored by software.{{cite ietf |date=June 2022 |rfc=9110 |title=HTTP Semantics |section=5.6.5 |sectionname=Comments}}
Many field values may contain a quality (q) key-value pair separated by equals sign, specifying a weight to use in content negotiation.{{cite ietf |date=June 2022 |rfc=9110 |title=HTTP Semantics |section=12.4.2 |sectionname=Quality Values}} For example, a browser may indicate that it accepts information in German or English, with German as preferred by setting the q value for de
higher than that of en
, as follows:
Accept-Language: de; q=1.0, en; q=0.5
Size limits
The standard imposes no limits to the size of each header field name or value, or to the number of fields. However, most servers, clients, and proxy software impose some limits for practical and security reasons. For example, the Apache 2.3 server by default limits the size of each field to 8,190 bytes, and there can be at most 100 header fields in a single request.{{cite web|url=http://httpd.apache.org/docs/2.3/mod/core.html#limitrequestfieldsize|archive-url=https://web.archive.org/web/20120509104709/https://httpd.apache.org/docs/2.3/mod/core.html#limitrequestfieldsize|archive-date=2012-05-09 |title=core - Apache HTTP Server |publisher=Httpd.apache.org |access-date=2012-03-13}}
Request fields
=Standard request fields=
class="wikitable sortable"
|+ | |||
Name
! class="unsortable" | Description ! class="unsortable" | Example ! Status !Standard | |||
---|---|---|---|
A-IM | Acceptable instance-manipulations for the request.{{cite IETF|rfc=3229}} | A-IM: feed | Permanent
|{{IETF RFC|3229}} |
id="accept-request-header"
| Accept | Media type(s) that is/are acceptable for the response. See Content negotiation. | Accept: text/html | Permanent
|{{IETF RFC|9110}} |
Accept-Charset | Character sets that are acceptable. | Accept-Charset: utf-8 | Permanent
|{{IETF RFC|9110}} |
id="Accept-Datetime"
| Accept-Datetime | Acceptable version in time. | Accept-Datetime: Thu, 31 May 2007 20:35:00 GMT | Provisional
|{{IETF RFC|7089 |
|- id="Accept-Encoding"
| Accept-Encoding || List of acceptable encodings. See HTTP compression. ||Accept-Encoding: gzip, deflate
|| Permanent
|{{IETF RFC|9110}}
|- id="Accept-Language"
| Accept-Language || List of acceptable human languages for response. See Content negotiation. ||Accept-Language: en-US
|| Permanent
|{{IETF RFC|9110}}
|- id="access-control-request-header"
| {{nowrap|Access-Control-Request-Method,
Access-Control-Request-Headers}}{{cite web|url=https://www.w3.org/TR/cors/ |title=Cross-Origin Resource Sharing |access-date=2017-07-24}}|| Initiates a request for cross-origin resource sharing with Origin (below). || Access-Control-Request-Method: GET
|| {{nowrap|Permanent: standard}}
|
|-
| Authorization || Authentication credentials for HTTP authentication. || Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
|| Permanent
|{{IETF RFC|9110}}
|-
| Cache-Control || Used to specify directives that must be obeyed by all caching mechanisms along the request-response chain. || Cache-Control: no-cache
|| Permanent
|{{IETF RFC|9111}}
|-
|- id="connection-request-header"
| Connection || Control options for the current connection and list of hop-by-hop request fields.{{cite ietf
|rfc=9110
|title=HTTP Semantics
|section=7.6.1
|sectionname=Connection header
|date=June 2022
}}
Must not be used with HTTP/2.{{cite ietf
|rfc=9113
|title=HTTP/2
|section=8.2.2
|sectionname=Connection-Specific Header Fields
|date=June 2022
}}
|| Connection: keep-alive
|| Permanent
|{{IETF RFC|9110}}
|-
|- id="content-encoding-request-header"
| Content-Encoding || The type of encoding used on the data. See HTTP compression. || Content-Encoding: gzip
|| Permanent
|{{IETF RFC|9110}}
|- id="content-length-request-header"
| Content-Length || The length of the request body in octets (8-bit bytes). || Content-Length: 348
|| Permanent
|{{IETF RFC|9110}}
|-
| Content-MD5 || A Base64-encoded binary MD5 sum of the content of the request body. || Content-MD5: Q2hlY2sgSW50ZWdyaXR5IQ==
|| Obsolete{{cite ietf |rfc=7231 |title=Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content |appendix=B |sectionname=Changes from RFC 2616 |date=June 2014}}
|{{IETF RFC|1544|1864|4021}}
|- id="content-type-request-header"
| Content-Type || The Media type of the body of the request (used with POST and PUT requests). || Content-Type: application/x-www-form-urlencoded
|| Permanent
|{{IETF RFC|9110}}
|-
| Cookie || An HTTP cookie previously sent by the server with Set-Cookie
(below). || Cookie: $Version=1; Skin=new;
|| Permanent: standard
|{{IETF RFC|2965|6265}}
|- id="Content-Length"
|-
| Date || The date and time at which the message was originated (in "HTTP-date" format as defined by RFC 9110: HTTP Semantics, section 5.6.7 "Date/Time Formats"). || Date: Tue, 15 Nov 1994 08:12:31 GMT
|| Permanent
|{{IETF RFC|9110}}
|-
| Expect || Indicates that particular server behaviors are required by the client. || Expect: 100-continue
|| Permanent
|{{IETF RFC|9110}}
|-
| Forwarded || Disclose original information of a client connecting to a web server through an HTTP proxy.{{cite journal
|url=http://tools.ietf.org/html/rfc7239#section-1
|title=Forwarded HTTP Extension: Introduction
|publisher=IETF
|date=June 2014
|doi=10.17487/RFC7239
|access-date=2016-01-07
|last1=Petersson
|first1=A.
|last2=Nilsson
|first2=M.
}}
|| Forwarded: for=192.0.2.60;proto=http;by=203.0.113.43
Forwarded: for=192.0.2.43, for=198.51.100.17
|| Permanent
|{{IETF RFC|7239|}}
|-
| From || The email address of the user making the request. || From: user@example.com
|| Permanent
|{{IETF RFC|9110}}
|-
|- id="host-request-header"
| Host || The domain name of the server (for virtual hosting), and the TCP port number on which the server is listening. The port number may be omitted if the port is the standard port for the service requested.
Mandatory since HTTP/1.1.{{cite ietf
|rfc=9110
|title=HTTP Semantics
|section=7.2
|sectionname=Host and :authority
|date=June 2022
}}
If the request is generated directly in HTTP/2, it should not be used.{{cite ietf
|rfc=9113
|title=HTTP/2
|section=8.3.1
|sectionname=Request Pseudo-Header Fields
|date=June 2022
}}
| colspan="1"| Host: en.wikipedia.org:8080
Host: en.wikipedia.org
|Permanent
|{{IETF RFC|9110|9113}}
|-
|HTTP2-Settings
|A request that upgrades from HTTP/1.1 to HTTP/2 MUST include exactly one HTTP2-Settings
header field. The HTTP2-Settings
header field is a connection-specific header field that includes parameters that govern the HTTP/2 connection, provided in anticipation of the server accepting the request to upgrade.{{Cite web|url=https://www.iana.org/assignments/message-headers/message-headers.xml|title=Message Headers|website=www.iana.org|access-date=2018-11-26}}{{Cite ietf |rfc=7540 |title=Hypertext Transfer Protocol Version 2 (HTTP/2) |section=3.2.1 |sectionname=HTTP2-Settings Header Field}}
|HTTP2-Settings: token64
|Obsolete
|{{IETF RFC|7540|9113}}
|-
| If-Match || Only perform the action if the client supplied entity matches the same entity on the server. This is mainly for methods like PUT to only update a resource if it has not been modified since the user last updated it. || If-Match: "737060cd8c284d8af7ad3082f209582d"
|| Permanent
|{{IETF RFC|9110}}
|-
| If-Modified-Since || Allows a 304 Not Modified to be returned if content is unchanged. || If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT
|| Permanent
|{{IETF RFC|9110}}
|-
| If-None-Match || Allows a 304 Not Modified to be returned if content is unchanged, see HTTP ETag. || If-None-Match: "737060cd8c284d8af7ad3082f209582d"
|| Permanent
|{{IETF RFC|9110}}
|-
| If-Range || If the entity is unchanged, send me the part(s) that I am missing; otherwise, send me the entire new entity. || If-Range: "737060cd8c284d8af7ad3082f209582d"
|| Permanent
|{{IETF RFC|9110}}
|-
| style=white-space:nowrap | If-Unmodified-Since || Only send the response if the entity has not been modified since a specific time. || If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT
|| Permanent
|{{IETF RFC|9110}}
|-
| Max-Forwards || Limit the number of times the message can be forwarded through proxies or gateways. || Max-Forwards: 10
|| Permanent
|{{IETF RFC|9110}}
|- id="origin-request-header"
| Origin || Initiates a request for cross-origin resource sharing (asks server for Access-Control-* response fields). || Origin:
|| Permanent: standard
|{{IETF RFC|6454}}
|-
| Pragma || Implementation-specific fields that may have various effects anywhere along the request-response chain. || Pragma: no-cache
|| Outdated
|{{IETF RFC|9111}}
|-
|Prefer
|Allows client to request that certain behaviors be employed by a server while processing a request.
|Prefer: return=representation
|Permanent
|{{IETF RFC| 7240}}
|-
| Proxy-Authorization || Authorization credentials for connecting to a proxy. || Proxy-Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
|| Permanent
|{{IETF RFC|9110}}
|- id="range-request-header"
| {{anchor|Range}} Range || Request only part of an entity. Bytes are numbered from 0. See Byte serving. || Range: bytes=500-999
|| Permanent
|{{IETF RFC|9110}}
|-
| Referer{{sic}} || This is the address of the previous web page from which a link to the currently requested page was followed. (The word "referrer" has been misspelled in the RFC as well as in most implementations to the point that it has become standard usage and is considered correct terminology.) ||
|| Permanent
|{{IETF RFC|9110}}
|- id="te-request-header"
| TE || The transfer encodings the user agent is willing to accept: the same values as for the response header field Transfer-Encoding can be used, plus the "trailers" value (related to the "chunked" transfer method) to notify the server it expects to receive additional fields in the trailer after the last, zero-sized, chunk.
Only trailers
is supported in HTTP/2.
|| TE: trailers, deflate
|| Permanent
|{{IETF RFC|9110}}
|-
|Trailer
|The Trailer general field value indicates that the given set of header fields is present in the trailer of a message encoded with chunked transfer coding.
|Trailer: Max-Forwards
|Permanent
|{{IETF RFC|9110}}
|-
|Transfer-Encoding
|The form of encoding used to safely transfer the entity to the user. [https://www.iana.org/assignments/http-parameters Currently defined methods] are: chunked, compress, deflate, gzip, identity.
|Transfer-Encoding: chunked
|Permanent
|{{IETF RFC|9110}}
|-
|- id="user-agent-request-header"
| User-Agent || The user agent string of the user agent. || User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20100101 Firefox/12.0
|| Permanent
|{{IETF RFC|9110}}
|-
| Upgrade || Ask the server to upgrade to another protocol.
|| Upgrade: h2c, HTTPS/1.3, IRC/6.9, RTA/x11, websocket
|| Permanent
|{{IETF RFC|9110}}
|-
| Via || Informs the server of proxies through which the request was sent. || Via: 1.0 fred, 1.1 example.com (Apache/1.1)
|| Permanent
|{{IETF RFC|9110}}
|-
| Warning || A general warning about possible problems with the entity body. || Warning: 199 Miscellaneous warning
|| Obsolete{{cite ietf |rfc=9111 |title=HTTP Caching |section=5.5 |sectionname=Warning header |date=June 2022}}
|{{IETF RFC|7234|9111}}
|}
{{anchor|Common non-standard request headers}}
=Common non-standard request fields=
Response fields
=Standard response fields=
class="wikitable sortable" style="width: 100%" | |||
Field name
! class="unsortable" | Description ! class="unsortable" | Example ! Status !Standard | |||
---|---|---|---|
Accept-CH | Requests HTTP Client Hints | Accept-CH: UA, Platform | Experimental
|{{IETF RFC|8942}} |
id="access-Control-response-headers"
| {{nowrap|Access-Control-Allow-Origin, | Specifying which web sites can participate in cross-origin resource sharing | Access-Control-Allow-Origin: * | {{nowrap|Permanent: standard}}
|{{IETF RFC|7480}} |
id="accept-patch-response-header" | Specifies which patch document formats this server supports | Accept-Patch: text/example;charset=utf-8 | Permanent
|{{IETF RFC|5789}} |
id="accept-ranges-response-header"
| Accept-Ranges | What partial content range types this server supports via byte serving | Accept-Ranges: bytes | Permanent
|{{IETF RFC|9110}} |
Age | The age the object has been in a proxy cache in seconds | Age: 12 | Permanent
|{{IETF RFC|9111}} |
Allow | Valid methods for a specified resource. To be used for a 405 Method not allowed | Allow: GET, HEAD | Permanent
|{{IETF RFC|9110}} |
Alt-Svc{{cite journal|url=https://tools.ietf.org/html/rfc7838|title=HTTP Alternative Services
|publisher=IETF|date=April 2016|doi=10.17487/RFC7838 |access-date=2016-04-19|last1=Nottingham |first1=M. |last2=McManus |first2=P. |last3=Reschke |first3=J. |doi-access=free }} | A server uses "Alt-Svc" header (meaning Alternative Services) to indicate that its resources can also be accessed at a different network location (host or port) or using a different protocol
When using HTTP/2, servers should instead send an ALTSVC frame.{{cite journal|url=https://tools.ietf.org/html/rfc7838#section-3|title=HTTP Alternative Services, section 3 |publisher=IETF|date=April 2016|doi=10.17487/RFC7838 |access-date=2017-06-08|last1=Nottingham |first1=M. |last2=McManus |first2=P. |last3=Reschke |first3=J. |doi-access=free }} | Alt-Svc: http/1.1="http2.example.com:8001"; ma=7200 | Permanent
| |
Cache-Control | Tells all caching mechanisms from server to client whether they may cache this object. It is measured in seconds | Cache-Control: max-age=3600 | Permanent
|{{IETF RFC|9111}} |
Connection | Control options for the current connection and list of hop-by-hop response fields. | Connection: close | Permanent
|{{IETF RFC|9110}} |
Content-Disposition{{cite journal|url=http://tools.ietf.org/html/rfc6266 |title=RFC 6266 |year=2011 |doi=10.17487/RFC6266 |access-date=2015-03-13|last1=Reschke |first1=J. |doi-access=free }} | An opportunity to raise a "File Download" dialogue box for a known MIME type with binary format or suggest a filename for dynamic content. Quotes are necessary with special characters. | Content-Disposition: attachment; filename="fname.ext" | Permanent
|{{IETF RFC|2616|4021|6266}} |
id="content-encoding-response-header"
| Content-Encoding | The type of encoding used on the data. See HTTP compression. | Content-Encoding: gzip | Permanent
|{{IETF RFC|9110}} |
Content-Language | The natural language or languages of the intended audience for the enclosed content{{cite ietf |date=June 2022 |rfc=9110 |title=HTTP Semantics |section=8.5 |sectionname=Content-Language}} | Content-Language: da | Permanent
|{{IETF RFC|9110}} |
id="content-length-response-header"
| Content-Length | The length of the response body in octets (8-bit bytes) | Content-Length: 348 | Permanent
|{{IETF RFC|9110}} |
Content-Location | An alternate location for the returned data | Content-Location: /index.htm | Permanent
|{{IETF RFC|9110}} |
Content-MD5 | A Base64-encoded binary MD5 sum of the content of the response | Content-MD5: Q2hlY2sgSW50ZWdyaXR5IQ== | Obsolete
|{{IETF RFC|1544|1864|4021}} |
id="content-range-response-header"
| Content-Range | Where in a full body message this partial message belongs | Content-Range: bytes 21010-47021/47022 | Permanent
|{{IETF RFC|9110}} |
id="content-type-response-header"
| Content-Type | The MIME type of this content | Content-Type: text/html; charset=utf-8 | Permanent
|{{IETF RFC|9110}} |
Date | The date and time that the message was sent (in "HTTP-date" format as defined by RFC 9110) | Date: Tue, 15 Nov 1994 08:12:31 GMT | Permanent
|{{IETF RFC|9110}} |
Delta-Base | Specifies the delta-encoding entity tag of the response. | Delta-Base: "abc" | Permanent
|{{IETF RFC|3229}} |
ETag | An identifier for a specific version of a resource, often a message digest | ETag: "737060cd8c284d8af7ad3082f209582d" | Permanent
|{{IETF RFC|9110}} |
id="Expires"
| Expires | Gives the date/time after which the response is considered stale (in "HTTP-date" format as defined by RFC 9110) | Expires: Thu, 01 Dec 1994 16:00:00 GMT | Permanent: standard
|{{IETF RFC|9111}} |
IM | Instance-manipulations applied to the response. | IM: feed | Permanent
|{{IETF RFC|3229}} |
Last-Modified | The last modified date for the requested object (in "HTTP-date" format as defined by RFC 9110) | Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT | Permanent
|{{IETF RFC|9110}} |
Link | Used to express a typed relationship with another resource, where the relation type is defined by RFC 8288 | Link: </feed>; rel="alternate" [https://support.google.com/webmasters/bin/answer.py?hl=en&answer=139394 Indicate the canonical version of a URL by responding with the Link rel="canonical" HTTP header] Retrieved: 2012-02-09 | Permanent
|{{IETF RFC|8288}} |
Location | Used in redirection, or when a new resource has been created.
|
| Permanent
|{{IETF RFC|9110}} | |
P3P | This field is supposed to set P3P policy, in the form of P3P:CP="your_compact_policy" . However, P3P did not take off,W3C [http://www.w3.org/P3P P3P Work Suspended] most browsers have never fully implemented it, a lot of websites set this field with fake policy text, that was enough to fool browsers the existence of P3P policy and grant permissions for third party cookies. | P3P: CP="This is not a P3P policy! See | Permanent
| |
Pragma | Implementation-specific fields that may have various effects anywhere along the request-response chain. | Pragma: no-cache | Permanent
|{{IETF RFC|9111}} |
Preference-Applied
|Indicates which Prefer tokens were honored by the server and applied to the processing of the request. | |Permanent |RFC 7240 | |||
Proxy-Authenticate | Request authentication to access the proxy. | Proxy-Authenticate: Basic | Permanent
|{{IETF RFC|9110}} |
id="PKP"
| Public-Key-Pins{{cite web | url=http://www.rfc-editor.org/rfc/rfc7469.txt | title=Public Key Pinning Extension for HTTP | publisher=IETF | access-date=17 April 2015}} | HTTP Public Key Pinning, announces hash of website's authentic TLS certificate | Public-Key-Pins: max-age=2592000; pin-sha256="E9CZ9INDbd+2eRQozYqqbQ2yXLVKB9+xcprMF+44U1g="; | Permanent
|{{IETF RFC|7469}} |
Retry-After | If an entity is temporarily unavailable, this instructs the client to try again later. Value could be a specified period of time (in seconds) or a HTTP-date.{{cite ietf |date=June 2022 |rfc=9110 |title=HTTP Semantics |section=10.2.3 |sectionname=Retry-After}}
|
| Permanent |{{IETF RFC|9110}} | ||
Server | A name for the server | Server: Apache/2.4.1 (Unix) | Permanent
|{{IETF RFC|9110}} |
id="innerlink_set-cookie" | Set-Cookie | An HTTP cookie | Set-Cookie: CookieName=CookieValue; Max-Age=3600; Version=1 | Permanent: standard
|{{IETF RFC|6265}} |
Strict-Transport-Security | A HSTS Policy informing the HTTP client how long to cache the HTTPS only policy and whether this applies to subdomains. | Strict-Transport-Security: max-age=16070400; includeSubDomains | Permanent: standard
| |
id="trailer-response-header"
| Trailer | The Trailer general field value indicates that the given set of header fields is present in the trailer of a message encoded with chunked transfer coding. | Trailer: Max-Forwards | Permanent
|{{IETF RFC|9110}} |
id="transfer-encoding-response-header"
| Transfer-Encoding | The form of encoding used to safely transfer the entity to the user. [https://www.iana.org/assignments/http-parameters Currently defined methods] are: chunked, compress, deflate, gzip, identity. | Transfer-Encoding: chunked | Permanent
|{{IETF RFC|9110}} |
Tk
|Tracking Status header, value suggested to be sent in response to a DNT(do-not-track), possible values: "!" — under construction "?" — dynamic "G" — gateway to multiple parties "N" — not tracking "T" — tracking "C" — tracking with consent "P" — tracking only if consented "D" — disregarding DNT "U" — updated | |Permanent | | |||
Upgrade | Ask the client to upgrade to another protocol. | Upgrade: h2c, HTTPS/1.3, IRC/6.9, RTA/x11, websocket | Permanent
|{{IETF RFC|9110}} |
Vary | Tells downstream proxies how to match future request headers to decide whether the cached response can be used rather than requesting a fresh one from the origin server. | * Example 1: Vary: *
| Permanent
|{{IETF RFC|9110}} |
Via | Informs the client of proxies through which the response was sent. | Via: 1.0 fred, 1.1 example.com (Apache/1.1) | Permanent
|{{IETF RFC|9110}} |
Warning | A general warning about possible problems with the entity body. | Warning: 199 Miscellaneous warning | Obsolete
|{{IETF RFC|7234|9111}} |
id="www-authenticate-response-header"
| WWW-Authenticate | Indicates the authentication scheme that should be used to access the requested entity. | WWW-Authenticate: Basic | Permanent
|{{IETF RFC|9110}} |
id="Frame-Options" | Clickjacking protection: deny - no rendering within a frame, sameorigin - no rendering if origin mismatch, allow-from - allow from specified location, allowall - non-standard, allow from any location | X-Frame-Options: deny | Obsolete{{cite web|url=http://www.w3.org/TR/CSP11/#frame-ancestors-and-frame-options |title=Content Security Policy Level 2 |access-date=2014-08-02}}
| |
=Common non-standard response fields=
Effects of selected fields
=Avoiding caching=
If a web server responds with Cache-Control: no-cache
then a web browser or other caching system (intermediate proxies) must not use the response to satisfy subsequent requests without first checking with the originating server (this process is called validation). This header field is part of HTTP version 1.1, and is ignored by some caches and browsers. It may be simulated by setting the Expires
HTTP version 1.0 header field value to a time earlier than the response time. Notice that no-cache is not instructing the browser or proxies about whether or not to cache the content. It just tells the browser and proxies to validate the cache content with the server before using it (this is done by using If-Modified-Since, If-Unmodified-Since, If-Match, If-None-Match attributes mentioned above). Sending a no-cache value thus instructs a browser or proxy to not use the cache contents merely based on "freshness criteria" of the cache content. Another common way to prevent old content from being shown to the user without validation is Cache-Control: max-age=0
. This instructs the user agent that the content is stale and should be validated before use.
The header field Cache-Control: no-store
is intended to instruct a browser application to make a best effort not to write it to disk (i.e not to cache it).
The request that a resource should not be cached is no guarantee that it will not be written to disk. In particular, the HTTP/1.1 definition draws a distinction between history stores and caches. If the user navigates back to a previous page a browser may still show you a page that has been stored on disk in the history store. This is correct behavior according to the specification. Many user agents show different behavior in loading pages from the history store or cache depending on whether the protocol is HTTP or HTTPS.
The Cache-Control: no-cache
HTTP/1.1 header field is also intended for use in requests made by the client. It is a means for the browser to tell the server and any intermediate caches that it wants a fresh version of the resource. The Pragma: no-cache
header field, defined in the HTTP/1.0 spec, has the same purpose. It, however, is only defined for the request header. Its meaning in a response header is not specified.{{cite ietf |date=June 2022 |rfc=9111 |title=HTTP Caching |section=5.4 |sectionname=Pragme}} The behavior of Pragma: no-cache
in a response is implementation specific. While some user agents do pay attention to this field in responses,{{cite web|url= https://support.microsoft.com/en-us/kb/234067/ |title=How to prevent caching in Internet Explorer |publisher=Microsoft |date=2011-09-22 |access-date=2015-04-15}} the HTTP/1.1 RFC specifically warns against relying on this behavior.
See also
References
{{reflist}}
{{CCBYSASource
|sourcepath = https://stackoverflow.com/q/25433258
|sourcearticle = What is the X-REQUEST-ID http header?
|revision = 27174552
|author(s) = [https://stackoverflow.com/users/693140/stefan-k%c3%b6gl Stefan Kögl] at Stack Exchange }}
{{reflist|group=stackoverflow2}}
{{CCBYSASource
|sourcepath = https://stackoverflow.com/q/1288338
|sourcearticle = Why does ASP.NET framework add the 'X-Powered-By:ASP.NET' HTTP Header in responses?
|revision = 1288385
|author(s) = [https://stackoverflow.com/users/59301/adrian-grigore Adrian Grigore] at Stack Exchange }}
{{reflist|group=stackoverflow1}}
External links
- [https://www.iana.org/assignments/message-headers/message-headers.xml#perm-headers|Message Headers: Permanent Message Header Field Names]
- {{IETF RFC|6265|link=no}}: IETF HTTP State Management Mechanism
- {{IETF RFC|9110|link=no}}: HTTP Semantics
- {{IETF RFC|9111|link=no}}: HTTP Caching
- {{IETF RFC|9112|link=no}}: HTTP/1.1
- {{IETF RFC|9113|link=no}}: HTTP/2
- {{IETF RFC|9114|link=no}}: HTTP/3
- {{IETF RFC|7239|link=no}}: Forwarded HTTP Extension
- {{IETF RFC|7240|link=no}}: Prefer Header for HTTP
- [http://www.and.org/texts/server-http HTTP/1.1 headers from a web server point of view]
- [http://blogs.msdn.com/b/ieinternals/archive/2009/06/30/internet-explorer-custom-http-headers.aspx Internet Explorer and Custom HTTP Headers - EricLaw's IEInternals - Site Home - MSDN Blogs]
{{DEFAULTSORT:List Of Http Header Fields}}