source: draft-ietf-httpbis/latest/p1-messaging.xml @ 2604

Last change on this file since 2604 was 2604, checked in by fielding@…, 7 years ago

(editorial) disambiguate the it in explanation of absolute-path; see #531

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/xml
File size: 238.5 KB
1<?xml version="1.0" encoding="utf-8"?>
2<?xml-stylesheet type='text/xsl' href='../myxml2rfc.xslt'?>
3<!DOCTYPE rfc [
4  <!ENTITY MAY "<bcp14 xmlns=''>MAY</bcp14>">
5  <!ENTITY MUST "<bcp14 xmlns=''>MUST</bcp14>">
6  <!ENTITY MUST-NOT "<bcp14 xmlns=''>MUST NOT</bcp14>">
7  <!ENTITY OPTIONAL "<bcp14 xmlns=''>OPTIONAL</bcp14>">
8  <!ENTITY RECOMMENDED "<bcp14 xmlns=''>RECOMMENDED</bcp14>">
9  <!ENTITY REQUIRED "<bcp14 xmlns=''>REQUIRED</bcp14>">
10  <!ENTITY SHALL "<bcp14 xmlns=''>SHALL</bcp14>">
11  <!ENTITY SHALL-NOT "<bcp14 xmlns=''>SHALL NOT</bcp14>">
12  <!ENTITY SHOULD "<bcp14 xmlns=''>SHOULD</bcp14>">
13  <!ENTITY SHOULD-NOT "<bcp14 xmlns=''>SHOULD NOT</bcp14>">
14  <!ENTITY ID-VERSION "latest">
15  <!ENTITY ID-MONTH "January">
16  <!ENTITY ID-YEAR "2014">
17  <!ENTITY mdash "&#8212;">
18  <!ENTITY Note "<x:h xmlns:x=''>Note:</x:h>">
19  <!ENTITY caching-overview       "<xref target='Part6' x:rel='#caching.overview' xmlns:x=''/>">
20  <!ENTITY cache-incomplete       "<xref target='Part6' x:rel='#response.cacheability' xmlns:x=''/>">
21  <!ENTITY payload                "<xref target='Part2' x:rel='#payload' xmlns:x=''/>">
22  <!ENTITY media-type            "<xref target='Part2' x:rel='#media.type' xmlns:x=''/>">
23  <!ENTITY content-codings        "<xref target='Part2' x:rel='#content.codings' xmlns:x=''/>">
24  <!ENTITY CONNECT                "<xref target='Part2' x:rel='#CONNECT' xmlns:x=''/>">
25  <!ENTITY content.negotiation    "<xref target='Part2' x:rel='#content.negotiation' xmlns:x=''/>">
26  <!ENTITY diff-mime              "<xref target='Part2' x:rel='#differences.between.http.and.mime' xmlns:x=''/>">
27  <!ENTITY representation         "<xref target='Part2' x:rel='#representations' xmlns:x=''/>">
28  <!ENTITY GET                    "<xref target='Part2' x:rel='#GET' xmlns:x=''/>">
29  <!ENTITY HEAD                   "<xref target='Part2' x:rel='#HEAD' xmlns:x=''/>">
30  <!ENTITY header-allow           "<xref target='Part2' x:rel='#header.allow' xmlns:x=''/>">
31  <!ENTITY header-cache-control   "<xref target='Part6' x:rel='#header.cache-control' xmlns:x=''/>">
32  <!ENTITY header-content-encoding    "<xref target='Part2' x:rel='#header.content-encoding' xmlns:x=''/>">
33  <!ENTITY header-content-location    "<xref target='Part2' x:rel='#header.content-location' xmlns:x=''/>">
34  <!ENTITY header-content-range   "<xref target='Part5' x:rel='#header.content-range' xmlns:x=''/>">
35  <!ENTITY header-content-type    "<xref target='Part2' x:rel='#header.content-type' xmlns:x=''/>">
36  <!ENTITY header-date            "<xref target='Part2' x:rel='' xmlns:x=''/>">
37  <!ENTITY header-etag            "<xref target='Part4' x:rel='#header.etag' xmlns:x=''/>">
38  <!ENTITY header-expect          "<xref target='Part2' x:rel='#header.expect' xmlns:x=''/>">
39  <!ENTITY header-expires         "<xref target='Part6' x:rel='#header.expires' xmlns:x=''/>">
40  <!ENTITY header-last-modified   "<xref target='Part4' x:rel='#header.last-modified' xmlns:x=''/>">
41  <!ENTITY header-mime-version    "<xref target='Part2' x:rel='#mime-version' xmlns:x=''/>">
42  <!ENTITY header-pragma          "<xref target='Part6' x:rel='#header.pragma' xmlns:x=''/>">
43  <!ENTITY header-proxy-authenticate  "<xref target='Part7' x:rel='#header.proxy-authenticate' xmlns:x=''/>">
44  <!ENTITY header-proxy-authorization "<xref target='Part7' x:rel='#header.proxy-authorization' xmlns:x=''/>">
45  <!ENTITY header-server          "<xref target='Part2' x:rel='#header.server' xmlns:x=''/>">
46  <!ENTITY header-warning         "<xref target='Part6' x:rel='#header.warning' xmlns:x=''/>">
47  <!ENTITY idempotent-methods     "<xref target='Part2' x:rel='#idempotent.methods' xmlns:x=''/>">
48  <!ENTITY safe-methods           "<xref target='Part2' x:rel='#safe.methods' xmlns:x=''/>">
49  <!ENTITY methods                "<xref target='Part2' x:rel='#methods' xmlns:x=''/>">
50  <!ENTITY OPTIONS                "<xref target='Part2' x:rel='#OPTIONS' xmlns:x=''/>">
51  <!ENTITY qvalue                 "<xref target='Part2' x:rel='#quality.values' xmlns:x=''/>">
52  <!ENTITY request-header-fields  "<xref target='Part2' x:rel='#request.header.fields' xmlns:x=''/>">
53  <!ENTITY response-control-data  "<xref target='Part2' x:rel='' xmlns:x=''/>">
54  <!ENTITY resource               "<xref target='Part2' x:rel='#resources' xmlns:x=''/>">
55  <!ENTITY semantics              "<xref target='Part2' xmlns:x=''/>">
56  <!ENTITY status-codes           "<xref target='Part2' x:rel='' xmlns:x=''/>">
57  <!ENTITY status-1xx             "<xref target='Part2' x:rel='#status.1xx' xmlns:x=''/>">
58  <!ENTITY status-203             "<xref target='Part2' x:rel='#status.203' xmlns:x=''/>">
59  <!ENTITY status-3xx             "<xref target='Part2' x:rel='#status.3xx' xmlns:x=''/>">
60  <!ENTITY status-304             "<xref target='Part4' x:rel='#status.304' xmlns:x=''/>">
61  <!ENTITY status-4xx             "<xref target='Part2' x:rel='#status.4xx' xmlns:x=''/>">
62  <!ENTITY status-414             "<xref target='Part2' x:rel='#status.414' xmlns:x=''/>">
63  <!ENTITY iana-header-registry   "<xref target='Part2' x:rel='#header.field.registry' xmlns:x=''/>">
65<?rfc toc="yes" ?>
66<?rfc symrefs="yes" ?>
67<?rfc sortrefs="yes" ?>
68<?rfc compact="yes"?>
69<?rfc subcompact="no" ?>
70<?rfc linkmailto="no" ?>
71<?rfc editing="no" ?>
72<?rfc comments="yes"?>
73<?rfc inline="yes"?>
74<?rfc rfcedstyle="yes"?>
75<?rfc-ext allow-markup-in-artwork="yes" ?>
76<?rfc-ext include-references-in-index="yes" ?>
77<rfc obsoletes="2145,2616" updates="2817,2818" category="std" x:maturity-level="proposed"
78     ipr="pre5378Trust200902" docName="draft-ietf-httpbis-p1-messaging-&ID-VERSION;"
79     xmlns:x=''>
80<x:link rel="next" basename="p2-semantics"/>
81<x:feedback template="{docname},%20%22{section}%22&amp;body=&lt;{ref}&gt;:"/>
84  <title abbrev="HTTP/1.1 Message Syntax and Routing">Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing</title>
86  <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
87    <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
88    <address>
89      <postal>
90        <street>345 Park Ave</street>
91        <city>San Jose</city>
92        <region>CA</region>
93        <code>95110</code>
94        <country>USA</country>
95      </postal>
96      <email></email>
97      <uri></uri>
98    </address>
99  </author>
101  <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
102    <organization abbrev="greenbytes">greenbytes GmbH</organization>
103    <address>
104      <postal>
105        <street>Hafenweg 16</street>
106        <city>Muenster</city><region>NW</region><code>48155</code>
107        <country>Germany</country>
108      </postal>
109      <email></email>
110      <uri></uri>
111    </address>
112  </author>
114  <date month="&ID-MONTH;" year="&ID-YEAR;"/>
115  <workgroup>HTTPbis Working Group</workgroup>
119   The Hypertext Transfer Protocol (HTTP) is a stateless application-level
120   protocol for distributed, collaborative, hypertext information systems.
121   This document provides an overview of HTTP architecture and its associated
122   terminology, defines the "http" and "https" Uniform Resource Identifier
123   (URI) schemes, defines the HTTP/1.1 message syntax and parsing
124   requirements, and describes related security concerns for implementations.
128<note title="Editorial Note (To be removed by RFC Editor)">
129  <t>
130    Discussion of this draft takes place on the HTTPBIS working group
131    mailing list (, which is archived at
132    <eref target=""/>.
133  </t>
134  <t>
135    The current issues list is at
136    <eref target=""/> and related
137    documents (including fancy diffs) can be found at
138    <eref target=""/>.
139  </t>
140  <t>
141    The changes in this draft are summarized in <xref target="changes.since.25"/>.
142  </t>
146<section title="Introduction" anchor="introduction">
148   The Hypertext Transfer Protocol (HTTP) is a stateless application-level
149   request/response protocol that uses extensible semantics and
150   self-descriptive message payloads for flexible interaction with
151   network-based hypertext information systems. This document is the first in
152   a series of documents that collectively form the HTTP/1.1 specification:
153   <list style="empty">
154    <t>RFC xxx1: Message Syntax and Routing</t>
155    <t><xref target="Part2" x:fmt="none">RFC xxx2</xref>: Semantics and Content</t>
156    <t><xref target="Part4" x:fmt="none">RFC xxx3</xref>: Conditional Requests</t>
157    <t><xref target="Part5" x:fmt="none">RFC xxx4</xref>: Range Requests</t>
158    <t><xref target="Part6" x:fmt="none">RFC xxx5</xref>: Caching</t>
159    <t><xref target="Part7" x:fmt="none">RFC xxx6</xref>: Authentication</t>
160   </list>
163   This HTTP/1.1 specification obsoletes
164   <xref target="RFC2616" x:fmt="none">RFC 2616</xref> and
165   <xref target="RFC2145" x:fmt="none">RFC 2145</xref> (on HTTP versioning).
166   This specification also updates the use of CONNECT to establish a tunnel,
167   previously defined in <xref target="RFC2817" x:fmt="none">RFC 2817</xref>,
168   and defines the "https" URI scheme that was described informally in
169   <xref target="RFC2818" x:fmt="none">RFC 2818</xref>.
172   HTTP is a generic interface protocol for information systems. It is
173   designed to hide the details of how a service is implemented by presenting
174   a uniform interface to clients that is independent of the types of
175   resources provided. Likewise, servers do not need to be aware of each
176   client's purpose: an HTTP request can be considered in isolation rather
177   than being associated with a specific type of client or a predetermined
178   sequence of application steps. The result is a protocol that can be used
179   effectively in many different contexts and for which implementations can
180   evolve independently over time.
183   HTTP is also designed for use as an intermediation protocol for translating
184   communication to and from non-HTTP information systems.
185   HTTP proxies and gateways can provide access to alternative information
186   services by translating their diverse protocols into a hypertext
187   format that can be viewed and manipulated by clients in the same way
188   as HTTP services.
191   One consequence of this flexibility is that the protocol cannot be
192   defined in terms of what occurs behind the interface. Instead, we
193   are limited to defining the syntax of communication, the intent
194   of received communication, and the expected behavior of recipients.
195   If the communication is considered in isolation, then successful
196   actions ought to be reflected in corresponding changes to the
197   observable interface provided by servers. However, since multiple
198   clients might act in parallel and perhaps at cross-purposes, we
199   cannot require that such changes be observable beyond the scope
200   of a single response.
203   This document describes the architectural elements that are used or
204   referred to in HTTP, defines the "http" and "https" URI schemes,
205   describes overall network operation and connection management,
206   and defines HTTP message framing and forwarding requirements.
207   Our goal is to define all of the mechanisms necessary for HTTP message
208   handling that are independent of message semantics, thereby defining the
209   complete set of requirements for message parsers and
210   message-forwarding intermediaries.
214<section title="Requirement Notation" anchor="intro.requirements">
216   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
217   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
218   document are to be interpreted as described in <xref target="RFC2119"/>.
221   Conformance criteria and considerations regarding error handling
222   are defined in <xref target="conformance"/>.
226<section title="Syntax Notation" anchor="notation">
227<iref primary="true" item="Grammar" subitem="ALPHA"/>
228<iref primary="true" item="Grammar" subitem="CR"/>
229<iref primary="true" item="Grammar" subitem="CRLF"/>
230<iref primary="true" item="Grammar" subitem="CTL"/>
231<iref primary="true" item="Grammar" subitem="DIGIT"/>
232<iref primary="true" item="Grammar" subitem="DQUOTE"/>
233<iref primary="true" item="Grammar" subitem="HEXDIG"/>
234<iref primary="true" item="Grammar" subitem="HTAB"/>
235<iref primary="true" item="Grammar" subitem="LF"/>
236<iref primary="true" item="Grammar" subitem="OCTET"/>
237<iref primary="true" item="Grammar" subitem="SP"/>
238<iref primary="true" item="Grammar" subitem="VCHAR"/>
240   This specification uses the Augmented Backus-Naur Form (ABNF) notation of
241   <xref target="RFC5234"/> with a list extension, defined in
242   <xref target="abnf.extension"/>, that allows for compact definition of
243   comma-separated lists using a '#' operator (similar to how the '*' operator
244   indicates repetition).
245   <xref target="collected.abnf"/> shows the collected grammar with all list
246   operators expanded to standard ABNF notation.
248<t anchor="core.rules">
249  <x:anchor-alias value="ALPHA"/>
250  <x:anchor-alias value="CTL"/>
251  <x:anchor-alias value="CR"/>
252  <x:anchor-alias value="CRLF"/>
253  <x:anchor-alias value="DIGIT"/>
254  <x:anchor-alias value="DQUOTE"/>
255  <x:anchor-alias value="HEXDIG"/>
256  <x:anchor-alias value="HTAB"/>
257  <x:anchor-alias value="LF"/>
258  <x:anchor-alias value="OCTET"/>
259  <x:anchor-alias value="SP"/>
260  <x:anchor-alias value="VCHAR"/>
261   The following core rules are included by
262   reference, as defined in <xref target="RFC5234" x:fmt="," x:sec="B.1"/>:
263   ALPHA (letters), CR (carriage return), CRLF (CR LF), CTL (controls),
264   DIGIT (decimal 0-9), DQUOTE (double quote),
265   HEXDIG (hexadecimal 0-9/A-F/a-f), HTAB (horizontal tab), LF (line feed),
266   OCTET (any 8-bit sequence of data), SP (space), and
267   VCHAR (any visible <xref target="USASCII"/> character).
270   As a convention, ABNF rule names prefixed with "obs-" denote
271   "obsolete" grammar rules that appear for historical reasons.
276<section title="Architecture" anchor="architecture">
278   HTTP was created for the World Wide Web (WWW) architecture
279   and has evolved over time to support the scalability needs of a worldwide
280   hypertext system. Much of that architecture is reflected in the terminology
281   and syntax productions used to define HTTP.
284<section title="Client/Server Messaging" anchor="operation">
285<iref primary="true" item="client"/>
286<iref primary="true" item="server"/>
287<iref primary="true" item="connection"/>
289   HTTP is a stateless request/response protocol that operates by exchanging
290   <x:dfn>messages</x:dfn> (<xref target="http.message"/>) across a reliable
291   transport or session-layer
292   "<x:dfn>connection</x:dfn>" (<xref target=""/>).
293   An HTTP "<x:dfn>client</x:dfn>" is a program that establishes a connection
294   to a server for the purpose of sending one or more HTTP requests.
295   An HTTP "<x:dfn>server</x:dfn>" is a program that accepts connections
296   in order to service HTTP requests by sending HTTP responses.
298<iref primary="true" item="user agent"/>
299<iref primary="true" item="origin server"/>
300<iref primary="true" item="browser"/>
301<iref primary="true" item="spider"/>
302<iref primary="true" item="sender"/>
303<iref primary="true" item="recipient"/>
305   The terms client and server refer only to the roles that
306   these programs perform for a particular connection.  The same program
307   might act as a client on some connections and a server on others.
308   The term "<x:dfn>user agent</x:dfn>" refers to any of the various
309   client programs that initiate a request, including (but not limited to)
310   browsers, spiders (web-based robots), command-line tools, custom
311   applications, and mobile apps.
312   The term "<x:dfn>origin server</x:dfn>" refers to the program that can
313   originate authoritative responses for a given target resource.
314   The terms "<x:dfn>sender</x:dfn>" and "<x:dfn>recipient</x:dfn>" refer to
315   any implementation that sends or receives a given message, respectively.
318   HTTP relies upon the Uniform Resource Identifier (URI)
319   standard <xref target="RFC3986"/> to indicate the target resource
320   (<xref target="target-resource"/>) and relationships between resources.
321   Messages are passed in a format similar to that used by Internet mail
322   <xref target="RFC5322"/> and the Multipurpose Internet Mail Extensions
323   (MIME) <xref target="RFC2045"/> (see &diff-mime; for the differences
324   between HTTP and MIME messages).
327   Most HTTP communication consists of a retrieval request (GET) for
328   a representation of some resource identified by a URI.  In the
329   simplest case, this might be accomplished via a single bidirectional
330   connection (===) between the user agent (UA) and the origin server (O).
332<figure><artwork type="drawing">
333         request   &gt;
334    <x:highlight>UA</x:highlight> ======================================= <x:highlight>O</x:highlight>
335                                &lt;   response
337<iref primary="true" item="message"/>
338<iref primary="true" item="request"/>
339<iref primary="true" item="response"/>
341   A client sends an HTTP request to a server in the form of a <x:dfn>request</x:dfn>
342   message, beginning with a request-line that includes a method, URI, and
343   protocol version (<xref target="request.line"/>),
344   followed by header fields containing
345   request modifiers, client information, and representation metadata
346   (<xref target="header.fields"/>),
347   an empty line to indicate the end of the header section, and finally
348   a message body containing the payload body (if any,
349   <xref target="message.body"/>).
352   A server responds to a client's request by sending one or more HTTP
353   <x:dfn>response</x:dfn>
354   messages, each beginning with a status line that
355   includes the protocol version, a success or error code, and textual
356   reason phrase (<xref target="status.line"/>),
357   possibly followed by header fields containing server
358   information, resource metadata, and representation metadata
359   (<xref target="header.fields"/>),
360   an empty line to indicate the end of the header section, and finally
361   a message body containing the payload body (if any,
362   <xref target="message.body"/>).
365   A connection might be used for multiple request/response exchanges,
366   as defined in <xref target="persistent.connections"/>.
369   The following example illustrates a typical message exchange for a
370   GET request (&GET;) on the URI "":
373Client request:
374</preamble><artwork type="message/http; msgtype=&#34;request&#34;" x:indent-with="  ">
375GET /hello.txt HTTP/1.1
376User-Agent: curl/7.16.3 libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3
378Accept-Language: en, mi
382Server response:
383</preamble><artwork type="message/http; msgtype=&#34;response&#34;" x:indent-with="  ">
384HTTP/1.1 200 OK
385Date: Mon, 27 Jul 2009 12:28:53 GMT
386Server: Apache
387Last-Modified: Wed, 22 Jul 2009 19:15:56 GMT
388ETag: "34aa387-d-1568eb00"
389Accept-Ranges: bytes
390Content-Length: <x:length-of target="exbody"/>
391Vary: Accept-Encoding
392Content-Type: text/plain
394<x:span anchor="exbody">Hello World! My payload includes a trailing CRLF.
399<section title="Implementation Diversity" anchor="implementation-diversity">
401   When considering the design of HTTP, it is easy to fall into a trap of
402   thinking that all user agents are general-purpose browsers and all origin
403   servers are large public websites. That is not the case in practice.
404   Common HTTP user agents include household appliances, stereos, scales,
405   firmware update scripts, command-line programs, mobile apps,
406   and communication devices in a multitude of shapes and sizes.  Likewise,
407   common HTTP origin servers include home automation units, configurable
408   networking components, office machines, autonomous robots, news feeds,
409   traffic cameras, ad selectors, and video delivery platforms.
412   The term "user agent" does not imply that there is a human user directly
413   interacting with the software agent at the time of a request. In many
414   cases, a user agent is installed or configured to run in the background
415   and save its results for later inspection (or save only a subset of those
416   results that might be interesting or erroneous). Spiders, for example, are
417   typically given a start URI and configured to follow certain behavior while
418   crawling the Web as a hypertext graph.
421   The implementation diversity of HTTP means that not all user agents can
422   make interactive suggestions to their user or provide adequate warning for
423   security or privacy concerns. In the few cases where this
424   specification requires reporting of errors to the user, it is acceptable
425   for such reporting to only be observable in an error console or log file.
426   Likewise, requirements that an automated action be confirmed by the user
427   before proceeding might be met via advance configuration choices,
428   run-time options, or simple avoidance of the unsafe action; confirmation
429   does not imply any specific user interface or interruption of normal
430   processing if the user has already made that choice.
434<section title="Intermediaries" anchor="intermediaries">
435<iref primary="true" item="intermediary"/>
437   HTTP enables the use of intermediaries to satisfy requests through
438   a chain of connections.  There are three common forms of HTTP
439   <x:dfn>intermediary</x:dfn>: proxy, gateway, and tunnel.  In some cases,
440   a single intermediary might act as an origin server, proxy, gateway,
441   or tunnel, switching behavior based on the nature of each request.
443<figure><artwork type="drawing">
444         &gt;             &gt;             &gt;             &gt;
445    <x:highlight>UA</x:highlight> =========== <x:highlight>A</x:highlight> =========== <x:highlight>B</x:highlight> =========== <x:highlight>C</x:highlight> =========== <x:highlight>O</x:highlight>
446               &lt;             &lt;             &lt;             &lt;
449   The figure above shows three intermediaries (A, B, and C) between the
450   user agent and origin server. A request or response message that
451   travels the whole chain will pass through four separate connections.
452   Some HTTP communication options
453   might apply only to the connection with the nearest, non-tunnel
454   neighbor, only to the end-points of the chain, or to all connections
455   along the chain. Although the diagram is linear, each participant might
456   be engaged in multiple, simultaneous communications. For example, B
457   might be receiving requests from many clients other than A, and/or
458   forwarding requests to servers other than C, at the same time that it
459   is handling A's request. Likewise, later requests might be sent through a
460   different path of connections, often based on dynamic configuration for
461   load balancing.   
464<iref primary="true" item="upstream"/><iref primary="true" item="downstream"/>
465<iref primary="true" item="inbound"/><iref primary="true" item="outbound"/>
466   The terms "<x:dfn>upstream</x:dfn>" and "<x:dfn>downstream</x:dfn>" are
467   used to describe directional requirements in relation to the message flow:
468   all messages flow from upstream to downstream.
469   The terms inbound and outbound are used to describe directional
470   requirements in relation to the request route:
471   "<x:dfn>inbound</x:dfn>" means toward the origin server and
472   "<x:dfn>outbound</x:dfn>" means toward the user agent.
474<t><iref primary="true" item="proxy"/>
475   A "<x:dfn>proxy</x:dfn>" is a message forwarding agent that is selected by the
476   client, usually via local configuration rules, to receive requests
477   for some type(s) of absolute URI and attempt to satisfy those
478   requests via translation through the HTTP interface.  Some translations
479   are minimal, such as for proxy requests for "http" URIs, whereas
480   other requests might require translation to and from entirely different
481   application-level protocols. Proxies are often used to group an
482   organization's HTTP requests through a common intermediary for the
483   sake of security, annotation services, or shared caching. Some proxies
484   are designed to apply transformations to selected messages or payloads
485   while they are being forwarded, as described in
486   <xref target="message.transformations"/>.
488<t><iref primary="true" item="gateway"/><iref primary="true" item="reverse proxy"/>
489<iref primary="true" item="accelerator"/>
490   A "<x:dfn>gateway</x:dfn>" (a.k.a., "<x:dfn>reverse proxy</x:dfn>") is an
491   intermediary that acts as an origin server for the outbound connection, but
492   translates received requests and forwards them inbound to another server or
493   servers. Gateways are often used to encapsulate legacy or untrusted
494   information services, to improve server performance through
495   "<x:dfn>accelerator</x:dfn>" caching, and to enable partitioning or load
496   balancing of HTTP services across multiple machines.
499   All HTTP requirements applicable to an origin server
500   also apply to the outbound communication of a gateway.
501   A gateway communicates with inbound servers using any protocol that
502   it desires, including private extensions to HTTP that are outside
503   the scope of this specification.  However, an HTTP-to-HTTP gateway
504   that wishes to interoperate with third-party HTTP servers ought to conform
505   to user agent requirements on the gateway's inbound connection.
507<t><iref primary="true" item="tunnel"/>
508   A "<x:dfn>tunnel</x:dfn>" acts as a blind relay between two connections
509   without changing the messages. Once active, a tunnel is not
510   considered a party to the HTTP communication, though the tunnel might
511   have been initiated by an HTTP request. A tunnel ceases to exist when
512   both ends of the relayed connection are closed. Tunnels are used to
513   extend a virtual connection through an intermediary, such as when
514   Transport Layer Security (TLS, <xref target="RFC5246"/>) is used to
515   establish confidential communication through a shared firewall proxy.
518   The above categories for intermediary only consider those acting as
519   participants in the HTTP communication.  There are also intermediaries
520   that can act on lower layers of the network protocol stack, filtering or
521   redirecting HTTP traffic without the knowledge or permission of message
522   senders. Network intermediaries are indistinguishable (at a protocol level)
523   from a man-in-the-middle attack, often introducing security flaws or
524   interoperability problems due to mistakenly violating HTTP semantics.
526<t><iref primary="true" item="interception proxy"/>
527<iref primary="true" item="transparent proxy"/>
528<iref primary="true" item="captive portal"/>
529   For example, an
530   "<x:dfn>interception proxy</x:dfn>" <xref target="RFC3040"/> (also commonly
531   known as a "<x:dfn>transparent proxy</x:dfn>" <xref target="RFC1919"/> or
532   "<x:dfn>captive portal</x:dfn>")
533   differs from an HTTP proxy because it is not selected by the client.
534   Instead, an interception proxy filters or redirects outgoing TCP port 80
535   packets (and occasionally other common port traffic).
536   Interception proxies are commonly found on public network access points,
537   as a means of enforcing account subscription prior to allowing use of
538   non-local Internet services, and within corporate firewalls to enforce
539   network usage policies.
542   HTTP is defined as a stateless protocol, meaning that each request message
543   can be understood in isolation.  Many implementations depend on HTTP's
544   stateless design in order to reuse proxied connections or dynamically
545   load-balance requests across multiple servers.  Hence, a server &MUST-NOT;
546   assume that two requests on the same connection are from the same user
547   agent unless the connection is secured and specific to that agent.
548   Some non-standard HTTP extensions (e.g., <xref target="RFC4559"/>) have
549   been known to violate this requirement, resulting in security and
550   interoperability problems.
554<section title="Caches" anchor="caches">
555<iref primary="true" item="cache"/>
557   A "<x:dfn>cache</x:dfn>" is a local store of previous response messages and the
558   subsystem that controls its message storage, retrieval, and deletion.
559   A cache stores cacheable responses in order to reduce the response
560   time and network bandwidth consumption on future, equivalent
561   requests. Any client or server &MAY; employ a cache, though a cache
562   cannot be used by a server while it is acting as a tunnel.
565   The effect of a cache is that the request/response chain is shortened
566   if one of the participants along the chain has a cached response
567   applicable to that request. The following illustrates the resulting
568   chain if B has a cached copy of an earlier response from O (via C)
569   for a request that has not been cached by UA or A.
571<figure><artwork type="drawing">
572            &gt;             &gt;
573       <x:highlight>UA</x:highlight> =========== <x:highlight>A</x:highlight> =========== <x:highlight>B</x:highlight> - - - - - - <x:highlight>C</x:highlight> - - - - - - <x:highlight>O</x:highlight>
574                  &lt;             &lt;
576<t><iref primary="true" item="cacheable"/>
577   A response is "<x:dfn>cacheable</x:dfn>" if a cache is allowed to store a copy of
578   the response message for use in answering subsequent requests.
579   Even when a response is cacheable, there might be additional
580   constraints placed by the client or by the origin server on when
581   that cached response can be used for a particular request. HTTP
582   requirements for cache behavior and cacheable responses are
583   defined in &caching-overview;. 
586   There are a wide variety of architectures and configurations
587   of caches deployed across the World Wide Web and
588   inside large organizations. These include national hierarchies
589   of proxy caches to save transoceanic bandwidth, collaborative systems that
590   broadcast or multicast cache entries, archives of pre-fetched cache
591   entries for use in off-line or high-latency environments, and so on.
595<section title="Conformance and Error Handling" anchor="conformance">
597   This specification targets conformance criteria according to the role of
598   a participant in HTTP communication.  Hence, HTTP requirements are placed
599   on senders, recipients, clients, servers, user agents, intermediaries,
600   origin servers, proxies, gateways, or caches, depending on what behavior
601   is being constrained by the requirement. Additional (social) requirements
602   are placed on implementations, resource owners, and protocol element
603   registrations when they apply beyond the scope of a single communication.
606   The verb "generate" is used instead of "send" where a requirement
607   differentiates between creating a protocol element and merely forwarding a
608   received element downstream.
611   An implementation is considered conformant if it complies with all of the
612   requirements associated with the roles it partakes in HTTP.
615   Conformance includes both the syntax and semantics of protocol
616   elements. A sender &MUST-NOT; generate protocol elements that convey a
617   meaning that is known by that sender to be false. A sender &MUST-NOT;
618   generate protocol elements that do not match the grammar defined by the
619   corresponding ABNF rules. Within a given message, a sender &MUST-NOT;
620   generate protocol elements or syntax alternatives that are only allowed to
621   be generated by participants in other roles (i.e., a role that the sender
622   does not have for that message).
625   When a received protocol element is parsed, the recipient &MUST; be able to
626   parse any value of reasonable length that is applicable to the recipient's
627   role and matches the grammar defined by the corresponding ABNF rules.
628   Note, however, that some received protocol elements might not be parsed.
629   For example, an intermediary forwarding a message might parse a
630   header-field into generic field-name and field-value components, but then
631   forward the header field without further parsing inside the field-value.
634   HTTP does not have specific length limitations for many of its protocol
635   elements because the lengths that might be appropriate will vary widely,
636   depending on the deployment context and purpose of the implementation.
637   Hence, interoperability between senders and recipients depends on shared
638   expectations regarding what is a reasonable length for each protocol
639   element. Furthermore, what is commonly understood to be a reasonable length
640   for some protocol elements has changed over the course of the past two
641   decades of HTTP use, and is expected to continue changing in the future.
644   At a minimum, a recipient &MUST; be able to parse and process protocol
645   element lengths that are at least as long as the values that it generates
646   for those same protocol elements in other messages. For example, an origin
647   server that publishes very long URI references to its own resources needs
648   to be able to parse and process those same references when received as a
649   request target.
652   A recipient &MUST; interpret a received protocol element according to the
653   semantics defined for it by this specification, including extensions to
654   this specification, unless the recipient has determined (through experience
655   or configuration) that the sender incorrectly implements what is implied by
656   those semantics.
657   For example, an origin server might disregard the contents of a received
658   <x:ref>Accept-Encoding</x:ref> header field if inspection of the
659   <x:ref>User-Agent</x:ref> header field indicates a specific implementation
660   version that is known to fail on receipt of certain content codings.
663   Unless noted otherwise, a recipient &MAY; attempt to recover a usable
664   protocol element from an invalid construct.  HTTP does not define
665   specific error handling mechanisms except when they have a direct impact
666   on security, since different applications of the protocol require
667   different error handling strategies.  For example, a Web browser might
668   wish to transparently recover from a response where the
669   <x:ref>Location</x:ref> header field doesn't parse according to the ABNF,
670   whereas a systems control client might consider any form of error recovery
671   to be dangerous.
675<section title="Protocol Versioning" anchor="http.version">
676  <x:anchor-alias value="HTTP-version"/>
677  <x:anchor-alias value="HTTP-name"/>
679   HTTP uses a "&lt;major&gt;.&lt;minor&gt;" numbering scheme to indicate
680   versions of the protocol. This specification defines version "1.1".
681   The protocol version as a whole indicates the sender's conformance
682   with the set of requirements laid out in that version's corresponding
683   specification of HTTP.
686   The version of an HTTP message is indicated by an HTTP-version field
687   in the first line of the message. HTTP-version is case-sensitive.
689<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="HTTP-version"/><iref primary="true" item="Grammar" subitem="HTTP-name"/>
690  <x:ref>HTTP-version</x:ref>  = <x:ref>HTTP-name</x:ref> "/" <x:ref>DIGIT</x:ref> "." <x:ref>DIGIT</x:ref>
691  <x:ref>HTTP-name</x:ref>     = <x:abnf-char-sequence>"HTTP"</x:abnf-char-sequence> ; "HTTP", case-sensitive
694   The HTTP version number consists of two decimal digits separated by a "."
695   (period or decimal point).  The first digit ("major version") indicates the
696   HTTP messaging syntax, whereas the second digit ("minor version") indicates
697   the highest minor version within that major version to which the sender is
698   conformant and able to understand for future communication.  The minor
699   version advertises the sender's communication capabilities even when the
700   sender is only using a backwards-compatible subset of the protocol,
701   thereby letting the recipient know that more advanced features can
702   be used in response (by servers) or in future requests (by clients).
705   When an HTTP/1.1 message is sent to an HTTP/1.0 recipient
706   <xref target="RFC1945"/> or a recipient whose version is unknown,
707   the HTTP/1.1 message is constructed such that it can be interpreted
708   as a valid HTTP/1.0 message if all of the newer features are ignored.
709   This specification places recipient-version requirements on some
710   new features so that a conformant sender will only use compatible
711   features until it has determined, through configuration or the
712   receipt of a message, that the recipient supports HTTP/1.1.
715   The interpretation of a header field does not change between minor
716   versions of the same major HTTP version, though the default
717   behavior of a recipient in the absence of such a field can change.
718   Unless specified otherwise, header fields defined in HTTP/1.1 are
719   defined for all versions of HTTP/1.x.  In particular, the <x:ref>Host</x:ref>
720   and <x:ref>Connection</x:ref> header fields ought to be implemented by all
721   HTTP/1.x implementations whether or not they advertise conformance with
722   HTTP/1.1.
725   New header fields can be introduced without changing the protocol version
726   if their defined semantics allow them to be safely ignored by recipients
727   that do not recognize them. Header field extensibility is discussed in
728   <xref target="field.extensibility"/>.
731   Intermediaries that process HTTP messages (i.e., all intermediaries
732   other than those acting as tunnels) &MUST; send their own HTTP-version
733   in forwarded messages.  In other words, they are not allowed to blindly
734   forward the first line of an HTTP message without ensuring that the
735   protocol version in that message matches a version to which that
736   intermediary is conformant for both the receiving and
737   sending of messages.  Forwarding an HTTP message without rewriting
738   the HTTP-version might result in communication errors when downstream
739   recipients use the message sender's version to determine what features
740   are safe to use for later communication with that sender.
743   A client &SHOULD; send a request version equal to the highest
744   version to which the client is conformant and
745   whose major version is no higher than the highest version supported
746   by the server, if this is known.  A client &MUST-NOT; send a
747   version to which it is not conformant.
750   A client &MAY; send a lower request version if it is known that
751   the server incorrectly implements the HTTP specification, but only
752   after the client has attempted at least one normal request and determined
753   from the response status code or header fields (e.g., <x:ref>Server</x:ref>) that
754   the server improperly handles higher request versions.
757   A server &SHOULD; send a response version equal to the highest version to
758   which the server is conformant that has a major version less than or equal
759   to the one received in the request.
760   A server &MUST-NOT; send a version to which it is not conformant.
761   A server can send a <x:ref>505 (HTTP Version Not Supported)</x:ref>
762   response if it wishes, for any reason, to refuse service of the client's
763   major protocol version.
766   A server &MAY; send an HTTP/1.0 response to a request
767   if it is known or suspected that the client incorrectly implements the
768   HTTP specification and is incapable of correctly processing later
769   version responses, such as when a client fails to parse the version
770   number correctly or when an intermediary is known to blindly forward
771   the HTTP-version even when it doesn't conform to the given minor
772   version of the protocol. Such protocol downgrades &SHOULD-NOT; be
773   performed unless triggered by specific client attributes, such as when
774   one or more of the request header fields (e.g., <x:ref>User-Agent</x:ref>)
775   uniquely match the values sent by a client known to be in error.
778   The intention of HTTP's versioning design is that the major number
779   will only be incremented if an incompatible message syntax is
780   introduced, and that the minor number will only be incremented when
781   changes made to the protocol have the effect of adding to the message
782   semantics or implying additional capabilities of the sender.  However,
783   the minor version was not incremented for the changes introduced between
784   <xref target="RFC2068"/> and <xref target="RFC2616"/>, and this revision
785   has specifically avoided any such changes to the protocol.
788   When an HTTP message is received with a major version number that the
789   recipient implements, but a higher minor version number than what the
790   recipient implements, the recipient &SHOULD; process the message as if it
791   were in the highest minor version within that major version to which the
792   recipient is conformant. A recipient can assume that a message with a
793   higher minor version, when sent to a recipient that has not yet indicated
794   support for that higher version, is sufficiently backwards-compatible to be
795   safely processed by any implementation of the same major version.
799<section title="Uniform Resource Identifiers" anchor="uri">
800<iref primary="true" item="resource"/>
802   Uniform Resource Identifiers (URIs) <xref target="RFC3986"/> are used
803   throughout HTTP as the means for identifying resources (&resource;).
804   URI references are used to target requests, indicate redirects, and define
805   relationships.
807  <x:anchor-alias value="URI-reference"/>
808  <x:anchor-alias value="absolute-URI"/>
809  <x:anchor-alias value="relative-part"/>
810  <x:anchor-alias value="scheme"/>
811  <x:anchor-alias value="authority"/>
812  <x:anchor-alias value="uri-host"/>
813  <x:anchor-alias value="port"/>
814  <x:anchor-alias value="path"/>
815  <x:anchor-alias value="path-abempty"/>
816  <x:anchor-alias value="segment"/>
817  <x:anchor-alias value="query"/>
818  <x:anchor-alias value="fragment"/>
819  <x:anchor-alias value="absolute-path"/>
820  <x:anchor-alias value="partial-URI"/>
822   The definitions of "URI-reference",
823   "absolute-URI", "relative-part", "scheme", "authority", "port", "host",
824   "path-abempty", "segment", "query", and "fragment" are adopted from the
825   URI generic syntax.
826   An "absolute-path" rule is defined for protocol elements that can contain a
827   non-empty path component. (This rule differs slightly from RFC 3986's
828   path-abempty rule, which allows for an empty path to be used in references,
829   and path-absolute rule, which does not allow paths that begin with "//".)
830   A "partial-URI" rule is defined for protocol elements
831   that can contain a relative URI but not a fragment component.
833<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="URI-reference"><!--exported production--></iref><iref primary="true" item="Grammar" subitem="absolute-URI"/><iref primary="true" item="Grammar" subitem="scheme"/><iref primary="true" item="Grammar" subitem="authority"/><iref primary="true" item="Grammar" subitem="absolute-path"/><iref primary="true" item="Grammar" subitem="port"/><iref primary="true" item="Grammar" subitem="query"/><iref primary="true" item="Grammar" subitem="fragment"/><iref primary="true" item="Grammar" subitem="segment"/><iref primary="true" item="Grammar" subitem="uri-host"/><iref primary="true" item="Grammar" subitem="partial-URI"><!--exported production--></iref>
834  <x:ref>URI-reference</x:ref> = &lt;URI-reference, defined in <xref target="RFC3986" x:fmt="," x:sec="4.1"/>&gt;
835  <x:ref>absolute-URI</x:ref>  = &lt;absolute-URI, defined in <xref target="RFC3986" x:fmt="," x:sec="4.3"/>&gt;
836  <x:ref>relative-part</x:ref> = &lt;relative-part, defined in <xref target="RFC3986" x:fmt="," x:sec="4.2"/>&gt;
837  <x:ref>scheme</x:ref>        = &lt;scheme, defined in <xref target="RFC3986" x:fmt="," x:sec="3.1"/>&gt;
838  <x:ref>authority</x:ref>     = &lt;authority, defined in <xref target="RFC3986" x:fmt="," x:sec="3.2"/>&gt;
839  <x:ref>uri-host</x:ref>      = &lt;host, defined in <xref target="RFC3986" x:fmt="," x:sec="3.2.2"/>&gt;
840  <x:ref>port</x:ref>          = &lt;port, defined in <xref target="RFC3986" x:fmt="," x:sec="3.2.3"/>&gt;
841  <x:ref>path-abempty</x:ref>  = &lt;path-abempty, defined in <xref target="RFC3986" x:fmt="," x:sec="3.3"/>&gt;
842  <x:ref>segment</x:ref>       = &lt;segment, defined in <xref target="RFC3986" x:fmt="," x:sec="3.3"/>&gt;
843  <x:ref>query</x:ref>         = &lt;query, defined in <xref target="RFC3986" x:fmt="," x:sec="3.4"/>&gt;
844  <x:ref>fragment</x:ref>      = &lt;fragment, defined in <xref target="RFC3986" x:fmt="," x:sec="3.5"/>&gt;
846  <x:ref>absolute-path</x:ref> = 1*( "/" segment )
847  <x:ref>partial-URI</x:ref>   = relative-part [ "?" query ]
850   Each protocol element in HTTP that allows a URI reference will indicate
851   in its ABNF production whether the element allows any form of reference
852   (URI-reference), only a URI in absolute form (absolute-URI), only the
853   path and optional query components, or some combination of the above.
854   Unless otherwise indicated, URI references are parsed
855   relative to the effective request URI
856   (<xref target="effective.request.uri"/>).
859<section title="http URI scheme" anchor="http.uri">
860  <x:anchor-alias value="http-URI"/>
861  <iref item="http URI scheme" primary="true"/>
862  <iref item="URI scheme" subitem="http" primary="true"/>
864   The "http" URI scheme is hereby defined for the purpose of minting
865   identifiers according to their association with the hierarchical
866   namespace governed by a potential HTTP origin server listening for
867   TCP (<xref target="RFC0793"/>) connections on a given port.
869<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="http-URI"><!--terminal production--></iref>
870  <x:ref>http-URI</x:ref> = "http:" "//" <x:ref>authority</x:ref> <x:ref>path-abempty</x:ref> [ "?" <x:ref>query</x:ref> ]
871             [ "#" <x:ref>fragment</x:ref> ]
874   The origin server for an "http" URI is identified by the
875   <x:ref>authority</x:ref> component, which includes a host identifier
876   and optional TCP port (<xref target="RFC3986" x:fmt="," x:sec="3.2.2"/>).
877   The hierarchical path component and optional query component serve as an
878   identifier for a potential target resource within that origin server's name
879   space. The optional fragment component allows for indirect identification
880   of a secondary resource, independent of the URI scheme, as defined in
881   <xref target="RFC3986" x:fmt="of" x:sec="3.5"/>.
884   A sender &MUST-NOT; generate an "http" URI with an empty host identifier.
885   A recipient that processes such a URI reference &MUST; reject it as invalid.
888   If the host identifier is provided as an IP address, the origin server is
889   the listener (if any) on the indicated TCP port at that IP address.
890   If host is a registered name, the registered name is an indirect identifier
891   for use with a name resolution service, such as DNS, to find an address for
892   that origin server.
893   If the port subcomponent is empty or not given, TCP port 80 (the
894   reserved port for WWW services) is the default.
897   Note that the presence of a URI with a given authority component does not
898   imply that there is always an HTTP server listening for connections on
899   that host and port. Anyone can mint a URI. What the authority component
900   determines is who has the right to respond authoritatively to requests that
901   target the identified resource. The delegated nature of registered names
902   and IP addresses creates a federated namespace, based on control over the
903   indicated host and port, whether or not an HTTP server is present.
906   When an "http" URI is used within a context that calls for access to the
907   indicated resource, a client &MAY; attempt access by resolving
908   the host to an IP address, establishing a TCP connection to that address
909   on the indicated port, and sending an HTTP request message
910   (<xref target="http.message"/>) containing the URI's identifying data
911   (<xref target="message.routing"/>) to the server.
912   If the server responds to that request with a non-interim HTTP response
913   message, as described in &status-codes;, then that response
914   is considered an authoritative answer to the client's request.
917   Although HTTP is independent of the transport protocol, the "http"
918   scheme is specific to TCP-based services because the name delegation
919   process depends on TCP for establishing authority.
920   An HTTP service based on some other underlying connection protocol
921   would presumably be identified using a different URI scheme, just as
922   the "https" scheme (below) is used for resources that require an
923   end-to-end secured connection. Other protocols might also be used to
924   provide access to "http" identified resources &mdash; it is only the
925   authoritative interface that is specific to TCP.
928   The URI generic syntax for authority also includes a deprecated
929   userinfo subcomponent (<xref target="RFC3986" x:fmt="," x:sec="3.2.1"/>)
930   for including user authentication information in the URI.  Some
931   implementations make use of the userinfo component for internal
932   configuration of authentication information, such as within command
933   invocation options, configuration files, or bookmark lists, even
934   though such usage might expose a user identifier or password.
935   A sender &MUST-NOT; generate the userinfo subcomponent (and its "@"
936   delimiter) when an "http" URI reference is generated within a message as a
937   request target or header field value.
938   Before making use of an "http" URI reference received from an untrusted
939   source, a recipient &SHOULD; parse for userinfo and treat its presence as
940   an error; it is likely being used to obscure the authority for the sake of
941   phishing attacks.
945<section title="https URI scheme" anchor="https.uri">
946   <x:anchor-alias value="https-URI"/>
947   <iref item="https URI scheme"/>
948   <iref item="URI scheme" subitem="https"/>
950   The "https" URI scheme is hereby defined for the purpose of minting
951   identifiers according to their association with the hierarchical
952   namespace governed by a potential HTTP origin server listening to a
953   given TCP port for TLS-secured connections (<xref target="RFC5246"/>).
956   All of the requirements listed above for the "http" scheme are also
957   requirements for the "https" scheme, except that TCP port 443 is the
958   default if the port subcomponent is empty or not given,
959   and the user agent &MUST; ensure that its connection to the origin
960   server is secured through the use of strong encryption, end-to-end,
961   prior to sending the first HTTP request.
963<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="https-URI"><!--terminal production--></iref>
964  <x:ref>https-URI</x:ref> = "https:" "//" <x:ref>authority</x:ref> <x:ref>path-abempty</x:ref> [ "?" <x:ref>query</x:ref> ]
965              [ "#" <x:ref>fragment</x:ref> ]
968   Note that the "https" URI scheme depends on both TLS and TCP for
969   establishing authority.
970   Resources made available via the "https" scheme have no shared
971   identity with the "http" scheme even if their resource identifiers
972   indicate the same authority (the same host listening to the same
973   TCP port).  They are distinct name spaces and are considered to be
974   distinct origin servers.  However, an extension to HTTP that is
975   defined to apply to entire host domains, such as the Cookie protocol
976   <xref target="RFC6265"/>, can allow information
977   set by one service to impact communication with other services
978   within a matching group of host domains.
981   The process for authoritative access to an "https" identified
982   resource is defined in <xref target="RFC2818"/>.
986<section title="http and https URI Normalization and Comparison" anchor="uri.comparison">
988   Since the "http" and "https" schemes conform to the URI generic syntax,
989   such URIs are normalized and compared according to the algorithm defined
990   in <xref target="RFC3986" x:fmt="of" x:sec="6"/>, using the defaults
991   described above for each scheme.
994   If the port is equal to the default port for a scheme, the normal form is
995   to omit the port subcomponent. When not being used in absolute form as the
996   request target of an OPTIONS request, an empty path component is equivalent
997   to an absolute path of "/", so the normal form is to provide a path of "/"
998   instead. The scheme and host are case-insensitive and normally provided in
999   lowercase; all other components are compared in a case-sensitive manner.
1000   Characters other than those in the "reserved" set are equivalent to their
1001   percent-encoded octets: the normal form is to not encode them
1002   (see Sections <xref target="RFC3986" x:fmt="number" x:sec="2.1"/> and
1003   <xref target="RFC3986" x:fmt="number" x:sec="2.2"/> of
1004   <xref target="RFC3986"/>).
1007   For example, the following three URIs are equivalent:
1009<figure><artwork type="example">
1018<section title="Message Format" anchor="http.message">
1019<x:anchor-alias value="generic-message"/>
1020<x:anchor-alias value="message.types"/>
1021<x:anchor-alias value="HTTP-message"/>
1022<x:anchor-alias value="start-line"/>
1023<iref item="header section"/>
1024<iref item="headers"/>
1025<iref item="header field"/>
1027   All HTTP/1.1 messages consist of a start-line followed by a sequence of
1028   octets in a format similar to the Internet Message Format
1029   <xref target="RFC5322"/>: zero or more header fields (collectively
1030   referred to as the "headers" or the "header section"), an empty line
1031   indicating the end of the header section, and an optional message body.
1033<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="HTTP-message"><!--terminal production--></iref>
1034  <x:ref>HTTP-message</x:ref>   = <x:ref>start-line</x:ref>
1035                   *( <x:ref>header-field</x:ref> <x:ref>CRLF</x:ref> )
1036                   <x:ref>CRLF</x:ref>
1037                   [ <x:ref>message-body</x:ref> ]
1040   The normal procedure for parsing an HTTP message is to read the
1041   start-line into a structure, read each header field into a hash
1042   table by field name until the empty line, and then use the parsed
1043   data to determine if a message body is expected.  If a message body
1044   has been indicated, then it is read as a stream until an amount
1045   of octets equal to the message body length is read or the connection
1046   is closed.
1049   A recipient &MUST; parse an HTTP message as a sequence of octets in an
1050   encoding that is a superset of US-ASCII <xref target="USASCII"/>.
1051   Parsing an HTTP message as a stream of Unicode characters, without regard
1052   for the specific encoding, creates security vulnerabilities due to the
1053   varying ways that string processing libraries handle invalid multibyte
1054   character sequences that contain the octet LF (%x0A).  String-based
1055   parsers can only be safely used within protocol elements after the element
1056   has been extracted from the message, such as within a header field-value
1057   after message parsing has delineated the individual fields.
1060   An HTTP message can be parsed as a stream for incremental processing or
1061   forwarding downstream.  However, recipients cannot rely on incremental
1062   delivery of partial messages, since some implementations will buffer or
1063   delay message forwarding for the sake of network efficiency, security
1064   checks, or payload transformations.
1067   A sender &MUST-NOT; send whitespace between the start-line and
1068   the first header field.
1069   A recipient that receives whitespace between the start-line and
1070   the first header field &MUST; either reject the message as invalid or
1071   consume each whitespace-preceded line without further processing of it
1072   (i.e., ignore the entire line, along with any subsequent lines preceded
1073   by whitespace, until a properly formed header field is received or the
1074   header section is terminated).
1077   The presence of such whitespace in a request
1078   might be an attempt to trick a server into ignoring that field or
1079   processing the line after it as a new request, either of which might
1080   result in a security vulnerability if other implementations within
1081   the request chain interpret the same message differently.
1082   Likewise, the presence of such whitespace in a response might be
1083   ignored by some clients or cause others to cease parsing.
1086<section title="Start Line" anchor="start.line">
1087  <x:anchor-alias value="Start-Line"/>
1089   An HTTP message can either be a request from client to server or a
1090   response from server to client.  Syntactically, the two types of message
1091   differ only in the start-line, which is either a request-line (for requests)
1092   or a status-line (for responses), and in the algorithm for determining
1093   the length of the message body (<xref target="message.body"/>).
1096   In theory, a client could receive requests and a server could receive
1097   responses, distinguishing them by their different start-line formats,
1098   but in practice servers are implemented to only expect a request
1099   (a response is interpreted as an unknown or invalid request method)
1100   and clients are implemented to only expect a response.
1102<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="start-line"/>
1103  <x:ref>start-line</x:ref>     = <x:ref>request-line</x:ref> / <x:ref>status-line</x:ref>
1106<section title="Request Line" anchor="request.line">
1107  <x:anchor-alias value="Request"/>
1108  <x:anchor-alias value="request-line"/>
1110   A request-line begins with a method token, followed by a single
1111   space (SP), the request-target, another single space (SP), the
1112   protocol version, and ending with CRLF.
1114<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="request-line"/>
1115  <x:ref>request-line</x:ref>   = <x:ref>method</x:ref> <x:ref>SP</x:ref> <x:ref>request-target</x:ref> <x:ref>SP</x:ref> <x:ref>HTTP-version</x:ref> <x:ref>CRLF</x:ref>
1117<iref primary="true" item="method"/>
1118<t anchor="method">
1119   The method token indicates the request method to be performed on the
1120   target resource. The request method is case-sensitive.
1122<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="method"/>
1123  <x:ref>method</x:ref>         = <x:ref>token</x:ref>
1126   The request methods defined by this specification can be found in
1127   &methods;, along with information regarding the HTTP method registry
1128   and considerations for defining new methods.
1130<iref item="request-target"/>
1132   The request-target identifies the target resource upon which to apply
1133   the request, as defined in <xref target="request-target"/>.
1136   Recipients typically parse the request-line into its component parts by
1137   splitting on whitespace (see <xref target="message.robustness"/>), since
1138   no whitespace is allowed in the three components.
1139   Unfortunately, some user agents fail to properly encode or exclude
1140   whitespace found in hypertext references, resulting in those disallowed
1141   characters being sent in a request-target.
1144   Recipients of an invalid request-line &SHOULD; respond with either a
1145   <x:ref>400 (Bad Request)</x:ref> error or a <x:ref>301 (Moved Permanently)</x:ref>
1146   redirect with the request-target properly encoded.  A recipient &SHOULD-NOT;
1147   attempt to autocorrect and then process the request without a redirect,
1148   since the invalid request-line might be deliberately crafted to bypass
1149   security filters along the request chain.
1152   HTTP does not place a pre-defined limit on the length of a request-line.
1153   A server that receives a method longer than any that it implements
1154   &SHOULD; respond with a <x:ref>501 (Not Implemented)</x:ref> status code.
1155   A server ought to be prepared to receive URIs of unbounded length, as
1156   described in <xref target="conformance"/>, and &MUST; respond with a
1157   <x:ref>414 (URI Too Long)</x:ref> status code if the received
1158   request-target is longer than the server wishes to parse (see &status-414;).
1161   Various ad-hoc limitations on request-line length are found in practice.
1162   It is &RECOMMENDED; that all HTTP senders and recipients support, at a
1163   minimum, request-line lengths of 8000 octets.
1167<section title="Status Line" anchor="status.line">
1168  <x:anchor-alias value="response"/>
1169  <x:anchor-alias value="status-line"/>
1170  <x:anchor-alias value="status-code"/>
1171  <x:anchor-alias value="reason-phrase"/>
1173   The first line of a response message is the status-line, consisting
1174   of the protocol version, a space (SP), the status code, another space,
1175   a possibly-empty textual phrase describing the status code, and
1176   ending with CRLF.
1178<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="status-line"/>
1179  <x:ref>status-line</x:ref> = <x:ref>HTTP-version</x:ref> <x:ref>SP</x:ref> <x:ref>status-code</x:ref> <x:ref>SP</x:ref> <x:ref>reason-phrase</x:ref> <x:ref>CRLF</x:ref>
1182   The status-code element is a 3-digit integer code describing the
1183   result of the server's attempt to understand and satisfy the client's
1184   corresponding request. The rest of the response message is to be
1185   interpreted in light of the semantics defined for that status code.
1186   See &status-codes; for information about the semantics of status codes,
1187   including the classes of status code (indicated by the first digit),
1188   the status codes defined by this specification, considerations for the
1189   definition of new status codes, and the IANA registry.
1191<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="status-code"/>
1192  <x:ref>status-code</x:ref>    = 3<x:ref>DIGIT</x:ref>
1195   The reason-phrase element exists for the sole purpose of providing a
1196   textual description associated with the numeric status code, mostly
1197   out of deference to earlier Internet application protocols that were more
1198   frequently used with interactive text clients. A client &SHOULD; ignore
1199   the reason-phrase content.
1201<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="reason-phrase"/>
1202  <x:ref>reason-phrase</x:ref>  = *( <x:ref>HTAB</x:ref> / <x:ref>SP</x:ref> / <x:ref>VCHAR</x:ref> / <x:ref>obs-text</x:ref> )
1207<section title="Header Fields" anchor="header.fields">
1208  <x:anchor-alias value="header-field"/>
1209  <x:anchor-alias value="field-content"/>
1210  <x:anchor-alias value="field-name"/>
1211  <x:anchor-alias value="field-value"/>
1212  <x:anchor-alias value="field-vchar"/>
1213  <x:anchor-alias value="obs-fold"/>
1215   Each header field consists of a case-insensitive field name
1216   followed by a colon (":"), optional leading whitespace, the field value,
1217   and optional trailing whitespace.
1219<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="header-field"/><iref primary="true" item="Grammar" subitem="field-name"/><iref primary="true" item="Grammar" subitem="field-value"/><iref primary="true" item="Grammar" subitem="field-vchar"/><iref primary="true" item="Grammar" subitem="field-content"/><iref primary="true" item="Grammar" subitem="obs-fold"/>
1220  <x:ref>header-field</x:ref>   = <x:ref>field-name</x:ref> ":" <x:ref>OWS</x:ref> <x:ref>field-value</x:ref> <x:ref>OWS</x:ref>
1222  <x:ref>field-name</x:ref>     = <x:ref>token</x:ref>
1223  <x:ref>field-value</x:ref>    = *( <x:ref>field-content</x:ref> / <x:ref>obs-fold</x:ref> )
1224  <x:ref>field-content</x:ref>  = <x:ref>field-vchar</x:ref> [ 1*( <x:ref>SP</x:ref> / <x:ref>HTAB</x:ref> ) <x:ref>field-vchar</x:ref> ]
1225  <x:ref>field-vchar</x:ref>    = <x:ref>VCHAR</x:ref> / <x:ref>obs-text</x:ref>
1227  <x:ref>obs-fold</x:ref>       = <x:ref>CRLF</x:ref> 1*( <x:ref>SP</x:ref> / <x:ref>HTAB</x:ref> )
1228                 ; obsolete line folding
1229                 ; see <xref target="field.parsing"/>
1232   The field-name token labels the corresponding field-value as having the
1233   semantics defined by that header field.  For example, the <x:ref>Date</x:ref>
1234   header field is defined in &header-date; as containing the origination
1235   timestamp for the message in which it appears.
1238<section title="Field Extensibility" anchor="field.extensibility">
1240   Header fields are fully extensible: there is no limit on the
1241   introduction of new field names, each presumably defining new semantics,
1242   nor on the number of header fields used in a given message.  Existing
1243   fields are defined in each part of this specification and in many other
1244   specifications outside the core standard.
1247   New header fields can be defined such that, when they are understood by a
1248   recipient, they might override or enhance the interpretation of previously
1249   defined header fields, define preconditions on request evaluation, or
1250   refine the meaning of responses.
1253   A proxy &MUST; forward unrecognized header fields unless the
1254   field-name is listed in the <x:ref>Connection</x:ref> header field
1255   (<xref target="header.connection"/>) or the proxy is specifically
1256   configured to block, or otherwise transform, such fields.
1257   Other recipients &SHOULD; ignore unrecognized header fields.
1258   These requirements allow HTTP's functionality to be enhanced without
1259   requiring prior update of deployed intermediaries.
1262   All defined header fields ought to be registered with IANA in the
1263   Message Header Field Registry, as described in &iana-header-registry;.
1267<section title="Field Order" anchor="field.order">
1269   The order in which header fields with differing field names are
1270   received is not significant. However, it is good practice to send
1271   header fields that contain control data first, such as <x:ref>Host</x:ref>
1272   on requests and <x:ref>Date</x:ref> on responses, so that implementations
1273   can decide when not to handle a message as early as possible.  A server
1274   &MUST; wait until the entire header section is received before interpreting
1275   a request message, since later header fields might include conditionals,
1276   authentication credentials, or deliberately misleading duplicate
1277   header fields that would impact request processing.
1280   A sender &MUST-NOT; generate multiple header fields with the same field
1281   name in a message unless either the entire field value for that
1282   header field is defined as a comma-separated list [i.e., #(values)]
1283   or the header field is a well-known exception (as noted below).
1286   A recipient &MAY; combine multiple header fields with the same field name
1287   into one "field-name: field-value" pair, without changing the semantics of
1288   the message, by appending each subsequent field value to the combined
1289   field value in order, separated by a comma. The order in which
1290   header fields with the same field name are received is therefore
1291   significant to the interpretation of the combined field value;
1292   a proxy &MUST-NOT; change the order of these field values when
1293   forwarding a message.
1296  <t>
1297   &Note; In practice, the "Set-Cookie" header field (<xref target="RFC6265"/>)
1298   often appears multiple times in a response message and does not use the
1299   list syntax, violating the above requirements on multiple header fields
1300   with the same name. Since it cannot be combined into a single field-value,
1301   recipients ought to handle "Set-Cookie" as a special case while processing
1302   header fields. (See Appendix A.2.3 of <xref target="Kri2001"/> for details.)
1303  </t>
1307<section title="Whitespace" anchor="whitespace">
1308<t anchor="rule.LWS">
1309   This specification uses three rules to denote the use of linear
1310   whitespace: OWS (optional whitespace), RWS (required whitespace), and
1311   BWS ("bad" whitespace).
1313<t anchor="rule.OWS">
1314   The OWS rule is used where zero or more linear whitespace octets might
1315   appear. For protocol elements where optional whitespace is preferred to
1316   improve readability, a sender &SHOULD; generate the optional whitespace
1317   as a single SP; otherwise, a sender &SHOULD-NOT; generate optional
1318   whitespace except as needed to white-out invalid or unwanted protocol
1319   elements during in-place message filtering.
1321<t anchor="rule.RWS">
1322   The RWS rule is used when at least one linear whitespace octet is required
1323   to separate field tokens. A sender &SHOULD; generate RWS as a single SP.
1325<t anchor="rule.BWS">
1326   The BWS rule is used where the grammar allows optional whitespace only for
1327   historical reasons. A sender &MUST-NOT; generate BWS in messages.
1328   A recipient &MUST; parse for such bad whitespace and remove it before
1329   interpreting the protocol element.
1331<t anchor="rule.whitespace">
1332  <x:anchor-alias value="BWS"/>
1333  <x:anchor-alias value="OWS"/>
1334  <x:anchor-alias value="RWS"/>
1336<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="OWS"/><iref primary="true" item="Grammar" subitem="RWS"/><iref primary="true" item="Grammar" subitem="BWS"/>
1337  <x:ref>OWS</x:ref>            = *( <x:ref>SP</x:ref> / <x:ref>HTAB</x:ref> )
1338                 ; optional whitespace
1339  <x:ref>RWS</x:ref>            = 1*( <x:ref>SP</x:ref> / <x:ref>HTAB</x:ref> )
1340                 ; required whitespace
1341  <x:ref>BWS</x:ref>            = <x:ref>OWS</x:ref>
1342                 ; "bad" whitespace
1346<section title="Field Parsing" anchor="field.parsing">
1348   Messages are parsed using a generic algorithm, independent of the
1349   individual header field names. The contents within a given field value are
1350   not parsed until a later stage of message interpretation (usually after the
1351   message's entire header section has been processed).
1352   Consequently, this specification does not use ABNF rules to define each
1353   "Field-Name: Field Value" pair, as was done in previous editions.
1354   Instead, this specification uses ABNF rules which are named according to
1355   each registered field name, wherein the rule defines the valid grammar for
1356   that field's corresponding field values (i.e., after the field-value
1357   has been extracted from the header section by a generic field parser).
1360   No whitespace is allowed between the header field-name and colon.
1361   In the past, differences in the handling of such whitespace have led to
1362   security vulnerabilities in request routing and response handling.
1363   A server &MUST; reject any received request message that contains
1364   whitespace between a header field-name and colon with a response code of
1365   <x:ref>400 (Bad Request)</x:ref>. A proxy &MUST; remove any such whitespace
1366   from a response message before forwarding the message downstream.
1369   A field value might be preceded and/or followed by optional whitespace
1370   (OWS); a single SP preceding the field-value is preferred for consistent
1371   readability by humans.
1372   The field value does not include any leading or trailing white space: OWS
1373   occurring before the first non-whitespace octet of the field value or after
1374   the last non-whitespace octet of the field value ought to be excluded by
1375   parsers when extracting the field value from a header field.
1378   Historically, HTTP header field values could be extended over multiple
1379   lines by preceding each extra line with at least one space or horizontal
1380   tab (obs-fold). This specification deprecates such line folding except
1381   within the message/http media type
1382   (<xref target=""/>).
1383   A sender &MUST-NOT; generate a message that includes line folding
1384   (i.e., that has any field-value that contains a match to the
1385   <x:ref>obs-fold</x:ref> rule) unless the message is intended for packaging
1386   within the message/http media type.
1389   A server that receives an <x:ref>obs-fold</x:ref> in a request message that
1390   is not within a message/http container &MUST; either reject the message by
1391   sending a <x:ref>400 (Bad Request)</x:ref>, preferably with a
1392   representation explaining that obsolete line folding is unacceptable, or
1393   replace each received <x:ref>obs-fold</x:ref> with one or more
1394   <x:ref>SP</x:ref> octets prior to interpreting the field value or
1395   forwarding the message downstream.
1398   A proxy or gateway that receives an <x:ref>obs-fold</x:ref> in a response
1399   message that is not within a message/http container &MUST; either discard
1400   the message and replace it with a <x:ref>502 (Bad Gateway)</x:ref>
1401   response, preferably with a representation explaining that unacceptable
1402   line folding was received, or replace each received <x:ref>obs-fold</x:ref>
1403   with one or more <x:ref>SP</x:ref> octets prior to interpreting the field
1404   value or forwarding the message downstream.
1407   A user agent that receives an <x:ref>obs-fold</x:ref> in a response message
1408   that is not within a message/http container &MUST; replace each received
1409   <x:ref>obs-fold</x:ref> with one or more <x:ref>SP</x:ref> octets prior to
1410   interpreting the field value.
1413   Historically, HTTP has allowed field content with text in the ISO-8859-1
1414   <xref target="ISO-8859-1"/> charset, supporting other charsets only
1415   through use of <xref target="RFC2047"/> encoding.
1416   In practice, most HTTP header field values use only a subset of the
1417   US-ASCII charset <xref target="USASCII"/>. Newly defined
1418   header fields &SHOULD; limit their field values to US-ASCII octets.
1419   A recipient &SHOULD; treat other octets in field content (obs-text) as
1420   opaque data.
1424<section title="Field Limits" anchor="field.limits">
1426   HTTP does not place a pre-defined limit on the length of each header field
1427   or on the length of the header section as a whole, as described in
1428   <xref target="conformance"/>. Various ad-hoc limitations on individual
1429   header field length are found in practice, often depending on the specific
1430   field semantics.
1433   A server ought to be prepared to receive request header fields of unbounded
1434   length and &MUST; respond with an appropriate
1435   <x:ref>4xx (Client Error)</x:ref> status code if the received header
1436   field(s) are larger than the server wishes to process.
1439   A client ought to be prepared to receive response header fields of
1440   unbounded length.
1441   A client &MAY; discard or truncate received header fields that are larger
1442   than the client wishes to process if the field semantics are such that the
1443   dropped value(s) can be safely ignored without changing the
1444   message framing or response semantics.
1448<section title="Field value components" anchor="field.components">
1449<t anchor="rule.token.separators">
1450  <x:anchor-alias value="tchar"/>
1451  <x:anchor-alias value="token"/>
1452  <iref item="Delimiters"/>
1453   Most HTTP header field values are defined using common syntax components
1454   (token, quoted-string, and comment) separated by whitespace or specific
1455   delimiting characters. Delimiters are chosen from the set of US-ASCII
1456   visual characters not allowed in a <x:ref>token</x:ref>
1457   (DQUOTE and "(),/:;&lt;=>?@[\]{}").
1459<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="token"/><iref primary="true" item="Grammar" subitem="tchar"/>
1460  <x:ref>token</x:ref>          = 1*<x:ref>tchar</x:ref>
1462  NOTE: the definition of tchar and the prose above about special characters need to match!
1463 -->
1464  <x:ref>tchar</x:ref>          = "!" / "#" / "$" / "%" / "&amp;" / "'" / "*"
1465                 / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
1466                 / <x:ref>DIGIT</x:ref> / <x:ref>ALPHA</x:ref>
1467                 ; any <x:ref>VCHAR</x:ref>, except delimiters
1469<t anchor="rule.quoted-string">
1470  <x:anchor-alias value="quoted-string"/>
1471  <x:anchor-alias value="qdtext"/>
1472  <x:anchor-alias value="obs-text"/>
1473   A string of text is parsed as a single value if it is quoted using
1474   double-quote marks.
1476<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="quoted-string"/><iref primary="true" item="Grammar" subitem="qdtext"/><iref primary="true" item="Grammar" subitem="obs-text"/>
1477  <x:ref>quoted-string</x:ref>  = <x:ref>DQUOTE</x:ref> *( <x:ref>qdtext</x:ref> / <x:ref>quoted-pair</x:ref> ) <x:ref>DQUOTE</x:ref>
1478  <x:ref>qdtext</x:ref>         = <x:ref>HTAB</x:ref> / <x:ref>SP</x:ref> /%x21 / %x23-5B / %x5D-7E / <x:ref>obs-text</x:ref>
1479  <x:ref>obs-text</x:ref>       = %x80-FF
1481<t anchor="rule.comment">
1482  <x:anchor-alias value="comment"/>
1483  <x:anchor-alias value="ctext"/>
1484   Comments can be included in some HTTP header fields by surrounding
1485   the comment text with parentheses. Comments are only allowed in
1486   fields containing "comment" as part of their field value definition.
1488<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="comment"/><iref primary="true" item="Grammar" subitem="ctext"/>
1489  <x:ref>comment</x:ref>        = "(" *( <x:ref>ctext</x:ref> / <x:ref>quoted-pair</x:ref> / <x:ref>comment</x:ref> ) ")"
1490  <x:ref>ctext</x:ref>          = <x:ref>HTAB</x:ref> / <x:ref>SP</x:ref> / %x21-27 / %x2A-5B / %x5D-7E / <x:ref>obs-text</x:ref>
1492<t anchor="rule.quoted-pair">
1493  <x:anchor-alias value="quoted-pair"/>
1494   The backslash octet ("\") can be used as a single-octet
1495   quoting mechanism within quoted-string and comment constructs.
1496   Recipients that process the value of a quoted-string &MUST; handle a
1497   quoted-pair as if it were replaced by the octet following the backslash.
1499<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="quoted-pair"/>
1500  <x:ref>quoted-pair</x:ref>    = "\" ( <x:ref>HTAB</x:ref> / <x:ref>SP</x:ref> / <x:ref>VCHAR</x:ref> / <x:ref>obs-text</x:ref> )
1503   A sender &SHOULD-NOT; generate a quoted-pair in a quoted-string except
1504   where necessary to quote DQUOTE and backslash octets occurring within that
1505   string.
1506   A sender &SHOULD-NOT; generate a quoted-pair in a comment except
1507   where necessary to quote parentheses ["(" and ")"] and backslash octets
1508   occurring within that comment.
1514<section title="Message Body" anchor="message.body">
1515  <x:anchor-alias value="message-body"/>
1517   The message body (if any) of an HTTP message is used to carry the
1518   payload body of that request or response.  The message body is
1519   identical to the payload body unless a transfer coding has been
1520   applied, as described in <xref target="header.transfer-encoding"/>.
1522<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="message-body"/>
1523  <x:ref>message-body</x:ref> = *OCTET
1526   The rules for when a message body is allowed in a message differ for
1527   requests and responses.
1530   The presence of a message body in a request is signaled by a
1531   <x:ref>Content-Length</x:ref> or <x:ref>Transfer-Encoding</x:ref> header
1532   field. Request message framing is independent of method semantics,
1533   even if the method does not define any use for a message body.
1536   The presence of a message body in a response depends on both
1537   the request method to which it is responding and the response
1538   status code (<xref target="status.line"/>).
1539   Responses to the HEAD request method (&HEAD;) never include a message body
1540   because the associated response header fields (e.g.,
1541   <x:ref>Transfer-Encoding</x:ref>, <x:ref>Content-Length</x:ref>, etc.),
1542   if present, indicate only what their values would have been if the request
1543   method had been GET (&GET;).
1544   <x:ref>2xx (Successful)</x:ref> responses to a CONNECT request method
1545   (&CONNECT;) switch to tunnel mode instead of having a message body.
1546   All <x:ref>1xx (Informational)</x:ref>, <x:ref>204 (No Content)</x:ref>, and
1547   <x:ref>304 (Not Modified)</x:ref> responses do not include a message body.
1548   All other responses do include a message body, although the body
1549   might be of zero length.
1552<section title="Transfer-Encoding" anchor="header.transfer-encoding">
1553  <iref primary="true" item="Transfer-Encoding header field" x:for-anchor=""/>
1554  <iref item="chunked (Coding Format)"/>
1555  <x:anchor-alias value="Transfer-Encoding"/>
1557   The Transfer-Encoding header field lists the transfer coding names
1558   corresponding to the sequence of transfer codings that have been
1559   (or will be) applied to the payload body in order to form the message body.
1560   Transfer codings are defined in <xref target="transfer.codings"/>.
1562<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Transfer-Encoding"/>
1563  <x:ref>Transfer-Encoding</x:ref> = 1#<x:ref>transfer-coding</x:ref>
1566   Transfer-Encoding is analogous to the Content-Transfer-Encoding field of
1567   MIME, which was designed to enable safe transport of binary data over a
1568   7-bit transport service (<xref target="RFC2045" x:fmt="," x:sec="6"/>).
1569   However, safe transport has a different focus for an 8bit-clean transfer
1570   protocol. In HTTP's case, Transfer-Encoding is primarily intended to
1571   accurately delimit a dynamically generated payload and to distinguish
1572   payload encodings that are only applied for transport efficiency or
1573   security from those that are characteristics of the selected resource.
1576   A recipient &MUST; be able to parse the chunked transfer coding
1577   (<xref target="chunked.encoding"/>) because it plays a crucial role in
1578   framing messages when the payload body size is not known in advance.
1579   A sender &MUST-NOT; apply chunked more than once to a message body
1580   (i.e., chunking an already chunked message is not allowed).
1581   If any transfer coding other than chunked is applied to a request payload
1582   body, the sender &MUST; apply chunked as the final transfer coding to
1583   ensure that the message is properly framed.
1584   If any transfer coding other than chunked is applied to a response payload
1585   body, the sender &MUST; either apply chunked as the final transfer coding
1586   or terminate the message by closing the connection.
1589   For example,
1590</preamble><artwork type="example">
1591  Transfer-Encoding: gzip, chunked
1593   indicates that the payload body has been compressed using the gzip
1594   coding and then chunked using the chunked coding while forming the
1595   message body.
1598   Unlike <x:ref>Content-Encoding</x:ref> (&content-codings;),
1599   Transfer-Encoding is a property of the message, not of the representation, and
1600   any recipient along the request/response chain &MAY; decode the received
1601   transfer coding(s) or apply additional transfer coding(s) to the message
1602   body, assuming that corresponding changes are made to the Transfer-Encoding
1603   field-value. Additional information about the encoding parameters can be
1604   provided by other header fields not defined by this specification.
1607   Transfer-Encoding &MAY; be sent in a response to a HEAD request or in a
1608   <x:ref>304 (Not Modified)</x:ref> response (&status-304;) to a GET request,
1609   neither of which includes a message body,
1610   to indicate that the origin server would have applied a transfer coding
1611   to the message body if the request had been an unconditional GET.
1612   This indication is not required, however, because any recipient on
1613   the response chain (including the origin server) can remove transfer
1614   codings when they are not needed.
1617   A server &MUST-NOT; send a Transfer-Encoding header field in any response
1618   with a status code of
1619   <x:ref>1xx (Informational)</x:ref> or <x:ref>204 (No Content)</x:ref>.
1620   A server &MUST-NOT; send a Transfer-Encoding header field in any
1621   <x:ref>2xx (Successful)</x:ref> response to a CONNECT request (&CONNECT;).
1624   Transfer-Encoding was added in HTTP/1.1.  It is generally assumed that
1625   implementations advertising only HTTP/1.0 support will not understand
1626   how to process a transfer-encoded payload.
1627   A client &MUST-NOT; send a request containing Transfer-Encoding unless it
1628   knows the server will handle HTTP/1.1 (or later) requests; such knowledge
1629   might be in the form of specific user configuration or by remembering the
1630   version of a prior received response.
1631   A server &MUST-NOT; send a response containing Transfer-Encoding unless
1632   the corresponding request indicates HTTP/1.1 (or later).
1635   A server that receives a request message with a transfer coding it does
1636   not understand &SHOULD; respond with <x:ref>501 (Not Implemented)</x:ref>.
1640<section title="Content-Length" anchor="header.content-length">
1641  <iref primary="true" item="Content-Length header field" x:for-anchor=""/>
1642  <x:anchor-alias value="Content-Length"/>
1644   When a message does not have a <x:ref>Transfer-Encoding</x:ref> header
1645   field, a Content-Length header field can provide the anticipated size,
1646   as a decimal number of octets, for a potential payload body.
1647   For messages that do include a payload body, the Content-Length field-value
1648   provides the framing information necessary for determining where the body
1649   (and message) ends.  For messages that do not include a payload body, the
1650   Content-Length indicates the size of the selected representation
1651   (&representation;).
1653<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Length"/>
1654  <x:ref>Content-Length</x:ref> = 1*<x:ref>DIGIT</x:ref>
1657   An example is
1659<figure><artwork type="example">
1660  Content-Length: 3495
1663   A sender &MUST-NOT; send a Content-Length header field in any message that
1664   contains a <x:ref>Transfer-Encoding</x:ref> header field.
1667   A user agent &SHOULD; send a Content-Length in a request message when no
1668   <x:ref>Transfer-Encoding</x:ref> is sent and the request method defines
1669   a meaning for an enclosed payload body. For example, a Content-Length
1670   header field is normally sent in a POST request even when the value is
1671   0 (indicating an empty payload body).  A user agent &SHOULD-NOT; send a
1672   Content-Length header field when the request message does not contain a
1673   payload body and the method semantics do not anticipate such a body.
1676   A server &MAY; send a Content-Length header field in a response to a HEAD
1677   request (&HEAD;); a server &MUST-NOT; send Content-Length in such a
1678   response unless its field-value equals the decimal number of octets that
1679   would have been sent in the payload body of a response if the same
1680   request had used the GET method.
1683   A server &MAY; send a Content-Length header field in a
1684   <x:ref>304 (Not Modified)</x:ref> response to a conditional GET request
1685   (&status-304;); a server &MUST-NOT; send Content-Length in such a
1686   response unless its field-value equals the decimal number of octets that
1687   would have been sent in the payload body of a <x:ref>200 (OK)</x:ref>
1688   response to the same request.
1691   A server &MUST-NOT; send a Content-Length header field in any response
1692   with a status code of
1693   <x:ref>1xx (Informational)</x:ref> or <x:ref>204 (No Content)</x:ref>.
1694   A server &MUST-NOT; send a Content-Length header field in any
1695   <x:ref>2xx (Successful)</x:ref> response to a CONNECT request (&CONNECT;).
1698   Aside from the cases defined above, in the absence of Transfer-Encoding,
1699   an origin server &SHOULD; send a Content-Length header field when the
1700   payload body size is known prior to sending the complete header section.
1701   This will allow downstream recipients to measure transfer progress,
1702   know when a received message is complete, and potentially reuse the
1703   connection for additional requests.
1706   Any Content-Length field value greater than or equal to zero is valid.
1707   Since there is no predefined limit to the length of a payload, a
1708   recipient &MUST; anticipate potentially large decimal numerals and
1709   prevent parsing errors due to integer conversion overflows
1710   (<xref target="attack.protocol.element.size.overflows"/>).
1713   If a message is received that has multiple Content-Length header fields
1714   with field-values consisting of the same decimal value, or a single
1715   Content-Length header field with a field value containing a list of
1716   identical decimal values (e.g., "Content-Length: 42, 42"), indicating that
1717   duplicate Content-Length header fields have been generated or combined by an
1718   upstream message processor, then the recipient &MUST; either reject the
1719   message as invalid or replace the duplicated field-values with a single
1720   valid Content-Length field containing that decimal value prior to
1721   determining the message body length or forwarding the message.
1724  <t>
1725   &Note; HTTP's use of Content-Length for message framing differs
1726   significantly from the same field's use in MIME, where it is an optional
1727   field used only within the "message/external-body" media-type.
1728  </t>
1732<section title="Message Body Length" anchor="message.body.length">
1733  <iref item="chunked (Coding Format)"/>
1735   The length of a message body is determined by one of the following
1736   (in order of precedence):
1739  <list style="numbers">
1740    <x:lt><t>
1741     Any response to a HEAD request and any response with a
1742     <x:ref>1xx (Informational)</x:ref>, <x:ref>204 (No Content)</x:ref>, or
1743     <x:ref>304 (Not Modified)</x:ref> status code is always
1744     terminated by the first empty line after the header fields, regardless of
1745     the header fields present in the message, and thus cannot contain a
1746     message body.
1747    </t></x:lt>
1748    <x:lt><t>
1749     Any <x:ref>2xx (Successful)</x:ref> response to a CONNECT request implies that the
1750     connection will become a tunnel immediately after the empty line that
1751     concludes the header fields.  A client &MUST; ignore any
1752     <x:ref>Content-Length</x:ref> or <x:ref>Transfer-Encoding</x:ref> header
1753     fields received in such a message.
1754    </t></x:lt>
1755    <x:lt><t>
1756     If a <x:ref>Transfer-Encoding</x:ref> header field is present
1757     and the chunked transfer coding (<xref target="chunked.encoding"/>)
1758     is the final encoding, the message body length is determined by reading
1759     and decoding the chunked data until the transfer coding indicates the
1760     data is complete.
1761    </t>
1762    <t>
1763     If a <x:ref>Transfer-Encoding</x:ref> header field is present in a
1764     response and the chunked transfer coding is not the final encoding, the
1765     message body length is determined by reading the connection until it is
1766     closed by the server.
1767     If a <x:ref>Transfer-Encoding</x:ref> header field is present in a request and the
1768     chunked transfer coding is not the final encoding, the message body
1769     length cannot be determined reliably; the server &MUST; respond with
1770     the <x:ref>400 (Bad Request)</x:ref> status code and then close the connection.
1771    </t>
1772    <t>
1773     If a message is received with both a <x:ref>Transfer-Encoding</x:ref>
1774     and a <x:ref>Content-Length</x:ref> header field, the Transfer-Encoding
1775     overrides the Content-Length. Such a message might indicate an attempt
1776     to perform request or response smuggling (bypass of security-related
1777     checks on message routing or content) and thus ought to be handled as
1778     an error.  A sender &MUST; remove the received Content-Length field
1779     prior to forwarding such a message downstream.
1780    </t></x:lt>
1781    <x:lt><t>
1782     If a message is received without <x:ref>Transfer-Encoding</x:ref> and with
1783     either multiple <x:ref>Content-Length</x:ref> header fields having
1784     differing field-values or a single Content-Length header field having an
1785     invalid value, then the message framing is invalid and
1786     the recipient &MUST; treat it as an unrecoverable error to prevent
1787     request or response smuggling.
1788     If this is a request message, the server &MUST; respond with
1789     a <x:ref>400 (Bad Request)</x:ref> status code and then close the connection.
1790     If this is a response message received by a proxy,
1791     the proxy &MUST; close the connection to the server, discard the received
1792     response, and send a <x:ref>502 (Bad Gateway)</x:ref> response to the
1793     client.
1794     If this is a response message received by a user agent,
1795     the user agent &MUST; close the connection to the server and discard the
1796     received response.
1797    </t></x:lt>
1798    <x:lt><t>
1799     If a valid <x:ref>Content-Length</x:ref> header field is present without
1800     <x:ref>Transfer-Encoding</x:ref>, its decimal value defines the
1801     expected message body length in octets.
1802     If the sender closes the connection or the recipient times out before the
1803     indicated number of octets are received, the recipient &MUST; consider
1804     the message to be incomplete and close the connection.
1805    </t></x:lt>
1806    <x:lt><t>
1807     If this is a request message and none of the above are true, then the
1808     message body length is zero (no message body is present).
1809    </t></x:lt>
1810    <x:lt><t>
1811     Otherwise, this is a response message without a declared message body
1812     length, so the message body length is determined by the number of octets
1813     received prior to the server closing the connection.
1814    </t></x:lt>
1815  </list>
1818   Since there is no way to distinguish a successfully completed,
1819   close-delimited message from a partially-received message interrupted
1820   by network failure, a server &SHOULD; generate encoding or
1821   length-delimited messages whenever possible.  The close-delimiting
1822   feature exists primarily for backwards compatibility with HTTP/1.0.
1825   A server &MAY; reject a request that contains a message body but
1826   not a <x:ref>Content-Length</x:ref> by responding with
1827   <x:ref>411 (Length Required)</x:ref>.
1830   Unless a transfer coding other than chunked has been applied,
1831   a client that sends a request containing a message body &SHOULD;
1832   use a valid <x:ref>Content-Length</x:ref> header field if the message body
1833   length is known in advance, rather than the chunked transfer coding, since some
1834   existing services respond to chunked with a <x:ref>411 (Length Required)</x:ref>
1835   status code even though they understand the chunked transfer coding.  This
1836   is typically because such services are implemented via a gateway that
1837   requires a content-length in advance of being called and the server
1838   is unable or unwilling to buffer the entire request before processing.
1841   A user agent that sends a request containing a message body &MUST; send a
1842   valid <x:ref>Content-Length</x:ref> header field if it does not know the
1843   server will handle HTTP/1.1 (or later) requests; such knowledge can be in
1844   the form of specific user configuration or by remembering the version of a
1845   prior received response.
1848   If the final response to the last request on a connection has been
1849   completely received and there remains additional data to read, a user agent
1850   &MAY; discard the remaining data or attempt to determine if that data
1851   belongs as part of the prior response body, which might be the case if the
1852   prior message's Content-Length value is incorrect. A client &MUST-NOT;
1853   process, cache, or forward such extra data as a separate response, since
1854   such behavior would be vulnerable to cache poisoning.
1859<section anchor="incomplete.messages" title="Handling Incomplete Messages">
1861   A server that receives an incomplete request message, usually due to a
1862   canceled request or a triggered time-out exception, &MAY; send an error
1863   response prior to closing the connection.
1866   A client that receives an incomplete response message, which can occur
1867   when a connection is closed prematurely or when decoding a supposedly
1868   chunked transfer coding fails, &MUST; record the message as incomplete.
1869   Cache requirements for incomplete responses are defined in
1870   &cache-incomplete;.
1873   If a response terminates in the middle of the header section (before the
1874   empty line is received) and the status code might rely on header fields to
1875   convey the full meaning of the response, then the client cannot assume
1876   that meaning has been conveyed; the client might need to repeat the
1877   request in order to determine what action to take next.
1880   A message body that uses the chunked transfer coding is
1881   incomplete if the zero-sized chunk that terminates the encoding has not
1882   been received.  A message that uses a valid <x:ref>Content-Length</x:ref> is
1883   incomplete if the size of the message body received (in octets) is less than
1884   the value given by Content-Length.  A response that has neither chunked
1885   transfer coding nor Content-Length is terminated by closure of the
1886   connection, and thus is considered complete regardless of the number of
1887   message body octets received, provided that the header section was received
1888   intact.
1892<section title="Message Parsing Robustness" anchor="message.robustness">
1894   Older HTTP/1.0 user agent implementations might send an extra CRLF
1895   after a POST request as a workaround for some early server
1896   applications that failed to read message body content that was
1897   not terminated by a line-ending. An HTTP/1.1 user agent &MUST-NOT;
1898   preface or follow a request with an extra CRLF.  If terminating
1899   the request message body with a line-ending is desired, then the
1900   user agent &MUST; count the terminating CRLF octets as part of the
1901   message body length.
1904   In the interest of robustness, a server that is expecting to receive and
1905   parse a request-line &SHOULD; ignore at least one empty line (CRLF)
1906   received prior to the request-line.
1909   Although the line terminator for the start-line and header
1910   fields is the sequence CRLF, a recipient &MAY; recognize a
1911   single LF as a line terminator and ignore any preceding CR.
1914   Although the request-line and status-line grammar rules require that each
1915   of the component elements be separated by a single SP octet, recipients
1916   &MAY; instead parse on whitespace-delimited word boundaries and, aside
1917   from the CRLF terminator, treat any form of whitespace as the SP separator
1918   while ignoring preceding or trailing whitespace;
1919   such whitespace includes one or more of the following octets:
1920   SP, HTAB, VT (%x0B), FF (%x0C), or bare CR.
1923   When a server listening only for HTTP request messages, or processing
1924   what appears from the start-line to be an HTTP request message,
1925   receives a sequence of octets that does not match the HTTP-message
1926   grammar aside from the robustness exceptions listed above, the
1927   server &SHOULD; respond with a <x:ref>400 (Bad Request)</x:ref> response. 
1932<section title="Transfer Codings" anchor="transfer.codings">
1933  <x:anchor-alias value="transfer-coding"/>
1934  <x:anchor-alias value="transfer-extension"/>
1936   Transfer coding names are used to indicate an encoding
1937   transformation that has been, can be, or might need to be applied to a
1938   payload body in order to ensure "safe transport" through the network.
1939   This differs from a content coding in that the transfer coding is a
1940   property of the message rather than a property of the representation
1941   that is being transferred.
1943<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="transfer-coding"/><iref primary="true" item="Grammar" subitem="transfer-extension"/>
1944  <x:ref>transfer-coding</x:ref>    = "chunked" ; <xref target="chunked.encoding"/>
1945                     / "compress" ; <xref target="compress.coding"/>
1946                     / "deflate" ; <xref target="deflate.coding"/>
1947                     / "gzip" ; <xref target="gzip.coding"/>
1948                     / <x:ref>transfer-extension</x:ref>
1949  <x:ref>transfer-extension</x:ref> = <x:ref>token</x:ref> *( <x:ref>OWS</x:ref> ";" <x:ref>OWS</x:ref> <x:ref>transfer-parameter</x:ref> )
1951<t anchor="rule.parameter">
1952  <x:anchor-alias value="transfer-parameter"/>
1953   Parameters are in the form of a name or name=value pair.
1955<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="transfer-parameter"/>
1956  <x:ref>transfer-parameter</x:ref> = <x:ref>token</x:ref> <x:ref>BWS</x:ref> "=" <x:ref>BWS</x:ref> ( <x:ref>token</x:ref> / <x:ref>quoted-string</x:ref> )
1959   All transfer-coding names are case-insensitive and ought to be registered
1960   within the HTTP Transfer Coding registry, as defined in
1961   <xref target="transfer.coding.registry"/>.
1962   They are used in the <x:ref>TE</x:ref> (<xref target="header.te"/>) and
1963   <x:ref>Transfer-Encoding</x:ref> (<xref target="header.transfer-encoding"/>)
1964   header fields.
1967<section title="Chunked Transfer Coding" anchor="chunked.encoding">
1968  <iref primary="true" item="chunked (Coding Format)"/>
1969  <x:anchor-alias value="chunk"/>
1970  <x:anchor-alias value="chunked-body"/>
1971  <x:anchor-alias value="chunk-data"/>
1972  <x:anchor-alias value="chunk-size"/>
1973  <x:anchor-alias value="last-chunk"/>
1975   The chunked transfer coding wraps the payload body in order to transfer it
1976   as a series of chunks, each with its own size indicator, followed by an
1977   &OPTIONAL; trailer containing header fields. Chunked enables content
1978   streams of unknown size to be transferred as a sequence of length-delimited
1979   buffers, which enables the sender to retain connection persistence and the
1980   recipient to know when it has received the entire message.
1982<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="chunked-body"><!--terminal production--></iref><iref primary="true" item="Grammar" subitem="chunk"/><iref primary="true" item="Grammar" subitem="chunk-size"/><iref primary="true" item="Grammar" subitem="last-chunk"/><iref primary="false" item="Grammar" subitem="trailer-part"/><iref primary="false" item="Grammar" subitem="chunk-ext"/><iref primary="true" item="Grammar" subitem="chunk-data"/>
1983  <x:ref>chunked-body</x:ref>   = *<x:ref>chunk</x:ref>
1984                   <x:ref>last-chunk</x:ref>
1985                   <x:ref>trailer-part</x:ref>
1986                   <x:ref>CRLF</x:ref>
1988  <x:ref>chunk</x:ref>          = <x:ref>chunk-size</x:ref> [ <x:ref>chunk-ext</x:ref> ] <x:ref>CRLF</x:ref>
1989                   <x:ref>chunk-data</x:ref> <x:ref>CRLF</x:ref>
1990  <x:ref>chunk-size</x:ref>     = 1*<x:ref>HEXDIG</x:ref>
1991  <x:ref>last-chunk</x:ref>     = 1*("0") [ <x:ref>chunk-ext</x:ref> ] <x:ref>CRLF</x:ref>
1993  <x:ref>chunk-data</x:ref>     = 1*<x:ref>OCTET</x:ref> ; a sequence of chunk-size octets
1996   The chunk-size field is a string of hex digits indicating the size of
1997   the chunk-data in octets. The chunked transfer coding is complete when a
1998   chunk with a chunk-size of zero is received, possibly followed by a
1999   trailer, and finally terminated by an empty line.
2002   A recipient &MUST; be able to parse and decode the chunked transfer coding.
2005<section title="Chunk Extensions" anchor="chunked.extension">
2006  <x:anchor-alias value="chunk-ext"/>
2007  <x:anchor-alias value="chunk-ext-name"/>
2008  <x:anchor-alias value="chunk-ext-val"/>
2010   The chunked encoding allows each chunk to include zero or more chunk
2011   extensions, immediately following the <x:ref>chunk-size</x:ref>, for the
2012   sake of supplying per-chunk metadata (such as a signature or hash),
2013   mid-message control information, or randomization of message body size.
2015<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="chunked-body"><!--terminal production--></iref><iref primary="true" item="Grammar" subitem="chunk-ext"/><iref primary="true" item="Grammar" subitem="chunk-ext-name"/><iref primary="true" item="Grammar" subitem="chunk-ext-val"/>
2016  <x:ref>chunk-ext</x:ref>      = *( ";" <x:ref>chunk-ext-name</x:ref> [ "=" <x:ref>chunk-ext-val</x:ref> ] )
2018  <x:ref>chunk-ext-name</x:ref> = <x:ref>token</x:ref>
2019  <x:ref>chunk-ext-val</x:ref>  = <x:ref>token</x:ref> / <x:ref>quoted-string</x:ref>
2022   The chunked encoding is specific to each connection and is likely to be
2023   removed or recoded by each recipient (including intermediaries) before any
2024   higher-level application would have a chance to inspect the extensions.
2025   Hence, use of chunk extensions is generally limited to specialized HTTP
2026   services such as "long polling" (where client and server can have shared
2027   expectations regarding the use of chunk extensions) or for padding within
2028   an end-to-end secured connection.
2031   A recipient &MUST; ignore unrecognized chunk extensions.
2032   A server ought to limit the total length of chunk extensions received in a
2033   request to an amount reasonable for the services provided, in the same way
2034   that it applies length limitations and timeouts for other parts of a
2035   message, and generate an appropriate <x:ref>4xx (Client Error)</x:ref>
2036   response if that amount is exceeded.
2040<section title="Chunked Trailer Part" anchor="chunked.trailer.part">
2041  <x:anchor-alias value="trailer-part"/>
2043   A trailer allows the sender to include additional fields at the end of a
2044   chunked message in order to supply metadata that might be dynamically
2045   generated while the message body is sent, such as a message integrity
2046   check, digital signature, or post-processing status. The trailer fields are
2047   identical to header fields, except they are sent in a chunked trailer
2048   instead of the message's header section.
2050<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="trailer-part"/><iref primary="false" item="Grammar" subitem="header-field"/>
2051  <x:ref>trailer-part</x:ref>   = *( <x:ref>header-field</x:ref> <x:ref>CRLF</x:ref> )
2054   A sender &MUST-NOT; generate a trailer that contains a field necessary for
2055   message framing (e.g., <x:ref>Transfer-Encoding</x:ref> and
2056   <x:ref>Content-Length</x:ref>), routing (e.g., <x:ref>Host</x:ref>),
2057   request modifiers (e.g., controls and conditionals in
2058   &request-header-fields;), authentication (e.g., see <xref target="Part7"/>
2059   and <xref target="RFC6265"/>), response control data (e.g., see
2060   &response-control-data;), or determining how to process the payload
2061   (e.g., <x:ref>Content-Encoding</x:ref>, <x:ref>Content-Type</x:ref>,
2062   <x:ref>Content-Range</x:ref>, and <x:ref>Trailer</x:ref>).
2065   When a chunked message containing a non-empty trailer is received, the
2066   recipient &MAY; process the fields (aside from those forbidden above)
2067   as if they were appended to the message's header section.
2068   A recipient &MUST; ignore (or consider as an error) any fields that are
2069   forbidden to be sent in a trailer, since processing them as if they were
2070   present in the header section might bypass external security filters.
2073   Unless the request includes a <x:ref>TE</x:ref> header field indicating
2074   "trailers" is acceptable, as described in <xref target="header.te"/>, a
2075   server &SHOULD-NOT; generate trailer fields that it believes are necessary
2076   for the user agent to receive. Without a TE containing "trailers", the
2077   server ought to assume that the trailer fields might be silently discarded
2078   along the path to the user agent. This requirement allows intermediaries to
2079   forward a de-chunked message to an HTTP/1.0 recipient without buffering the
2080   entire response.
2084<section title="Decoding Chunked" anchor="decoding.chunked">
2086   A process for decoding the chunked transfer coding
2087   can be represented in pseudo-code as:
2089<figure><artwork type="code">
2090  length := 0
2091  read chunk-size, chunk-ext (if any), and CRLF
2092  while (chunk-size &gt; 0) {
2093     read chunk-data and CRLF
2094     append chunk-data to decoded-body
2095     length := length + chunk-size
2096     read chunk-size, chunk-ext (if any), and CRLF
2097  }
2098  read trailer field
2099  while (trailer field is not empty) {
2100     if trailer field is allowed to be sent in a trailer,
2101         append trailer field to existing header fields
2102     read trailer-field
2103  }
2104  Content-Length := length
2105  Remove "chunked" from Transfer-Encoding
2106  Remove Trailer from existing header fields
2111<section title="Compression Codings" anchor="compression.codings">
2113   The codings defined below can be used to compress the payload of a
2114   message.
2117<section title="Compress Coding" anchor="compress.coding">
2118<iref item="compress (Coding Format)"/>
2120   The "compress" coding is an adaptive Lempel-Ziv-Welch (LZW) coding
2121   <xref target="Welch"/> that is commonly produced by the UNIX file
2122   compression program "compress".
2123   A recipient &SHOULD; consider "x-compress" to be equivalent to "compress".
2127<section title="Deflate Coding" anchor="deflate.coding">
2128<iref item="deflate (Coding Format)"/>
2130   The "deflate" coding is a "zlib" data format <xref target="RFC1950"/>
2131   containing a "deflate" compressed data stream <xref target="RFC1951"/>
2132   that uses a combination of the Lempel-Ziv (LZ77) compression algorithm and
2133   Huffman coding.
2136  <t>
2137    &Note; Some non-conformant implementations send the "deflate"
2138    compressed data without the zlib wrapper.
2139   </t>
2143<section title="Gzip Coding" anchor="gzip.coding">
2144<iref item="gzip (Coding Format)"/>
2146   The "gzip" coding is an LZ77 coding with a 32 bit CRC that is commonly
2147   produced by the gzip file compression program <xref target="RFC1952"/>.
2148   A recipient &SHOULD; consider "x-gzip" to be equivalent to "gzip".
2154<section title="TE" anchor="header.te">
2155  <iref primary="true" item="TE header field" x:for-anchor=""/>
2156  <x:anchor-alias value="TE"/>
2157  <x:anchor-alias value="t-codings"/>
2158  <x:anchor-alias value="t-ranking"/>
2159  <x:anchor-alias value="rank"/>
2161   The "TE" header field in a request indicates what transfer codings,
2162   besides chunked, the client is willing to accept in response, and
2163   whether or not the client is willing to accept trailer fields in a
2164   chunked transfer coding.
2167   The TE field-value consists of a comma-separated list of transfer coding
2168   names, each allowing for optional parameters (as described in
2169   <xref target="transfer.codings"/>), and/or the keyword "trailers".
2170   A client &MUST-NOT; send the chunked transfer coding name in TE;
2171   chunked is always acceptable for HTTP/1.1 recipients.
2173<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="TE"/><iref primary="true" item="Grammar" subitem="t-codings"/><iref primary="true" item="Grammar" subitem="t-ranking"/><iref primary="true" item="Grammar" subitem="rank"/>
2174  <x:ref>TE</x:ref>        = #<x:ref>t-codings</x:ref>
2175  <x:ref>t-codings</x:ref> = "trailers" / ( <x:ref>transfer-coding</x:ref> [ <x:ref>t-ranking</x:ref> ] )
2176  <x:ref>t-ranking</x:ref> = <x:ref>OWS</x:ref> ";" <x:ref>OWS</x:ref> "q=" <x:ref>rank</x:ref>
2177  <x:ref>rank</x:ref>      = ( "0" [ "." 0*3<x:ref>DIGIT</x:ref> ] )
2178             / ( "1" [ "." 0*3("0") ] )
2181   Three examples of TE use are below.
2183<figure><artwork type="example">
2184  TE: deflate
2185  TE:
2186  TE: trailers, deflate;q=0.5
2189   The presence of the keyword "trailers" indicates that the client is willing
2190   to accept trailer fields in a chunked transfer coding, as defined in
2191   <xref target="chunked.trailer.part"/>, on behalf of itself and any downstream
2192   clients. For requests from an intermediary, this implies that either:
2193   (a) all downstream clients are willing to accept trailer fields in the
2194   forwarded response; or,
2195   (b) the intermediary will attempt to buffer the response on behalf of
2196   downstream recipients.
2197   Note that HTTP/1.1 does not define any means to limit the size of a
2198   chunked response such that an intermediary can be assured of buffering the
2199   entire response.
2202   When multiple transfer codings are acceptable, the client &MAY; rank the
2203   codings by preference using a case-insensitive "q" parameter (similar to
2204   the qvalues used in content negotiation fields, &qvalue;). The rank value
2205   is a real number in the range 0 through 1, where 0.001 is the least
2206   preferred and 1 is the most preferred; a value of 0 means "not acceptable".
2209   If the TE field-value is empty or if no TE field is present, the only
2210   acceptable transfer coding is chunked. A message with no transfer coding
2211   is always acceptable.
2214   Since the TE header field only applies to the immediate connection,
2215   a sender of TE &MUST; also send a "TE" connection option within the
2216   <x:ref>Connection</x:ref> header field (<xref target="header.connection"/>)
2217   in order to prevent the TE field from being forwarded by intermediaries
2218   that do not support its semantics.
2222<section title="Trailer" anchor="header.trailer">
2223  <iref primary="true" item="Trailer header field" x:for-anchor=""/>
2224  <x:anchor-alias value="Trailer"/>
2226   When a message includes a message body encoded with the chunked
2227   transfer coding and the sender desires to send metadata in the form of
2228   trailer fields at the end of the message, the sender &SHOULD; generate a
2229   <x:ref>Trailer</x:ref> header field before the message body to indicate
2230   which fields will be present in the trailers. This allows the recipient
2231   to prepare for receipt of that metadata before it starts processing the body,
2232   which is useful if the message is being streamed and the recipient wishes
2233   to confirm an integrity check on the fly.
2235<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Trailer"/><iref primary="false" item="Grammar" subitem="field-name"/>
2236  <x:ref>Trailer</x:ref> = 1#<x:ref>field-name</x:ref>
2241<section title="Message Routing" anchor="message.routing">
2243   HTTP request message routing is determined by each client based on the
2244   target resource, the client's proxy configuration, and
2245   establishment or reuse of an inbound connection.  The corresponding
2246   response routing follows the same connection chain back to the client.
2249<section title="Identifying a Target Resource" anchor="target-resource">
2250  <iref primary="true" item="target resource"/>
2251  <iref primary="true" item="target URI"/>
2252  <x:anchor-alias value="target resource"/>
2253  <x:anchor-alias value="target URI"/>
2255   HTTP is used in a wide variety of applications, ranging from
2256   general-purpose computers to home appliances.  In some cases,
2257   communication options are hard-coded in a client's configuration.
2258   However, most HTTP clients rely on the same resource identification
2259   mechanism and configuration techniques as general-purpose Web browsers.
2262   HTTP communication is initiated by a user agent for some purpose.
2263   The purpose is a combination of request semantics, which are defined in
2264   <xref target="Part2"/>, and a target resource upon which to apply those
2265   semantics.  A URI reference (<xref target="uri"/>) is typically used as
2266   an identifier for the "<x:dfn>target resource</x:dfn>", which a user agent
2267   would resolve to its absolute form in order to obtain the
2268   "<x:dfn>target URI</x:dfn>".  The target URI
2269   excludes the reference's fragment component, if any,
2270   since fragment identifiers are reserved for client-side processing
2271   (<xref target="RFC3986" x:fmt="," x:sec="3.5"/>).
2275<section title="Connecting Inbound" anchor="connecting.inbound">
2277   Once the target URI is determined, a client needs to decide whether
2278   a network request is necessary to accomplish the desired semantics and,
2279   if so, where that request is to be directed.
2282   If the client has a cache <xref target="Part6"/> and the request can be
2283   satisfied by it, then the request is
2284   usually directed there first.
2287   If the request is not satisfied by a cache, then a typical client will
2288   check its configuration to determine whether a proxy is to be used to
2289   satisfy the request.  Proxy configuration is implementation-dependent,
2290   but is often based on URI prefix matching, selective authority matching,
2291   or both, and the proxy itself is usually identified by an "http" or
2292   "https" URI.  If a proxy is applicable, the client connects inbound by
2293   establishing (or reusing) a connection to that proxy.
2296   If no proxy is applicable, a typical client will invoke a handler routine,
2297   usually specific to the target URI's scheme, to connect directly
2298   to an authority for the target resource.  How that is accomplished is
2299   dependent on the target URI scheme and defined by its associated
2300   specification, similar to how this specification defines origin server
2301   access for resolution of the "http" (<xref target="http.uri"/>) and
2302   "https" (<xref target="https.uri"/>) schemes.
2305   HTTP requirements regarding connection management are defined in
2306   <xref target=""/>.
2310<section title="Request Target" anchor="request-target">
2312   Once an inbound connection is obtained,
2313   the client sends an HTTP request message (<xref target="http.message"/>)
2314   with a request-target derived from the target URI.
2315   There are four distinct formats for the request-target, depending on both
2316   the method being requested and whether the request is to a proxy.
2318<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="request-target"/><iref primary="false" item="Grammar" subitem="origin-form"/><iref primary="false" item="Grammar" subitem="absolute-form"/><iref primary="false" item="Grammar" subitem="authority-form"/><iref primary="false" item="Grammar" subitem="asterisk-form"/>
2319  <x:ref>request-target</x:ref> = <x:ref>origin-form</x:ref>
2320                 / <x:ref>absolute-form</x:ref>
2321                 / <x:ref>authority-form</x:ref>
2322                 / <x:ref>asterisk-form</x:ref>
2325<section title="origin-form" anchor="origin-form">
2326   <iref item="origin-form (of request-target)"/>
2328   The most common form of request-target is the <x:dfn>origin-form</x:dfn>.
2330<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="origin-form"/>
2331  <x:ref>origin-form</x:ref>    = <x:ref>absolute-path</x:ref> [ "?" <x:ref>query</x:ref> ]
2334   When making a request directly to an origin server, other than a CONNECT
2335   or server-wide OPTIONS request (as detailed below),
2336   a client &MUST; send only the absolute path and query components of
2337   the target URI as the request-target.
2338   If the target URI's path component is empty, the client &MUST; send
2339   "/" as the path within the origin-form of request-target.
2340   A <x:ref>Host</x:ref> header field is also sent, as defined in
2341   <xref target=""/>.
2344   For example, a client wishing to retrieve a representation of the resource
2345   identified as
2347<figure><artwork x:indent-with="  " type="example">
2351   directly from the origin server would open (or reuse) a TCP connection
2352   to port 80 of the host "" and send the lines:
2354<figure><artwork type="message/http; msgtype=&#34;request&#34;" x:indent-with="  ">
2355GET /where?q=now HTTP/1.1
2359   followed by the remainder of the request message.
2363<section title="absolute-form" anchor="absolute-form">
2364   <iref item="absolute-form (of request-target)"/>
2366   When making a request to a proxy, other than a CONNECT or server-wide
2367   OPTIONS request (as detailed below), a client &MUST; send the target URI
2368   in <x:dfn>absolute-form</x:dfn> as the request-target.
2370<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="absolute-form"/>
2371  <x:ref>absolute-form</x:ref>  = <x:ref>absolute-URI</x:ref>
2374   The proxy is requested to either service that request from a valid cache,
2375   if possible, or make the same request on the client's behalf to either
2376   the next inbound proxy server or directly to the origin server indicated
2377   by the request-target.  Requirements on such "forwarding" of messages are
2378   defined in <xref target="message.forwarding"/>.
2381   An example absolute-form of request-line would be:
2383<figure><artwork type="message/http; msgtype=&#34;request&#34;" x:indent-with="  ">
2384GET HTTP/1.1
2387   To allow for transition to the absolute-form for all requests in some
2388   future version of HTTP, a server &MUST; accept the absolute-form
2389   in requests, even though HTTP/1.1 clients will only send them in requests
2390   to proxies.
2394<section title="authority-form" anchor="authority-form">
2395   <iref item="authority-form (of request-target)"/>
2397   The <x:dfn>authority-form</x:dfn> of request-target is only used for
2398   CONNECT requests (&CONNECT;).
2400<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="authority-form"/>
2401  <x:ref>authority-form</x:ref> = <x:ref>authority</x:ref>
2404   When making a CONNECT request to establish a
2405   tunnel through one or more proxies, a client &MUST; send only the target
2406   URI's authority component (excluding any userinfo and its "@" delimiter) as
2407   the request-target. For example,
2409<figure><artwork type="message/http; msgtype=&#34;request&#34;" x:indent-with="  ">
2414<section title="asterisk-form" anchor="asterisk-form">
2415   <iref item="asterisk-form (of request-target)"/>
2417   The <x:dfn>asterisk-form</x:dfn> of request-target is only used for a server-wide
2418   OPTIONS request (&OPTIONS;).
2420<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="asterisk-form"/>
2421  <x:ref>asterisk-form</x:ref>  = "*"
2424   When a client wishes to request OPTIONS
2425   for the server as a whole, as opposed to a specific named resource of
2426   that server, the client &MUST; send only "*" (%x2A) as the request-target.
2427   For example,
2429<figure><artwork type="message/http; msgtype=&#34;request&#34;" x:indent-with="  ">
2430OPTIONS * HTTP/1.1
2433   If a proxy receives an OPTIONS request with an absolute-form of
2434   request-target in which the URI has an empty path and no query component,
2435   then the last proxy on the request chain &MUST; send a request-target
2436   of "*" when it forwards the request to the indicated origin server.
2439   For example, the request
2440</preamble><artwork type="message/http; msgtype=&#34;request&#34;" x:indent-with="  ">
2444  would be forwarded by the final proxy as
2445</preamble><artwork type="message/http; msgtype=&#34;request&#34;" x:indent-with="  ">
2446OPTIONS * HTTP/1.1
2450   after connecting to port 8001 of host "".
2456<section title="Host" anchor="">
2457  <iref primary="true" item="Host header field" x:for-anchor=""/>
2458  <x:anchor-alias value="Host"/>
2460   The "Host" header field in a request provides the host and port
2461   information from the target URI, enabling the origin
2462   server to distinguish among resources while servicing requests
2463   for multiple host names on a single IP address.
2465<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Host"/>
2466  <x:ref>Host</x:ref> = <x:ref>uri-host</x:ref> [ ":" <x:ref>port</x:ref> ] ; <xref target="http.uri"/>
2469   A client &MUST; send a Host header field in all HTTP/1.1 request messages.
2470   If the target URI includes an authority component, then a client &MUST;
2471   send a field-value for Host that is identical to that authority
2472   component, excluding any userinfo subcomponent and its "@" delimiter
2473   (<xref target="http.uri"/>).
2474   If the authority component is missing or undefined for the target URI,
2475   then a client &MUST; send a Host header field with an empty field-value.
2478   Since the Host field-value is critical information for handling a request,
2479   a user agent &SHOULD; generate Host as the first header field following the
2480   request-line.
2483   For example, a GET request to the origin server for
2484   &lt;; would begin with:
2486<figure><artwork type="message/http; msgtype=&#34;request&#34;" x:indent-with="  ">
2487GET /pub/WWW/ HTTP/1.1
2491   A client &MUST; send a Host header field in an HTTP/1.1 request even
2492   if the request-target is in the absolute-form, since this
2493   allows the Host information to be forwarded through ancient HTTP/1.0
2494   proxies that might not have implemented Host.
2497   When a proxy receives a request with an absolute-form of
2498   request-target, the proxy &MUST; ignore the received
2499   Host header field (if any) and instead replace it with the host
2500   information of the request-target.  A proxy that forwards such a request
2501   &MUST; generate a new Host field-value based on the received
2502   request-target rather than forward the received Host field-value.
2505   Since the Host header field acts as an application-level routing
2506   mechanism, it is a frequent target for malware seeking to poison
2507   a shared cache or redirect a request to an unintended server.
2508   An interception proxy is particularly vulnerable if it relies on
2509   the Host field-value for redirecting requests to internal
2510   servers, or for use as a cache key in a shared cache, without
2511   first verifying that the intercepted connection is targeting a
2512   valid IP address for that host.
2515   A server &MUST; respond with a <x:ref>400 (Bad Request)</x:ref> status code
2516   to any HTTP/1.1 request message that lacks a Host header field and
2517   to any request message that contains more than one Host header field
2518   or a Host header field with an invalid field-value.
2522<section title="Effective Request URI" anchor="effective.request.uri">
2523  <iref primary="true" item="effective request URI"/>
2524  <x:anchor-alias value="effective request URI"/>
2526   Since the request-target often contains only part of the user agent's
2527   target URI, a server reconstructs the intended target as an
2528   "<x:dfn>effective request URI</x:dfn>" to properly service the request.
2529   This reconstruction involves both the server's local configuration and
2530   information communicated in the <x:ref>request-target</x:ref>,
2531   <x:ref>Host</x:ref> header field, and connection context.
2534   For a user agent, the effective request URI is the target URI.
2537   If the <x:ref>request-target</x:ref> is in <x:ref>absolute-form</x:ref>,
2538   the effective request URI is the same as the request-target. Otherwise, the
2539   effective request URI is constructed as follows:
2540<list style="empty">
2542   If the server's configuration (or outbound gateway) provides a fixed URI
2543   <x:ref>scheme</x:ref>, that scheme is used for the effective request URI.
2544   Otherwise, if the request is received over a TLS-secured TCP connection,
2545   the effective request URI's scheme is "https"; if not, the scheme is "http".
2548   If the server's configuration (or outbound gateway) provides a fixed URI
2549   <x:ref>authority</x:ref> component, that authority is used for the
2550   effective request URI. If not, then if the request-target is in
2551   <x:ref>authority-form</x:ref>, the effective request URI's authority
2552   component is the same as the request-target.
2553   If not, then if a <x:ref>Host</x:ref> header field is supplied with a
2554   non-empty field-value, the authority component is the same as the
2555   Host field-value. Otherwise, the authority component is assigned
2556   the default name configured for the server and, if the connection's
2557   incoming TCP port number differs from the default port for the effective
2558   request URI's scheme, then a colon (":") and the incoming port number (in
2559   decimal form) are appended to the authority component.
2562   If the request-target is in <x:ref>authority-form</x:ref> or
2563   <x:ref>asterisk-form</x:ref>, the effective request URI's combined
2564   <x:ref>path</x:ref> and <x:ref>query</x:ref> component is empty. Otherwise,
2565   the combined <x:ref>path</x:ref> and <x:ref>query</x:ref> component is the
2566   same as the request-target.
2569   The components of the effective request URI, once determined as above, can
2570   be combined into <x:ref>absolute-URI</x:ref> form by concatenating the
2571   scheme, "://", authority, and combined path and query component.
2577   Example 1: the following message received over an insecure TCP connection
2579<artwork type="example" x:indent-with="  ">
2580GET /pub/WWW/TheProject.html HTTP/1.1
2586  has an effective request URI of
2588<artwork type="example" x:indent-with="  ">
2594   Example 2: the following message received over a TLS-secured TCP connection
2596<artwork type="example" x:indent-with="  ">
2597OPTIONS * HTTP/1.1
2603  has an effective request URI of
2605<artwork type="example" x:indent-with="  ">
2610   Recipients of an HTTP/1.0 request that lacks a <x:ref>Host</x:ref> header
2611   field might need to use heuristics (e.g., examination of the URI path for
2612   something unique to a particular host) in order to guess the
2613   effective request URI's authority component.
2616   Once the effective request URI has been constructed, an origin server needs
2617   to decide whether or not to provide service for that URI via the connection
2618   in which the request was received. For example, the request might have been
2619   misdirected, deliberately or accidentally, such that the information within
2620   a received <x:ref>request-target</x:ref> or <x:ref>Host</x:ref> header
2621   field differs from the host or port upon which the connection has been
2622   made. If the connection is from a trusted gateway, that inconsistency might
2623   be expected; otherwise, it might indicate an attempt to bypass security
2624   filters, trick the server into delivering non-public content, or poison a
2625   cache. See <xref target="security.considerations"/> for security
2626   considerations regarding message routing.
2630<section title="Associating a Response to a Request" anchor="">
2632   HTTP does not include a request identifier for associating a given
2633   request message with its corresponding one or more response messages.
2634   Hence, it relies on the order of response arrival to correspond exactly
2635   to the order in which requests are made on the same connection.
2636   More than one response message per request only occurs when one or more
2637   informational responses (<x:ref>1xx</x:ref>, see &status-1xx;) precede a
2638   final response to the same request.
2641   A client that has more than one outstanding request on a connection &MUST;
2642   maintain a list of outstanding requests in the order sent and &MUST;
2643   associate each received response message on that connection to the highest
2644   ordered request that has not yet received a final (non-<x:ref>1xx</x:ref>)
2645   response.
2649<section title="Message Forwarding" anchor="message.forwarding">
2651   As described in <xref target="intermediaries"/>, intermediaries can serve
2652   a variety of roles in the processing of HTTP requests and responses.
2653   Some intermediaries are used to improve performance or availability.
2654   Others are used for access control or to filter content.
2655   Since an HTTP stream has characteristics similar to a pipe-and-filter
2656   architecture, there are no inherent limits to the extent an intermediary
2657   can enhance (or interfere) with either direction of the stream.
2660   An intermediary not acting as a tunnel &MUST; implement the
2661   <x:ref>Connection</x:ref> header field, as specified in
2662   <xref target="header.connection"/>, and exclude fields from being forwarded
2663   that are only intended for the incoming connection.
2666   An intermediary &MUST-NOT; forward a message to itself unless it is
2667   protected from an infinite request loop. In general, an intermediary ought
2668   to recognize its own server names, including any aliases, local variations,
2669   or literal IP addresses, and respond to such requests directly.
2672<section title="Via" anchor="header.via">
2673  <iref primary="true" item="Via header field" x:for-anchor=""/>
2674  <x:anchor-alias value="pseudonym"/>
2675  <x:anchor-alias value="received-by"/>
2676  <x:anchor-alias value="received-protocol"/>
2677  <x:anchor-alias value="Via"/>
2679   The "Via" header field indicates the presence of intermediate protocols and
2680   recipients between the user agent and the server (on requests) or between
2681   the origin server and the client (on responses), similar to the
2682   "Received" header field in email
2683   (<xref target="RFC5322" x:fmt="of" x:sec="3.6.7"/>).
2684   Via can be used for tracking message forwards,
2685   avoiding request loops, and identifying the protocol capabilities of
2686   senders along the request/response chain.
2688<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Via"/><iref primary="true" item="Grammar" subitem="received-protocol"/><iref primary="true" item="Grammar" subitem="protocol-name"/><iref primary="true" item="Grammar" subitem="protocol-version"/><iref primary="true" item="Grammar" subitem="received-by"/><iref primary="true" item="Grammar" subitem="pseudonym"/>
2689  <x:ref>Via</x:ref> = 1#( <x:ref>received-protocol</x:ref> <x:ref>RWS</x:ref> <x:ref>received-by</x:ref> [ <x:ref>RWS</x:ref> <x:ref>comment</x:ref> ] )
2691  <x:ref>received-protocol</x:ref> = [ <x:ref>protocol-name</x:ref> "/" ] <x:ref>protocol-version</x:ref>
2692                      ; see <xref target="header.upgrade"/>
2693  <x:ref>received-by</x:ref>       = ( <x:ref>uri-host</x:ref> [ ":" <x:ref>port</x:ref> ] ) / <x:ref>pseudonym</x:ref>
2694  <x:ref>pseudonym</x:ref>         = <x:ref>token</x:ref>
2697   Multiple Via field values represent each proxy or gateway that has
2698   forwarded the message. Each intermediary appends its own information
2699   about how the message was received, such that the end result is ordered
2700   according to the sequence of forwarding recipients.
2703   A proxy &MUST; send an appropriate Via header field, as described below, in
2704   each message that it forwards.
2705   An HTTP-to-HTTP gateway &MUST; send an appropriate Via header field in
2706   each inbound request message and &MAY; send a Via header field in
2707   forwarded response messages.
2710   For each intermediary, the received-protocol indicates the protocol and
2711   protocol version used by the upstream sender of the message. Hence, the
2712   Via field value records the advertised protocol capabilities of the
2713   request/response chain such that they remain visible to downstream
2714   recipients; this can be useful for determining what backwards-incompatible
2715   features might be safe to use in response, or within a later request, as
2716   described in <xref target="http.version"/>. For brevity, the protocol-name
2717   is omitted when the received protocol is HTTP.
2720   The received-by portion of the field value is normally the host and optional
2721   port number of a recipient server or client that subsequently forwarded the
2722   message.
2723   However, if the real host is considered to be sensitive information, a
2724   sender &MAY; replace it with a pseudonym. If a port is not provided,
2725   a recipient &MAY; interpret that as meaning it was received on the default
2726   TCP port, if any, for the received-protocol.
2729   A sender &MAY; generate comments in the Via header field to identify the
2730   software of each recipient, analogous to the <x:ref>User-Agent</x:ref> and
2731   <x:ref>Server</x:ref> header fields. However, all comments in the Via field
2732   are optional and a recipient &MAY; remove them prior to forwarding the
2733   message.
2736   For example, a request message could be sent from an HTTP/1.0 user
2737   agent to an internal proxy code-named "fred", which uses HTTP/1.1 to
2738   forward the request to a public proxy at, which completes
2739   the request by forwarding it to the origin server at
2740   The request received by would then have the following
2741   Via header field:
2743<figure><artwork type="example">
2744  Via: 1.0 fred, 1.1
2747   An intermediary used as a portal through a network firewall
2748   &SHOULD-NOT; forward the names and ports of hosts within the firewall
2749   region unless it is explicitly enabled to do so. If not enabled, such an
2750   intermediary &SHOULD; replace each received-by host of any host behind the
2751   firewall by an appropriate pseudonym for that host.
2754   An intermediary &MAY; combine an ordered subsequence of Via header
2755   field entries into a single such entry if the entries have identical
2756   received-protocol values. For example,
2758<figure><artwork type="example">
2759  Via: 1.0 ricky, 1.1 ethel, 1.1 fred, 1.0 lucy
2762  could be collapsed to
2764<figure><artwork type="example">
2765  Via: 1.0 ricky, 1.1 mertz, 1.0 lucy
2768   A sender &SHOULD-NOT; combine multiple entries unless they are all
2769   under the same organizational control and the hosts have already been
2770   replaced by pseudonyms. A sender &MUST-NOT; combine entries that
2771   have different received-protocol values.
2775<section title="Transformations" anchor="message.transformations">
2776   <iref primary="true" item="transforming proxy"/>
2777   <iref primary="true" item="non-transforming proxy"/>
2779   Some intermediaries include features for transforming messages and their
2780   payloads. A proxy might, for example, convert between image formats in
2781   order to save cache space or to reduce the amount of traffic on a slow
2782   link. However, operational problems might occur when these transformations
2783   are applied to payloads intended for critical applications, such as medical
2784   imaging or scientific data analysis, particularly when integrity checks or
2785   digital signatures are used to ensure that the payload received is
2786   identical to the original.
2789   An HTTP-to-HTTP proxy is called a "<x:dfn>transforming proxy</x:dfn>"
2790   if it is designed or configured to modify messages in a semantically
2791   meaningful way (i.e., modifications, beyond those required by normal
2792   HTTP processing, that change the message in a way that would be
2793   significant to the original sender or potentially significant to
2794   downstream recipients).  For example, a transforming proxy might be
2795   acting as a shared annotation server (modifying responses to include
2796   references to a local annotation database), a malware filter, a
2797   format transcoder, or a privacy filter. Such transformations are presumed
2798   to be desired by whichever client (or client organization) selected the
2799   proxy.
2802   If a proxy receives a request-target with a host name that is not a
2803   fully qualified domain name, it &MAY; add its own domain to the host name
2804   it received when forwarding the request.  A proxy &MUST-NOT; change the
2805   host name if the request-target contains a fully qualified domain name.
2808   A proxy &MUST-NOT; modify the "absolute-path" and "query" parts of the
2809   received request-target when forwarding it to the next inbound server,
2810   except as noted above to replace an empty path with "/" or "*".
2813   A proxy &MAY; modify the message body through application
2814   or removal of a transfer coding (<xref target="transfer.codings"/>).
2817   A proxy &MUST-NOT; transform the payload (&payload;) of a message that
2818   contains a no-transform cache-control directive (&header-cache-control;).
2821   A proxy &MAY; transform the payload of a message
2822   that does not contain a no-transform cache-control directive.
2823   A proxy that transforms a payload &MUST; add a <x:ref>Warning</x:ref>
2824   header field with the warn-code of 214 ("Transformation Applied")
2825   if one is not already in the message (see &header-warning;).
2826   A proxy that transforms the payload of a <x:ref>200 (OK)</x:ref> response
2827   can further inform downstream recipients that a transformation has been
2828   applied by changing the response status code to
2829   <x:ref>203 (Non-Authoritative Information)</x:ref> (&status-203;).
2832   A proxy &MUST-NOT; modify header fields that provide information about the
2833   end points of the communication chain, the resource state, or the selected
2834   representation.
2840<section title="Connection Management" anchor="">
2842   HTTP messaging is independent of the underlying transport or
2843   session-layer connection protocol(s).  HTTP only presumes a reliable
2844   transport with in-order delivery of requests and the corresponding
2845   in-order delivery of responses.  The mapping of HTTP request and
2846   response structures onto the data units of an underlying transport
2847   protocol is outside the scope of this specification.
2850   As described in <xref target="connecting.inbound"/>, the specific
2851   connection protocols to be used for an HTTP interaction are determined by
2852   client configuration and the <x:ref>target URI</x:ref>.
2853   For example, the "http" URI scheme
2854   (<xref target="http.uri"/>) indicates a default connection of TCP
2855   over IP, with a default TCP port of 80, but the client might be
2856   configured to use a proxy via some other connection, port, or protocol.
2859   HTTP implementations are expected to engage in connection management,
2860   which includes maintaining the state of current connections,
2861   establishing a new connection or reusing an existing connection,
2862   processing messages received on a connection, detecting connection
2863   failures, and closing each connection.
2864   Most clients maintain multiple connections in parallel, including
2865   more than one connection per server endpoint.
2866   Most servers are designed to maintain thousands of concurrent connections,
2867   while controlling request queues to enable fair use and detect
2868   denial of service attacks.
2871<section title="Connection" anchor="header.connection">
2872  <iref primary="true" item="Connection header field" x:for-anchor=""/>
2873  <iref primary="true" item="close" x:for-anchor=""/>
2874  <x:anchor-alias value="Connection"/>
2875  <x:anchor-alias value="connection-option"/>
2876  <x:anchor-alias value="close"/>
2878   The "Connection" header field allows the sender to indicate desired
2879   control options for the current connection.  In order to avoid confusing
2880   downstream recipients, a proxy or gateway &MUST; remove or replace any
2881   received connection options before forwarding the message.
2884   When a header field aside from Connection is used to supply control
2885   information for or about the current connection, the sender &MUST; list
2886   the corresponding field-name within the "Connection" header field.
2887   A proxy or gateway &MUST; parse a received Connection
2888   header field before a message is forwarded and, for each
2889   connection-option in this field, remove any header field(s) from
2890   the message with the same name as the connection-option, and then
2891   remove the Connection header field itself (or replace it with the
2892   intermediary's own connection options for the forwarded message).
2895   Hence, the Connection header field provides a declarative way of
2896   distinguishing header fields that are only intended for the
2897   immediate recipient ("hop-by-hop") from those fields that are
2898   intended for all recipients on the chain ("end-to-end"), enabling the
2899   message to be self-descriptive and allowing future connection-specific
2900   extensions to be deployed without fear that they will be blindly
2901   forwarded by older intermediaries.
2904   The Connection header field's value has the following grammar:
2906<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Connection"/><iref primary="true" item="Grammar" subitem="connection-option"/>
2907  <x:ref>Connection</x:ref>        = 1#<x:ref>connection-option</x:ref>
2908  <x:ref>connection-option</x:ref> = <x:ref>token</x:ref>
2911   Connection options are case-insensitive.
2914   A sender &MUST-NOT; send a connection option corresponding to a header
2915   field that is intended for all recipients of the payload.
2916   For example, <x:ref>Cache-Control</x:ref> is never appropriate as a
2917   connection option (&header-cache-control;).
2920   The connection options do not always correspond to a header field
2921   present in the message, since a connection-specific header field
2922   might not be needed if there are no parameters associated with a
2923   connection option. In contrast, a connection-specific header field that
2924   is received without a corresponding connection option usually indicates
2925   that the field has been improperly forwarded by an intermediary and
2926   ought to be ignored by the recipient.
2929   When defining new connection options, specification authors ought to survey
2930   existing header field names and ensure that the new connection option does
2931   not share the same name as an already deployed header field.
2932   Defining a new connection option essentially reserves that potential
2933   field-name for carrying additional information related to the
2934   connection option, since it would be unwise for senders to use
2935   that field-name for anything else.
2938   The "<x:dfn>close</x:dfn>" connection option is defined for a
2939   sender to signal that this connection will be closed after completion of
2940   the response. For example,
2942<figure><artwork type="example">
2943  Connection: close
2946   in either the request or the response header fields indicates that the
2947   sender is going to close the connection after the current request/response
2948   is complete (<xref target="persistent.tear-down"/>).
2951   A client that does not support <x:ref>persistent connections</x:ref> &MUST;
2952   send the "close" connection option in every request message.
2955   A server that does not support <x:ref>persistent connections</x:ref> &MUST;
2956   send the "close" connection option in every response message that
2957   does not have a <x:ref>1xx (Informational)</x:ref> status code.
2961<section title="Establishment" anchor="persistent.establishment">
2963   It is beyond the scope of this specification to describe how connections
2964   are established via various transport or session-layer protocols.
2965   Each connection applies to only one transport link.
2969<section title="Persistence" anchor="persistent.connections">
2970   <x:anchor-alias value="persistent connections"/>
2972   HTTP/1.1 defaults to the use of "<x:dfn>persistent connections</x:dfn>",
2973   allowing multiple requests and responses to be carried over a single
2974   connection. The "<x:ref>close</x:ref>" connection-option is used to signal
2975   that a connection will not persist after the current request/response.
2976   HTTP implementations &SHOULD; support persistent connections.
2979   A recipient determines whether a connection is persistent or not based on
2980   the most recently received message's protocol version and
2981   <x:ref>Connection</x:ref> header field (if any):
2982   <list style="symbols">
2983     <t>If the <x:ref>close</x:ref> connection option is present, the
2984        connection will not persist after the current response; else,</t>
2985     <t>If the received protocol is HTTP/1.1 (or later), the connection will
2986        persist after the current response; else,</t>
2987     <t>If the received protocol is HTTP/1.0, the "keep-alive"
2988        connection option is present, the recipient is not a proxy, and
2989        the recipient wishes to honor the HTTP/1.0 "keep-alive" mechanism,
2990        the connection will persist after the current response; otherwise,</t>
2991     <t>The connection will close after the current response.</t>
2992   </list>
2995   A client &MAY; send additional requests on a persistent connection until it
2996   sends or receives a <x:ref>close</x:ref> connection option or receives an
2997   HTTP/1.0 response without a "keep-alive" connection option.
3000   In order to remain persistent, all messages on a connection need to
3001   have a self-defined message length (i.e., one not defined by closure
3002   of the connection), as described in <xref target="message.body"/>.
3003   A server &MUST; read the entire request message body or close
3004   the connection after sending its response, since otherwise the
3005   remaining data on a persistent connection would be misinterpreted
3006   as the next request.  Likewise,
3007   a client &MUST; read the entire response message body if it intends
3008   to reuse the same connection for a subsequent request.
3011   A proxy server &MUST-NOT; maintain a persistent connection with an
3012   HTTP/1.0 client (see <xref x:sec="19.7.1" x:fmt="of" target="RFC2068"/> for
3013   information and discussion of the problems with the Keep-Alive header field
3014   implemented by many HTTP/1.0 clients).
3017   See <xref target="compatibility.with.http.1.0.persistent.connections"/>
3018   for more information on backward compatibility with HTTP/1.0 clients.
3021<section title="Retrying Requests" anchor="persistent.retrying.requests">
3023   Connections can be closed at any time, with or without intention.
3024   Implementations ought to anticipate the need to recover
3025   from asynchronous close events.
3028   When an inbound connection is closed prematurely, a client &MAY; open a new
3029   connection and automatically retransmit an aborted sequence of requests if
3030   all of those requests have idempotent methods (&idempotent-methods;).
3031   A proxy &MUST-NOT; automatically retry non-idempotent requests.
3034   A user agent &MUST-NOT; automatically retry a request with a non-idempotent
3035   method unless it has some means to know that the request semantics are
3036   actually idempotent, regardless of the method, or some means to detect that
3037   the original request was never applied. For example, a user agent that
3038   knows (through design or configuration) that a POST request to a given
3039   resource is safe can repeat that request automatically.
3040   Likewise, a user agent designed specifically to operate on a version
3041   control repository might be able to recover from partial failure conditions
3042   by checking the target resource revision(s) after a failed connection,
3043   reverting or fixing any changes that were partially applied, and then
3044   automatically retrying the requests that failed.
3047   A client &SHOULD-NOT; automatically retry a failed automatic retry.
3051<section title="Pipelining" anchor="pipelining">
3052   <x:anchor-alias value="pipeline"/>
3054   A client that supports persistent connections &MAY; "<x:dfn>pipeline</x:dfn>"
3055   its requests (i.e., send multiple requests without waiting for each
3056   response). A server &MAY; process a sequence of pipelined requests in
3057   parallel if they all have safe methods (&safe-methods;), but &MUST; send
3058   the corresponding responses in the same order that the requests were
3059   received.
3062   A client that pipelines requests &SHOULD; retry unanswered requests if the
3063   connection closes before it receives all of the corresponding responses.
3064   When retrying pipelined requests after a failed connection (a connection
3065   not explicitly closed by the server in its last complete response), a
3066   client &MUST-NOT; pipeline immediately after connection establishment,
3067   since the first remaining request in the prior pipeline might have caused
3068   an error response that can be lost again if multiple requests are sent on a
3069   prematurely closed connection (see the TCP reset problem described in
3070   <xref target="persistent.tear-down"/>).
3073   Idempotent methods (&idempotent-methods;) are significant to pipelining
3074   because they can be automatically retried after a connection failure.
3075   A user agent &SHOULD-NOT; pipeline requests after a non-idempotent method,
3076   until the final response status code for that method has been received,
3077   unless the user agent has a means to detect and recover from partial
3078   failure conditions involving the pipelined sequence.
3081   An intermediary that receives pipelined requests &MAY; pipeline those
3082   requests when forwarding them inbound, since it can rely on the outbound
3083   user agent(s) to determine what requests can be safely pipelined. If the
3084   inbound connection fails before receiving a response, the pipelining
3085   intermediary &MAY; attempt to retry a sequence of requests that have yet
3086   to receive a response if the requests all have idempotent methods;
3087   otherwise, the pipelining intermediary &SHOULD; forward any received
3088   responses and then close the corresponding outbound connection(s) so that
3089   the outbound user agent(s) can recover accordingly.
3094<section title="Concurrency" anchor="persistent.concurrency">
3096   A client ought to limit the number of simultaneous open
3097   connections that it maintains to a given server.
3100   Previous revisions of HTTP gave a specific number of connections as a
3101   ceiling, but this was found to be impractical for many applications. As a
3102   result, this specification does not mandate a particular maximum number of
3103   connections, but instead encourages clients to be conservative when opening
3104   multiple connections.
3107   Multiple connections are typically used to avoid the "head-of-line
3108   blocking" problem, wherein a request that takes significant server-side
3109   processing and/or has a large payload blocks subsequent requests on the
3110   same connection. However, each connection consumes server resources.
3111   Furthermore, using multiple connections can cause undesirable side effects
3112   in congested networks.
3115   Note that a server might reject traffic that it deems abusive or
3116   characteristic of a denial of service attack, such as an excessive number
3117   of open connections from a single client.
3121<section title="Failures and Time-outs" anchor="persistent.failures">
3123   Servers will usually have some time-out value beyond which they will
3124   no longer maintain an inactive connection. Proxy servers might make
3125   this a higher value since it is likely that the client will be making
3126   more connections through the same proxy server. The use of persistent
3127   connections places no requirements on the length (or existence) of
3128   this time-out for either the client or the server.
3131   A client or server that wishes to time-out &SHOULD; issue a graceful close
3132   on the connection. Implementations &SHOULD; constantly monitor open
3133   connections for a received closure signal and respond to it as appropriate,
3134   since prompt closure of both sides of a connection enables allocated system
3135   resources to be reclaimed.
3138   A client, server, or proxy &MAY; close the transport connection at any
3139   time. For example, a client might have started to send a new request
3140   at the same time that the server has decided to close the "idle"
3141   connection. From the server's point of view, the connection is being
3142   closed while it was idle, but from the client's point of view, a
3143   request is in progress.
3146   A server &SHOULD; sustain persistent connections, when possible, and allow
3147   the underlying
3148   transport's flow control mechanisms to resolve temporary overloads, rather
3149   than terminate connections with the expectation that clients will retry.
3150   The latter technique can exacerbate network congestion.
3153   A client sending a message body &SHOULD; monitor
3154   the network connection for an error response while it is transmitting
3155   the request. If the client sees a response that indicates the server does
3156   not wish to receive the message body and is closing the connection, the
3157   client &SHOULD; immediately cease transmitting the body and close its side
3158   of the connection.
3162<section title="Tear-down" anchor="persistent.tear-down">
3163  <iref primary="false" item="Connection header field" x:for-anchor=""/>
3164  <iref primary="false" item="close" x:for-anchor=""/>
3166   The <x:ref>Connection</x:ref> header field
3167   (<xref target="header.connection"/>) provides a "<x:ref>close</x:ref>"
3168   connection option that a sender &SHOULD; send when it wishes to close
3169   the connection after the current request/response pair.
3172   A client that sends a <x:ref>close</x:ref> connection option &MUST-NOT;
3173   send further requests on that connection (after the one containing
3174   <x:ref>close</x:ref>) and &MUST; close the connection after reading the
3175   final response message corresponding to this request.
3178   A server that receives a <x:ref>close</x:ref> connection option &MUST;
3179   initiate a close of the connection (see below) after it sends the
3180   final response to the request that contained <x:ref>close</x:ref>.
3181   The server &SHOULD; send a <x:ref>close</x:ref> connection option
3182   in its final response on that connection. The server &MUST-NOT; process
3183   any further requests received on that connection.
3186   A server that sends a <x:ref>close</x:ref> connection option &MUST;
3187   initiate a close of the connection (see below) after it sends the
3188   response containing <x:ref>close</x:ref>. The server &MUST-NOT; process
3189   any further requests received on that connection.
3192   A client that receives a <x:ref>close</x:ref> connection option &MUST;
3193   cease sending requests on that connection and close the connection
3194   after reading the response message containing the close; if additional
3195   pipelined requests had been sent on the connection, the client &SHOULD-NOT;
3196   assume that they will be processed by the server.
3199   If a server performs an immediate close of a TCP connection, there is a
3200   significant risk that the client will not be able to read the last HTTP
3201   response.  If the server receives additional data from the client on a
3202   fully-closed connection, such as another request that was sent by the
3203   client before receiving the server's response, the server's TCP stack will
3204   send a reset packet to the client; unfortunately, the reset packet might
3205   erase the client's unacknowledged input buffers before they can be read
3206   and interpreted by the client's HTTP parser.
3209   To avoid the TCP reset problem, servers typically close a connection in
3210   stages. First, the server performs a half-close by closing only the write
3211   side of the read/write connection. The server then continues to read from
3212   the connection until it receives a corresponding close by the client, or
3213   until the server is reasonably certain that its own TCP stack has received
3214   the client's acknowledgement of the packet(s) containing the server's last
3215   response. Finally, the server fully closes the connection.
3218   It is unknown whether the reset problem is exclusive to TCP or might also
3219   be found in other transport connection protocols.
3223<section title="Upgrade" anchor="header.upgrade">
3224  <iref primary="true" item="Upgrade header field" x:for-anchor=""/>
3225  <x:anchor-alias value="Upgrade"/>
3226  <x:anchor-alias value="protocol"/>
3227  <x:anchor-alias value="protocol-name"/>
3228  <x:anchor-alias value="protocol-version"/>
3230   The "Upgrade" header field is intended to provide a simple mechanism
3231   for transitioning from HTTP/1.1 to some other protocol on the same
3232   connection.  A client &MAY; send a list of protocols in the Upgrade
3233   header field of a request to invite the server to switch to one or
3234   more of those protocols, in order of descending preference, before sending
3235   the final response. A server &MAY; ignore a received Upgrade header field
3236   if it wishes to continue using the current protocol on that connection.
3237   Upgrade cannot be used to insist on a protocol change.
3239<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Upgrade"/>
3240  <x:ref>Upgrade</x:ref>          = 1#<x:ref>protocol</x:ref>
3242  <x:ref>protocol</x:ref>         = <x:ref>protocol-name</x:ref> ["/" <x:ref>protocol-version</x:ref>]
3243  <x:ref>protocol-name</x:ref>    = <x:ref>token</x:ref>
3244  <x:ref>protocol-version</x:ref> = <x:ref>token</x:ref>
3247   A server that sends a <x:ref>101 (Switching Protocols)</x:ref> response
3248   &MUST; send an Upgrade header field to indicate the new protocol(s) to
3249   which the connection is being switched; if multiple protocol layers are
3250   being switched, the sender &MUST; list the protocols in layer-ascending
3251   order. A server &MUST-NOT; switch to a protocol that was not indicated by
3252   the client in the corresponding request's Upgrade header field.
3253   A server &MAY; choose to ignore the order of preference indicated by the
3254   client and select the new protocol(s) based on other factors, such as the
3255   nature of the request or the current load on the server.
3258   A server that sends a <x:ref>426 (Upgrade Required)</x:ref> response
3259   &MUST; send an Upgrade header field to indicate the acceptable protocols,
3260   in order of descending preference.
3263   A server &MAY; send an Upgrade header field in any other response to
3264   advertise that it implements support for upgrading to the listed protocols,
3265   in order of descending preference, when appropriate for a future request.
3268   The following is a hypothetical example sent by a client:
3269</preamble><artwork type="message/http; msgtype=&#34;request&#34;" x:indent-with="  ">
3270GET /hello.txt HTTP/1.1
3272Connection: upgrade
3273Upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11
3277   The capabilities and nature of the
3278   application-level communication after the protocol change is entirely
3279   dependent upon the new protocol(s) chosen. However, immediately after
3280   sending the 101 response, the server is expected to continue responding to
3281   the original request as if it had received its equivalent within the new
3282   protocol (i.e., the server still has an outstanding request to satisfy
3283   after the protocol has been changed, and is expected to do so without
3284   requiring the request to be repeated).
3287   For example, if the Upgrade header field is received in a GET request
3288   and the server decides to switch protocols, it first responds
3289   with a <x:ref>101 (Switching Protocols)</x:ref> message in HTTP/1.1 and
3290   then immediately follows that with the new protocol's equivalent of a
3291   response to a GET on the target resource.  This allows a connection to be
3292   upgraded to protocols with the same semantics as HTTP without the
3293   latency cost of an additional round-trip.  A server &MUST-NOT; switch
3294   protocols unless the received message semantics can be honored by the new
3295   protocol; an OPTIONS request can be honored by any protocol.
3298   The following is an example response to the above hypothetical request:
3299</preamble><artwork type="message/http; msgtype=&#34;response&#34;" x:indent-with="  ">
3300HTTP/1.1 101 Switching Protocols
3301Connection: upgrade
3302Upgrade: HTTP/2.0
3304[... data stream switches to HTTP/2.0 with an appropriate response
3305(as defined by new protocol) to the "GET /hello.txt" request ...]
3308   When Upgrade is sent, the sender &MUST; also send a
3309   <x:ref>Connection</x:ref> header field (<xref target="header.connection"/>)
3310   that contains an "upgrade" connection option, in order to prevent Upgrade
3311   from being accidentally forwarded by intermediaries that might not implement
3312   the listed protocols.  A server &MUST; ignore an Upgrade header field that
3313   is received in an HTTP/1.0 request.
3316   A client cannot begin using an upgraded protocol on the connection until
3317   it has completely sent the request message (i.e., the client can't change
3318   the protocol it is sending in the middle of a message).
3319   If a server receives both Upgrade and an <x:ref>Expect</x:ref> header field
3320   with the "100-continue" expectation (&header-expect;), the
3321   server &MUST; send a <x:ref>100 (Continue)</x:ref> response before sending
3322   a <x:ref>101 (Switching Protocols)</x:ref> response.
3325   The Upgrade header field only applies to switching protocols on top of the
3326   existing connection; it cannot be used to switch the underlying connection
3327   (transport) protocol, nor to switch the existing communication to a
3328   different connection. For those purposes, it is more appropriate to use a
3329   <x:ref>3xx (Redirection)</x:ref> response (&status-3xx;).
3332   This specification only defines the protocol name "HTTP" for use by
3333   the family of Hypertext Transfer Protocols, as defined by the HTTP
3334   version rules of <xref target="http.version"/> and future updates to this
3335   specification. Additional tokens ought to be registered with IANA using the
3336   registration procedure defined in <xref target="upgrade.token.registry"/>.
3341<section title="ABNF list extension: #rule" anchor="abnf.extension">
3343   A #rule extension to the ABNF rules of <xref target="RFC5234"/> is used to
3344   improve readability in the definitions of some header field values.
3347   A construct "#" is defined, similar to "*", for defining comma-delimited
3348   lists of elements. The full form is "&lt;n&gt;#&lt;m&gt;element" indicating
3349   at least &lt;n&gt; and at most &lt;m&gt; elements, each separated by a single
3350   comma (",") and optional whitespace (OWS).   
3353   In any production that uses the list construct, a sender &MUST-NOT;
3354   generate empty list elements. In other words, a sender &MUST; generate
3355   lists that satisfy the following syntax:
3356</preamble><artwork type="example">
3357  1#element =&gt; element *( OWS "," OWS element )
3360   and:
3361</preamble><artwork type="example">
3362  #element =&gt; [ 1#element ]
3365   and for n &gt;= 1 and m &gt; 1:
3366</preamble><artwork type="example">
3367  &lt;n&gt;#&lt;m&gt;element =&gt; element &lt;n-1&gt;*&lt;m-1&gt;( OWS "," OWS element )
3370   For compatibility with legacy list rules, a recipient &MUST; parse and ignore
3371   a reasonable number of empty list elements: enough to handle common mistakes
3372   by senders that merge values, but not so much that they could be used as a
3373   denial of service mechanism. In other words, a recipient &MUST; accept lists
3374   that satisfy the following syntax:
3376<figure><artwork type="example">
3377  #element =&gt; [ ( "," / element ) *( OWS "," [ OWS element ] ) ]
3379  1#element =&gt; *( "," OWS ) element *( OWS "," [ OWS element ] )
3382   Empty elements do not contribute to the count of elements present.
3383   For example, given these ABNF productions:
3385<figure><artwork type="example">
3386  example-list      = 1#example-list-elmt
3387  example-list-elmt = token ; see <xref target="field.components"/>
3390   Then the following are valid values for example-list (not including the
3391   double quotes, which are present for delimitation only):
3393<figure><artwork type="example">
3394  "foo,bar"
3395  "foo ,bar,"
3396  "foo , ,bar,charlie   "
3399   In contrast, the following values would be invalid, since at least one
3400   non-empty element is required by the example-list production:
3402<figure><artwork type="example">
3403  ""
3404  ","
3405  ",   ,"
3408   <xref target="collected.abnf"/> shows the collected ABNF for recipients
3409   after the list constructs have been expanded.
3413<section title="IANA Considerations" anchor="IANA.considerations">
3415<section title="Header Field Registration" anchor="header.field.registration">
3417   HTTP header fields are registered within the Message Header Field Registry
3418   maintained at
3419   <eref target=""/>.
3422   This document defines the following HTTP header fields, so their
3423   associated registry entries shall be updated according to the permanent
3424   registrations below (see <xref target="BCP90"/>):
3426<?BEGININC p1-messaging.iana-headers ?>
3427<!--AUTOGENERATED FROM extract-header-defs.xslt, do not edit manually-->
3428<texttable align="left" suppress-title="true" anchor="iana.header.registration.table">
3429   <ttcol>Header Field Name</ttcol>
3430   <ttcol>Protocol</ttcol>
3431   <ttcol>Status</ttcol>
3432   <ttcol>Reference</ttcol>
3434   <c>Connection</c>
3435   <c>http</c>
3436   <c>standard</c>
3437   <c>
3438      <xref target="header.connection"/>
3439   </c>
3440   <c>Content-Length</c>
3441   <c>http</c>
3442   <c>standard</c>
3443   <c>
3444      <xref target="header.content-length"/>
3445   </c>
3446   <c>Host</c>
3447   <c>http</c>
3448   <c>standard</c>
3449   <c>
3450      <xref target=""/>
3451   </c>
3452   <c>TE</c>
3453   <c>http</c>
3454   <c>standard</c>
3455   <c>
3456      <xref target="header.te"/>
3457   </c>
3458   <c>Trailer</c>
3459   <c>http</c>
3460   <c>standard</c>
3461   <c>
3462      <xref target="header.trailer"/>
3463   </c>
3464   <c>Transfer-Encoding</c>
3465   <c>http</c>
3466   <c>standard</c>
3467   <c>
3468      <xref target="header.transfer-encoding"/>
3469   </c>
3470   <c>Upgrade</c>
3471   <c>http</c>
3472   <c>standard</c>
3473   <c>
3474      <xref target="header.upgrade"/>
3475   </c>
3476   <c>Via</c>
3477   <c>http</c>
3478   <c>standard</c>
3479   <c>
3480      <xref target="header.via"/>
3481   </c>
3484<?ENDINC p1-messaging.iana-headers ?>
3486   Furthermore, the header field-name "Close" shall be registered as
3487   "reserved", since using that name as an HTTP header field might
3488   conflict with the "close" connection option of the "<x:ref>Connection</x:ref>"
3489   header field (<xref target="header.connection"/>).
3491<texttable align="left" suppress-title="true">
3492   <ttcol>Header Field Name</ttcol>
3493   <ttcol>Protocol</ttcol>
3494   <ttcol>Status</ttcol>
3495   <ttcol>Reference</ttcol>
3497   <c>Close</c>
3498   <c>http</c>
3499   <c>reserved</c>
3500   <c>
3501      <xref target="header.field.registration"/>
3502   </c>
3505   The change controller is: "IETF ( - Internet Engineering Task Force".
3509<section title="URI Scheme Registration" anchor="uri.scheme.registration">
3511   IANA maintains the registry of URI Schemes <xref target="BCP115"/> at
3512   <eref target=""/>.
3515   This document defines the following URI schemes, so their
3516   associated registry entries shall be updated according to the permanent
3517   registrations below:
3519<texttable align="left" suppress-title="true">
3520   <ttcol>URI Scheme</ttcol>
3521   <ttcol>Description</ttcol>
3522   <ttcol>Reference</ttcol>
3524   <c>http</c>
3525   <c>Hypertext Transfer Protocol</c>
3526   <c><xref target="http.uri"/></c>
3528   <c>https</c>
3529   <c>Hypertext Transfer Protocol Secure</c>
3530   <c><xref target="https.uri"/></c>
3534<section title="Internet Media Type Registration" anchor="">
3536   IANA maintains the registry of Internet media types <xref target="BCP13"/> at
3537   <eref target=""/>.
3540   This document serves as the specification for the Internet media types
3541   "message/http" and "application/http". The following is to be registered with
3542   IANA.
3544<section title="Internet Media Type message/http" anchor="">
3545<iref item="Media Type" subitem="message/http" primary="true"/>
3546<iref item="message/http Media Type" primary="true"/>
3548   The message/http type can be used to enclose a single HTTP request or
3549   response message, provided that it obeys the MIME restrictions for all
3550   "message" types regarding line length and encodings.
3553  <list style="hanging" x:indent="12em">
3554    <t hangText="Type name:">
3555      message
3556    </t>
3557    <t hangText="Subtype name:">
3558      http
3559    </t>
3560    <t hangText="Required parameters:">
3561      N/A
3562    </t>
3563    <t hangText="Optional parameters:">
3564      version, msgtype
3565      <list style="hanging">
3566        <t hangText="version:">
3567          The HTTP-version number of the enclosed message
3568          (e.g., "1.1"). If not present, the version can be
3569          determined from the first line of the body.
3570        </t>
3571        <t hangText="msgtype:">
3572          The message type &mdash; "request" or "response". If not
3573          present, the type can be determined from the first
3574          line of the body.
3575        </t>
3576      </list>
3577    </t>
3578    <t hangText="Encoding considerations:">
3579      only "7bit", "8bit", or "binary" are permitted
3580    </t>
3581    <t hangText="Security considerations:">
3582      see <xref target="security.considerations"/>
3583    </t>
3584    <t hangText="Interoperability considerations:">
3585      N/A
3586    </t>
3587    <t hangText="Published specification:">
3588      This specification (see <xref target=""/>).
3589    </t>
3590    <t hangText="Applications that use this media type:">
3591      N/A
3592    </t>
3593    <t hangText="Fragment identifier considerations:">
3594      N/A
3595    </t>
3596    <t hangText="Additional information:">
3597      <list style="hanging">
3598        <t hangText="Magic number(s):">N/A</t>
3599        <t hangText="Deprecated alias names for this type:">N/A</t>
3600        <t hangText="File extension(s):">N/A</t>
3601        <t hangText="Macintosh file type code(s):">N/A</t>
3602      </list>
3603    </t>
3604    <t hangText="Person and email address to contact for further information:">
3605      See Authors Section.
3606    </t>
3607    <t hangText="Intended usage:">
3608      COMMON
3609    </t>
3610    <t hangText="Restrictions on usage:">
3611      N/A
3612    </t>
3613    <t hangText="Author:">
3614      See Authors Section.
3615    </t>
3616    <t hangText="Change controller:">
3617      IESG
3618    </t>
3619  </list>
3622<section title="Internet Media Type application/http" anchor="">
3623<iref item="Media Type" subitem="application/http" primary="true"/>
3624<iref item="application/http Media Type" primary="true"/>
3626   The application/http type can be used to enclose a pipeline of one or more
3627   HTTP request or response messages (not intermixed).
3630  <list style="hanging" x:indent="12em">
3631    <t hangText="Type name:">
3632      application
3633    </t>
3634    <t hangText="Subtype name:">
3635      http
3636    </t>
3637    <t hangText="Required parameters:">
3638      N/A
3639    </t>
3640    <t hangText="Optional parameters:">
3641      version, msgtype
3642      <list style="hanging">
3643        <t hangText="version:">
3644          The HTTP-version number of the enclosed messages
3645          (e.g., "1.1"). If not present, the version can be
3646          determined from the first line of the body.
3647        </t>
3648        <t hangText="msgtype:">
3649          The message type &mdash; "request" or "response". If not
3650          present, the type can be determined from the first
3651          line of the body.
3652        </t>
3653      </list>
3654    </t>
3655    <t hangText="Encoding considerations:">
3656      HTTP messages enclosed by this type
3657      are in "binary" format; use of an appropriate
3658      Content-Transfer-Encoding is required when
3659      transmitted via E-mail.
3660    </t>
3661    <t hangText="Security considerations:">
3662      see <xref target="security.considerations"/>
3663    </t>
3664    <t hangText="Interoperability considerations:">
3665      N/A
3666    </t>
3667    <t hangText="Published specification:">
3668      This specification (see <xref target=""/>).
3669    </t>
3670    <t hangText="Applications that use this media type:">
3671      N/A
3672    </t>
3673    <t hangText="Fragment identifier considerations:">
3674      N/A
3675    </t>
3676    <t hangText="Additional information:">
3677      <list style="hanging">
3678        <t hangText="Deprecated alias names for this type:">N/A</t>
3679        <t hangText="Magic number(s):">N/A</t>
3680        <t hangText="File extension(s):">N/A</t>
3681        <t hangText="Macintosh file type code(s):">N/A</t>
3682      </list>
3683    </t>
3684    <t hangText="Person and email address to contact for further information:">
3685      See Authors Section.
3686    </t>
3687    <t hangText="Intended usage:">
3688      COMMON
3689    </t>
3690    <t hangText="Restrictions on usage:">
3691      N/A
3692    </t>
3693    <t hangText="Author:">
3694      See Authors Section.
3695    </t>
3696    <t hangText="Change controller:">
3697      IESG
3698    </t>
3699  </list>
3704<section title="Transfer Coding Registry" anchor="transfer.coding.registry">
3706   The HTTP Transfer Coding Registry defines the name space for transfer
3707   coding names. It is maintained at <eref target=""/>.
3710<section title="Procedure" anchor="transfer.coding.registry.procedure">
3712   Registrations &MUST; include the following fields:
3713   <list style="symbols">
3714     <t>Name</t>
3715     <t>Description</t>
3716     <t>Pointer to specification text</t>
3717   </list>
3720   Names of transfer codings &MUST-NOT; overlap with names of content codings
3721   (&content-codings;) unless the encoding transformation is identical, as
3722   is the case for the compression codings defined in
3723   <xref target="compression.codings"/>.
3726   Values to be added to this name space require IETF Review (see
3727   <xref target="RFC5226" x:fmt="of" x:sec="4.1"/>), and &MUST;
3728   conform to the purpose of transfer coding defined in this specification.
3731   Use of program names for the identification of encoding formats
3732   is not desirable and is discouraged for future encodings.
3736<section title="Registration" anchor="transfer.coding.registration">
3738   The HTTP Transfer Coding Registry shall be updated with the registrations
3739   below:
3741<texttable align="left" suppress-title="true" anchor="iana.transfer.coding.registration.table">
3742   <ttcol>Name</ttcol>
3743   <ttcol>Description</ttcol>
3744   <ttcol>Reference</ttcol>
3745   <c>chunked</c>
3746   <c>Transfer in a series of chunks</c>
3747   <c>
3748      <xref target="chunked.encoding"/>
3749   </c>
3750   <c>compress</c>
3751   <c>UNIX "compress" data format <xref target="Welch"/></c>
3752   <c>
3753      <xref target="compress.coding"/>
3754   </c>
3755   <c>deflate</c>
3756   <c>"deflate" compressed data (<xref target="RFC1951"/>) inside
3757   the "zlib" data format (<xref target="RFC1950"/>)
3758   </c>
3759   <c>
3760      <xref target="deflate.coding"/>
3761   </c>
3762   <c>gzip</c>
3763   <c>GZIP file format <xref target="RFC1952"/></c>
3764   <c>
3765      <xref target="gzip.coding"/>
3766   </c>
3767   <c>x-compress</c>
3768   <c>Deprecated (alias for compress)</c>
3769   <c>
3770      <xref target="compress.coding"/>
3771   </c>
3772   <c>x-gzip</c>
3773   <c>Deprecated (alias for gzip)</c>
3774   <c>
3775      <xref target="gzip.coding"/>
3776   </c>
3781<section title="Content Coding Registration" anchor="content.coding.registration">
3783   IANA maintains the registry of HTTP Content Codings at
3784   <eref target=""/>.
3787   The HTTP Content Codings Registry shall be updated with the registrations
3788   below:
3790<texttable align="left" suppress-title="true" anchor="iana.content.coding.registration.table">
3791   <ttcol>Name</ttcol>
3792   <ttcol>Description</ttcol>
3793   <ttcol>Reference</ttcol>
3794   <c>compress</c>
3795   <c>UNIX "compress" data format <xref target="Welch"/></c>
3796   <c>
3797      <xref target="compress.coding"/>
3798   </c>
3799   <c>deflate</c>
3800   <c>"deflate" compressed data (<xref target="RFC1951"/>) inside
3801   the "zlib" data format (<xref target="RFC1950"/>)</c>
3802   <c>
3803      <xref target="deflate.coding"/>
3804   </c>
3805   <c>gzip</c>
3806   <c>GZIP file format <xref target="RFC1952"/></c>
3807   <c>
3808      <xref target="gzip.coding"/>
3809   </c>
3810   <c>x-compress</c>
3811   <c>Deprecated (alias for compress)</c>
3812   <c>
3813      <xref target="compress.coding"/>
3814   </c>
3815   <c>x-gzip</c>
3816   <c>Deprecated (alias for gzip)</c>
3817   <c>
3818      <xref target="gzip.coding"/>
3819   </c>
3823<section title="Upgrade Token Registry" anchor="upgrade.token.registry">
3825   The HTTP Upgrade Token Registry defines the name space for protocol-name
3826   tokens used to identify protocols in the <x:ref>Upgrade</x:ref> header
3827   field. The registry is maintained at <eref target=""/>.
3830<section title="Procedure" anchor="upgrade.token.registry.procedure">  
3832   Each registered protocol name is associated with contact information
3833   and an optional set of specifications that details how the connection
3834   will be processed after it has been upgraded.
3837   Registrations happen on a "First Come First Served" basis (see
3838   <xref target="RFC5226" x:sec="4.1" x:fmt="of"/>) and are subject to the
3839   following rules:
3840  <list style="numbers">
3841    <t>A protocol-name token, once registered, stays registered forever.</t>
3842    <t>The registration &MUST; name a responsible party for the
3843       registration.</t>
3844    <t>The registration &MUST; name a point of contact.</t>
3845    <t>The registration &MAY; name a set of specifications associated with
3846       that token. Such specifications need not be publicly available.</t>
3847    <t>The registration &SHOULD; name a set of expected "protocol-version"
3848       tokens associated with that token at the time of registration.</t>
3849    <t>The responsible party &MAY; change the registration at any time.
3850       The IANA will keep a record of all such changes, and make them
3851       available upon request.</t>
3852    <t>The IESG &MAY; reassign responsibility for a protocol token.
3853       This will normally only be used in the case when a
3854       responsible party cannot be contacted.</t>
3855  </list>
3858   This registration procedure for HTTP Upgrade Tokens replaces that
3859   previously defined in <xref target="RFC2817" x:fmt="of" x:sec="7.2"/>.
3863<section title="Upgrade Token Registration" anchor="upgrade.token.registration">
3865   The "HTTP" entry in the HTTP Upgrade Token Registry shall be updated with
3866   the registration below:
3868<texttable align="left" suppress-title="true">
3869   <ttcol>Value</ttcol>
3870   <ttcol>Description</ttcol>
3871   <ttcol>Expected Version Tokens</ttcol>
3872   <ttcol>Reference</ttcol>
3874   <c>HTTP</c>
3875   <c>Hypertext Transfer Protocol</c>
3876   <c>any DIGIT.DIGIT (e.g, "2.0")</c>
3877   <c><xref target="http.version"/></c>
3880   The responsible party is: "IETF ( - Internet Engineering Task Force".
3887<section title="Security Considerations" anchor="security.considerations">
3889   This section is meant to inform developers, information providers, and
3890   users of known security considerations relevant to HTTP message syntax,
3891   parsing, and routing. Security considerations about HTTP semantics and
3892   payloads are addressed in &semantics;.
3895<section title="DNS-related Attacks" anchor="dns.related.attacks">
3897   HTTP clients rely heavily on the Domain Name Service (DNS), and are thus
3898   generally prone to security attacks based on the deliberate misassociation
3899   of IP addresses and DNS names not protected by DNSSEC. Clients need to be
3900   cautious in assuming the validity of an IP number/DNS name association unless
3901   the response is protected by DNSSEC (<xref target="RFC4033"/>).
3905<section title="Intermediaries and Caching" anchor="attack.intermediaries">
3907   By their very nature, HTTP intermediaries are men-in-the-middle, and
3908   represent an opportunity for man-in-the-middle attacks. Compromise of
3909   the systems on which the intermediaries run can result in serious security
3910   and privacy problems. Intermediaries have access to security-related
3911   information, personal information about individual users and
3912   organizations, and proprietary information belonging to users and
3913   content providers. A compromised intermediary, or an intermediary
3914   implemented or configured without regard to security and privacy
3915   considerations, might be used in the commission of a wide range of
3916   potential attacks.
3919   Intermediaries that contain a shared cache are especially vulnerable
3920   to cache poisoning attacks.
3923   Implementers need to consider the privacy and security
3924   implications of their design and coding decisions, and of the
3925   configuration options they provide to operators (especially the
3926   default configuration).
3929   Users need to be aware that intermediaries are no more trustworthy than
3930   the people who run them; HTTP itself cannot solve this problem.
3934<section title="Buffer Overflows" anchor="attack.protocol.element.size.overflows">
3936   Because HTTP uses mostly textual, character-delimited fields, attackers can
3937   overflow buffers in implementations, and/or perform a Denial of Service
3938   against implementations that accept fields with unlimited lengths.
3941   To promote interoperability, this specification makes specific
3942   recommendations for minimum size limits on request-line
3943   (<xref target="request.line"/>)
3944   and header fields (<xref target="header.fields"/>). These are
3945   minimum recommendations, chosen to be supportable even by implementations
3946   with limited resources; it is expected that most implementations will
3947   choose substantially higher limits.
3950   This specification also provides a way for servers to reject messages that
3951   have request-targets that are too long (&status-414;) or request entities
3952   that are too large (&status-4xx;). Additional status codes related to
3953   capacity limits have been defined by extensions to HTTP
3954   <xref target="RFC6585"/>.
3957   Recipients ought to carefully limit the extent to which they read other
3958   fields, including (but not limited to) request methods, response status
3959   phrases, header field-names, and body chunks, so as to avoid denial of
3960   service attacks without impeding interoperability.
3964<section title="Message Integrity" anchor="message.integrity">
3966   HTTP does not define a specific mechanism for ensuring message integrity,
3967   instead relying on the error-detection ability of underlying transport
3968   protocols and the use of length or chunk-delimited framing to detect
3969   completeness. Additional integrity mechanisms, such as hash functions or
3970   digital signatures applied to the content, can be selectively added to
3971   messages via extensible metadata header fields. Historically, the lack of
3972   a single integrity mechanism has been justified by the informal nature of
3973   most HTTP communication.  However, the prevalence of HTTP as an information
3974   access mechanism has resulted in its increasing use within environments
3975   where verification of message integrity is crucial.
3978   User agents are encouraged to implement configurable means for detecting
3979   and reporting failures of message integrity such that those means can be
3980   enabled within environments for which integrity is necessary. For example,
3981   a browser being used to view medical history or drug interaction
3982   information needs to indicate to the user when such information is detected
3983   by the protocol to be incomplete, expired, or corrupted during transfer.
3984   Such mechanisms might be selectively enabled via user agent extensions or
3985   the presence of message integrity metadata in a response.
3986   At a minimum, user agents ought to provide some indication that allows a
3987   user to distinguish between a complete and incomplete response message
3988   (<xref target="incomplete.messages"/>) when such verification is desired.
3992<section title="Server Log Information" anchor="abuse.of.server.log.information">
3994   A server is in the position to save personal data about a user's requests
3995   over time, which might identify their reading patterns or subjects of
3996   interest.  In particular, log information gathered at an intermediary
3997   often contains a history of user agent interaction, across a multitude
3998   of sites, that can be traced to individual users.
4001   HTTP log information is confidential in nature; its handling is often
4002   constrained by laws and regulations.  Log information needs to be securely
4003   stored and appropriate guidelines followed for its analysis.
4004   Anonymization of personal information within individual entries helps,
4005   but is generally not sufficient to prevent real log traces from being
4006   re-identified based on correlation with other access characteristics.
4007   As such, access traces that are keyed to a specific client are unsafe to
4008   publish even if the key is pseudonymous.
4011   To minimize the risk of theft or accidental publication, log information
4012   ought to be purged of personally identifiable information, including
4013   user identifiers, IP addresses, and user-provided query parameters,
4014   as soon as that information is no longer necessary to support operational
4015   needs for security, auditing, or fraud control.
4020<section title="Acknowledgments" anchor="acks">
4022   This edition of HTTP/1.1 builds on the many contributions that went into
4023   <xref target="RFC1945" format="none">RFC 1945</xref>,
4024   <xref target="RFC2068" format="none">RFC 2068</xref>,
4025   <xref target="RFC2145" format="none">RFC 2145</xref>, and
4026   <xref target="RFC2616" format="none">RFC 2616</xref>, including
4027   substantial contributions made by the previous authors, editors, and
4028   working group chairs: Tim Berners-Lee, Ari Luotonen, Roy T. Fielding,
4029   Henrik Frystyk Nielsen, Jim Gettys, Jeffrey C. Mogul, Larry Masinter,
4030   and Paul J. Leach. Mark Nottingham oversaw this effort as working group chair.
4033   Since 1999, the following contributors have helped improve the HTTP
4034   specification by reporting bugs, asking smart questions, drafting or
4035   reviewing text, and evaluating open issues:
4037<?BEGININC acks ?>
4038<t>Adam Barth,
4039Adam Roach,
4040Addison Phillips,
4041Adrian Chadd,
4042Adrian Cole,
4043Adrien W. de Croy,
4044Alan Ford,
4045Alan Ruttenberg,
4046Albert Lunde,
4047Alek Storm,
4048Alex Rousskov,
4049Alexandre Morgaut,
4050Alexey Melnikov,
4051Alisha Smith,
4052Amichai Rothman,
4053Amit Klein,
4054Amos Jeffries,
4055Andreas Maier,
4056Andreas Petersson,
4057Andrei Popov,
4058Anil Sharma,
4059Anne van Kesteren,
4060Anthony Bryan,
4061Asbjorn Ulsberg,
4062Ashok Kumar,
4063Balachander Krishnamurthy,
4064Barry Leiba,
4065Ben Laurie,
4066Benjamin Carlyle,
4067Benjamin Niven-Jenkins,
4068Benoit Claise,
4069Bil Corry,
4070Bill Burke,
4071Bjoern Hoehrmann,
4072Bob Scheifler,
4073Boris Zbarsky,
4074Brett Slatkin,
4075Brian Kell,
4076Brian McBarron,
4077Brian Pane,
4078Brian Raymor,
4079Brian Smith,
4080Bruce Perens,
4081Bryce Nesbitt,
4082Cameron Heavon-Jones,
4083Carl Kugler,
4084Carsten Bormann,
4085Charles Fry,
4086Chris Burdess,
4087Chris Newman,
4088Christian Huitema,
4089Cyrus Daboo,
4090Dale Robert Anderson,
4091Dan Wing,
4092Dan Winship,
4093Daniel Stenberg,
4094Darrel Miller,
4095Dave Cridland,
4096Dave Crocker,
4097Dave Kristol,
4098Dave Thaler,
4099David Booth,
4100David Singer,
4101David W. Morris,
4102Diwakar Shetty,
4103Dmitry Kurochkin,
4104Drummond Reed,
4105Duane Wessels,
4106Edward Lee,
4107Eitan Adler,
4108Eliot Lear,
4109Emile Stephan,
4110Eran Hammer-Lahav,
4111Eric D. Williams,
4112Eric J. Bowman,
4113Eric Lawrence,
4114Eric Rescorla,
4115Erik Aronesty,
4116EungJun Yi,
4117Evan Prodromou,
4118Felix Geisendoerfer,
4119Florian Weimer,
4120Frank Ellermann,
4121Fred Akalin,
4122Fred Bohle,
4123Frederic Kayser,
4124Gabor Molnar,
4125Gabriel Montenegro,
4126Geoffrey Sneddon,
4127Gervase Markham,
4128Gili Tzabari,
4129Grahame Grieve,
4130Greg Slepak,
4131Greg Wilkins,
4132Grzegorz Calkowski,
4133Harald Tveit Alvestrand,
4134Harry Halpin,
4135Helge Hess,
4136Henrik Nordstrom,
4137Henry S. Thompson,
4138Henry Story,
4139Herbert van de Sompel,
4140Herve Ruellan,
4141Howard Melman,
4142Hugo Haas,
4143Ian Fette,
4144Ian Hickson,
4145Ido Safruti,
4146Ilari Liusvaara,
4147Ilya Grigorik,
4148Ingo Struck,
4149J. Ross Nicoll,
4150James Cloos,
4151James H. Manger,
4152James Lacey,
4153James M. Snell,
4154Jamie Lokier,
4155Jan Algermissen,
4156Jari Arkko,
4157Jeff Hodges (who came up with the term 'effective Request-URI'),
4158Jeff Pinner,
4159Jeff Walden,
4160Jim Luther,
4161Jitu Padhye,
4162Joe D. Williams,
4163Joe Gregorio,
4164Joe Orton,
4165Joel Jaeggli,
4166John C. Klensin,
4167John C. Mallery,
4168John Cowan,
4169John Kemp,
4170John Panzer,
4171John Schneider,
4172John Stracke,
4173John Sullivan,
4174Jonas Sicking,
4175Jonathan A. Rees,
4176Jonathan Billington,
4177Jonathan Moore,
4178Jonathan Silvera,
4179Jordi Ros,
4180Joris Dobbelsteen,
4181Josh Cohen,
4182Julien Pierre,
4183Jungshik Shin,
4184Justin Chapweske,
4185Justin Erenkrantz,
4186Justin James,
4187Kalvinder Singh,
4188Karl Dubost,
4189Kathleen Moriarty,
4190Keith Hoffman,
4191Keith Moore,
4192Ken Murchison,
4193Koen Holtman,
4194Konstantin Voronkov,
4195Kris Zyp,
4196Leif Hedstrom,
4197Lionel Morand,
4198Lisa Dusseault,
4199Maciej Stachowiak,
4200Manu Sporny,
4201Marc Schneider,
4202Marc Slemko,
4203Mark Baker,
4204Mark Pauley,
4205Mark Watson,
4206Markus Isomaki,
4207Markus Lanthaler,
4208Martin J. Duerst,
4209Martin Musatov,
4210Martin Nilsson,
4211Martin Thomson,
4212Matt Lynch,
4213Matthew Cox,
4214Matthew Kerwin,
4215Max Clark,
4216Menachem Dodge,
4217Meral Shirazipour,
4218Michael Burrows,
4219Michael Hausenblas,
4220Michael Scharf,
4221Michael Sweet,
4222Michael Tuexen,
4223Michael Welzl,
4224Mike Amundsen,
4225Mike Belshe,
4226Mike Bishop,
4227Mike Kelly,
4228Mike Schinkel,
4229Miles Sabin,
4230Murray S. Kucherawy,
4231Mykyta Yevstifeyev,
4232Nathan Rixham,
4233Nicholas Shanks,
4234Nico Williams,
4235Nicolas Alvarez,
4236Nicolas Mailhot,
4237Noah Slater,
4238Osama Mazahir,
4239Pablo Castro,
4240Pat Hayes,
4241Patrick R. McManus,
4242Paul E. Jones,
4243Paul Hoffman,
4244Paul Marquess,
4245Pete Resnick,
4246Peter Lepeska,
4247Peter Occil,
4248Peter Saint-Andre,
4249Peter Watkins,
4250Phil Archer,
4251Phil Hunt,
4252Philippe Mougin,
4253Phillip Hallam-Baker,
4254Piotr Dobrogost,
4255Poul-Henning Kamp,
4256Preethi Natarajan,
4257Rajeev Bector,
4258Ray Polk,
4259Reto Bachmann-Gmuer,
4260Richard Barnes,
4261Richard Cyganiak,
4262Rob Trace,
4263Robby Simpson,
4264Robert Brewer,
4265Robert Collins,
4266Robert Mattson,
4267Robert O'Callahan,
4268Robert Olofsson,
4269Robert Sayre,
4270Robert Siemer,
4271Robert de Wilde,
4272Roberto Javier Godoy,
4273Roberto Peon,
4274Roland Zink,
4275Ronny Widjaja,
4276Ryan Hamilton,
4277S. Mike Dierken,
4278Salvatore Loreto,
4279Sam Johnston,
4280Sam Pullara,
4281Sam Ruby,
4282Saurabh Kulkarni,
4283Scott Lawrence (who maintained the original issues list),
4284Sean B. Palmer,
4285Sean Turner,
4286Sebastien Barnoud,
4287Shane McCarron,
4288Shigeki Ohtsu,
4289Simon Yarde,
4290Stefan Eissing,
4291Stefan Tilkov,
4292Stefanos Harhalakis,
4293Stephane Bortzmeyer,
4294Stephen Farrell,
4295Stephen Kent,
4296Stephen Ludin,
4297Stuart Williams,
4298Subbu Allamaraju,
4299Subramanian Moonesamy,
4300Susan Hares,
4301Sylvain Hellegouarch,
4302Tapan Divekar,
4303Tatsuhiro Tsujikawa,
4304Tatsuya Hayashi,
4305Ted Hardie,
4306Ted Lemon,
4307Thomas Broyer,
4308Thomas Fossati,
4309Thomas Maslen,
4310Thomas Nadeau,
4311Thomas Nordin,
4312Thomas Roessler,
4313Tim Bray,
4314Tim Morgan,
4315Tim Olsen,
4316Tom Zhou,
4317Travis Snoozy,
4318Tyler Close,
4319Vincent Murphy,
4320Wenbo Zhu,
4321Werner Baumann,
4322Wilbur Streett,
4323Wilfredo Sanchez Vega,
4324William A. Rowe Jr.,
4325William Chan,
4326Willy Tarreau,
4327Xiaoshu Wang,
4328Yaron Goland,
4329Yngve Nysaeter Pettersen,
4330Yoav Nir,
4331Yogesh Bang,
4332Yuchung Cheng,
4333Yutaka Oiwa,
4334Yves Lafon (long-time member of the editor team),
4335Zed A. Shaw, and
4336Zhong Yu.
4338<?ENDINC acks ?>
4340   See <xref target="RFC2616" x:fmt="of" x:sec="16"/> for additional
4341   acknowledgements from prior revisions.
4348<references title="Normative References">
4350<reference anchor="Part2">
4351  <front>
4352    <title>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</title>
4353    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
4354      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
4355      <address><email></email></address>
4356    </author>
4357    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
4358      <organization abbrev="greenbytes">greenbytes GmbH</organization>
4359      <address><email></email></address>
4360    </author>
4361    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
4362  </front>
4363  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p2-semantics-&ID-VERSION;"/>
4364  <x:source href="p2-semantics.xml" basename="p2-semantics">
4365    <x:defines>1xx (Informational)</x:defines>
4366    <x:defines>1xx</x:defines>
4367    <x:defines>100 (Continue)</x:defines>
4368    <x:defines>101 (Switching Protocols)</x:defines>
4369    <x:defines>2xx (Successful)</x:defines>
4370    <x:defines>2xx</x:defines>
4371    <x:defines>200 (OK)</x:defines>
4372    <x:defines>203 (Non-Authoritative Information)</x:defines>
4373    <x:defines>204 (No Content)</x:defines>
4374    <x:defines>3xx (Redirection)</x:defines>
4375    <x:defines>3xx</x:defines>
4376    <x:defines>301 (Moved Permanently)</x:defines>
4377    <x:defines>4xx (Client Error)</x:defines>
4378    <x:defines>4xx</x:defines>
4379    <x:defines>400 (Bad Request)</x:defines>
4380    <x:defines>411 (Length Required)</x:defines>
4381    <x:defines>414 (URI Too Long)</x:defines>
4382    <x:defines>417 (Expectation Failed)</x:defines>
4383    <x:defines>426 (Upgrade Required)</x:defines>
4384    <x:defines>501 (Not Implemented)</x:defines>
4385    <x:defines>502 (Bad Gateway)</x:defines>
4386    <x:defines>505 (HTTP Version Not Supported)</x:defines>
4387    <x:defines>Accept-Encoding</x:defines>
4388    <x:defines>Allow</x:defines>
4389    <x:defines>Content-Encoding</x:defines>
4390    <x:defines>Content-Location</x:defines>
4391    <x:defines>Content-Type</x:defines>
4392    <x:defines>Date</x:defines>
4393    <x:defines>Expect</x:defines>
4394    <x:defines>Location</x:defines>
4395    <x:defines>Server</x:defines>
4396    <x:defines>User-Agent</x:defines>
4397  </x:source>
4400<reference anchor="Part4">
4401  <front>
4402    <title>Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests</title>
4403    <author fullname="Roy T. Fielding" initials="R." role="editor" surname="Fielding">
4404      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
4405      <address><email></email></address>
4406    </author>
4407    <author fullname="Julian F. Reschke" initials="J. F." role="editor" surname="Reschke">
4408      <organization abbrev="greenbytes">greenbytes GmbH</organization>
4409      <address><email></email></address>
4410    </author>
4411    <date month="&ID-MONTH;" year="&ID-YEAR;" />
4412  </front>
4413  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p4-conditional-&ID-VERSION;" />
4414  <x:source basename="p4-conditional" href="p4-conditional.xml">
4415    <x:defines>304 (Not Modified)</x:defines>
4416    <x:defines>ETag</x:defines>
4417    <x:defines>Last-Modified</x:defines>
4418  </x:source>
4421<reference anchor="Part5">
4422  <front>
4423    <title>Hypertext Transfer Protocol (HTTP/1.1): Range Requests</title>
4424    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
4425      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
4426      <address><email></email></address>
4427    </author>
4428    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
4429      <organization abbrev="W3C">World Wide Web Consortium</organization>
4430      <address><email></email></address>
4431    </author>
4432    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
4433      <organization abbrev="greenbytes">greenbytes GmbH</organization>
4434      <address><email></email></address>
4435    </author>
4436    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
4437  </front>
4438  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p5-range-&ID-VERSION;"/>
4439  <x:source href="p5-range.xml" basename="p5-range">
4440    <x:defines>Content-Range</x:defines>
4441  </x:source>
4444<reference anchor="Part6">
4445  <front>
4446    <title>Hypertext Transfer Protocol (HTTP/1.1): Caching</title>
4447    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
4448      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
4449      <address><email></email></address>
4450    </author>
4451    <author initials="M." surname="Nottingham" fullname="Mark Nottingham" role="editor">
4452      <organization>Akamai</organization>
4453      <address><email></email></address>
4454    </author>
4455    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
4456      <organization abbrev="greenbytes">greenbytes GmbH</organization>
4457      <address><email></email></address>
4458    </author>
4459    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
4460  </front>
4461  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p6-cache-&ID-VERSION;"/>
4462  <x:source href="p6-cache.xml" basename="p6-cache">
4463    <x:defines>Cache-Control</x:defines>
4464    <x:defines>Expires</x:defines>
4465    <x:defines>Warning</x:defines>
4466  </x:source>
4469<reference anchor="Part7">
4470  <front>
4471    <title>Hypertext Transfer Protocol (HTTP/1.1): Authentication</title>
4472    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
4473      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
4474      <address><email></email></address>
4475    </author>
4476    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
4477      <organization abbrev="greenbytes">greenbytes GmbH</organization>
4478      <address><email></email></address>
4479    </author>
4480    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
4481  </front>
4482  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p7-auth-&ID-VERSION;"/>
4483  <x:source href="p7-auth.xml" basename="p7-auth">
4484    <x:defines>Proxy-Authenticate</x:defines>
4485    <x:defines>Proxy-Authorization</x:defines>
4486  </x:source>
4489<reference anchor="RFC5234">
4490  <front>
4491    <title abbrev="ABNF for Syntax Specifications">Augmented BNF for Syntax Specifications: ABNF</title>
4492    <author initials="D." surname="Crocker" fullname="Dave Crocker" role="editor">
4493      <organization>Brandenburg InternetWorking</organization>
4494      <address>
4495        <email></email>
4496      </address> 
4497    </author>
4498    <author initials="P." surname="Overell" fullname="Paul Overell">
4499      <organization>THUS plc.</organization>
4500      <address>
4501        <email></email>
4502      </address>
4503    </author>
4504    <date month="January" year="2008"/>
4505  </front>
4506  <seriesInfo name="STD" value="68"/>
4507  <seriesInfo name="RFC" value="5234"/>
4510<reference anchor="RFC2119">
4511  <front>
4512    <title>Key words for use in RFCs to Indicate Requirement Levels</title>
4513    <author initials="S." surname="Bradner" fullname="Scott Bradner">
4514      <organization>Harvard University</organization>
4515      <address><email></email></address>
4516    </author>
4517    <date month="March" year="1997"/>
4518  </front>
4519  <seriesInfo name="BCP" value="14"/>
4520  <seriesInfo name="RFC" value="2119"/>
4523<reference anchor="RFC3986">
4524 <front>
4525  <title abbrev='URI Generic Syntax'>Uniform Resource Identifier (URI): Generic Syntax</title>
4526  <author initials='T.' surname='Berners-Lee' fullname='Tim Berners-Lee'>
4527    <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
4528    <address>
4529       <email></email>
4530       <uri></uri>
4531    </address>
4532  </author>
4533  <author initials='R.' surname='Fielding' fullname='Roy T. Fielding'>
4534    <organization abbrev="Day Software">Day Software</organization>
4535    <address>
4536      <email></email>
4537      <uri></uri>
4538    </address>
4539  </author>
4540  <author initials='L.' surname='Masinter' fullname='Larry Masinter'>
4541    <organization abbrev="Adobe Systems">Adobe Systems Incorporated</organization>
4542    <address>
4543      <email></email>
4544      <uri></uri>
4545    </address>
4546  </author>
4547  <date month='January' year='2005'></date>
4548 </front>
4549 <seriesInfo name="STD" value="66"/>
4550 <seriesInfo name="RFC" value="3986"/>
4553<reference anchor="RFC0793">
4554  <front>
4555    <title>Transmission Control Protocol</title>
4556    <author initials='J.' surname='Postel' fullname='Jon Postel'>
4557      <organization>University of Southern California (USC)/Information Sciences Institute</organization>
4558    </author>
4559    <date year='1981' month='September' />
4560  </front>
4561  <seriesInfo name='STD' value='7' />
4562  <seriesInfo name='RFC' value='793' />
4565<reference anchor="USASCII">
4566  <front>
4567    <title>Coded Character Set -- 7-bit American Standard Code for Information Interchange</title>
4568    <author>
4569      <organization>American National Standards Institute</organization>
4570    </author>
4571    <date year="1986"/>
4572  </front>
4573  <seriesInfo name="ANSI" value="X3.4"/>
4576<reference anchor="RFC1950">
4577  <front>
4578    <title>ZLIB Compressed Data Format Specification version 3.3</title>
4579    <author initials="L.P." surname="Deutsch" fullname="L. Peter Deutsch">
4580      <organization>Aladdin Enterprises</organization>
4581      <address><email></email></address>
4582    </author>
4583    <author initials="J-L." surname="Gailly" fullname="Jean-Loup Gailly"/>
4584    <date month="May" year="1996"/>
4585  </front>
4586  <seriesInfo name="RFC" value="1950"/>
4587  <!--<annotation>
4588    RFC 1950 is an Informational RFC, thus it might be less stable than
4589    this specification. On the other hand, this downward reference was
4590    present since the publication of <xref target="RFC2068" x:fmt="none">RFC 2068</xref> in 1997,
4591    therefore it is unlikely to cause problems in practice. See also
4592    <xref target="BCP97"/>.
4593  </annotation>-->
4596<reference anchor="RFC1951">
4597  <front>
4598    <title>DEFLATE Compressed Data Format Specification version 1.3</title>
4599    <author initials="P." surname="Deutsch" fullname="L. Peter Deutsch">
4600      <organization>Aladdin Enterprises</organization>
4601      <address><email></email></address>
4602    </author>
4603    <date month="May" year="1996"/>
4604  </front>
4605  <seriesInfo name="RFC" value="1951"/>
4606  <!--<annotation>
4607    RFC 1951 is an Informational RFC, thus it might be less stable than
4608    this specification. On the other hand, this downward reference was
4609    present since the publication of <xref target="RFC2068" x:fmt="none">RFC 2068</xref> in 1997,
4610    therefore it is unlikely to cause problems in practice. See also
4611    <xref target="BCP97"/>.
4612  </annotation>-->
4615<reference anchor="RFC1952">
4616  <front>
4617    <title>GZIP file format specification version 4.3</title>
4618    <author initials="P." surname="Deutsch" fullname="L. Peter Deutsch">
4619      <organization>Aladdin Enterprises</organization>
4620      <address><email></email></address>
4621    </author>
4622    <author initials="J-L." surname="Gailly" fullname="Jean-Loup Gailly">
4623      <address><email></email></address>
4624    </author>
4625    <author initials="M." surname="Adler" fullname="Mark Adler">
4626      <address><email></email></address>
4627    </author>
4628    <author initials="L.P." surname="Deutsch" fullname="L. Peter Deutsch">
4629      <address><email></email></address>
4630    </author>
4631    <author initials="G." surname="Randers-Pehrson" fullname="Glenn Randers-Pehrson">
4632      <address><email></email></address>
4633    </author>
4634    <date month="May" year="1996"/>
4635  </front>
4636  <seriesInfo name="RFC" value="1952"/>
4637  <!--<annotation>
4638    RFC 1952 is an Informational RFC, thus it might be less stable than
4639    this specification. On the other hand, this downward reference was
4640    present since the publication of <xref target="RFC2068" x:fmt="none">RFC 2068</xref> in 1997,
4641    therefore it is unlikely to cause problems in practice. See also
4642    <xref target="BCP97"/>.
4643  </annotation>-->
4646<reference anchor="Welch">
4647  <front>
4648    <title>A Technique for High Performance Data Compression</title>
4649    <author initials="T.A." surname="Welch" fullname="Terry A. Welch"/>
4650    <date month="June" year="1984"/>
4651  </front>
4652  <seriesInfo name="IEEE Computer" value="17(6)"/>
4657<references title="Informative References">
4659<reference anchor="ISO-8859-1">
4660  <front>
4661    <title>
4662     Information technology -- 8-bit single-byte coded graphic character sets -- Part 1: Latin alphabet No. 1
4663    </title>
4664    <author>
4665      <organization>International Organization for Standardization</organization>
4666    </author>
4667    <date year="1998"/>
4668  </front>
4669  <seriesInfo name="ISO/IEC" value="8859-1:1998"/>
4672<reference anchor='RFC1919'>
4673  <front>
4674    <title>Classical versus Transparent IP Proxies</title>
4675    <author initials='M.' surname='Chatel' fullname='Marc Chatel'>
4676      <address><email></email></address>
4677    </author>
4678    <date year='1996' month='March' />
4679  </front>
4680  <seriesInfo name='RFC' value='1919' />
4683<reference anchor="RFC1945">
4684  <front>
4685    <title abbrev="HTTP/1.0">Hypertext Transfer Protocol -- HTTP/1.0</title>
4686    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
4687      <organization>MIT, Laboratory for Computer Science</organization>
4688      <address><email></email></address>
4689    </author>
4690    <author initials="R.T." surname="Fielding" fullname="Roy T. Fielding">
4691      <organization>University of California, Irvine, Department of Information and Computer Science</organization>
4692      <address><email></email></address>
4693    </author>
4694    <author initials="H.F." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
4695      <organization>W3 Consortium, MIT Laboratory for Computer Science</organization>
4696      <address><email></email></address>
4697    </author>
4698    <date month="May" year="1996"/>
4699  </front>
4700  <seriesInfo name="RFC" value="1945"/>
4703<reference anchor="RFC2045">
4704  <front>
4705    <title abbrev="Internet Message Bodies">Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies</title>
4706    <author initials="N." surname="Freed" fullname="Ned Freed">
4707      <organization>Innosoft International, Inc.</organization>
4708      <address><email></email></address>
4709    </author>
4710    <author initials="N.S." surname="Borenstein" fullname="Nathaniel S. Borenstein">
4711      <organization>First Virtual Holdings</organization>
4712      <address><email></email></address>
4713    </author>
4714    <date month="November" year="1996"/>
4715  </front>
4716  <seriesInfo name="RFC" value="2045"/>
4719<reference anchor="RFC2047">
4720  <front>
4721    <title abbrev="Message Header Extensions">MIME (Multipurpose Internet Mail Extensions) Part Three: Message Header Extensions for Non-ASCII Text</title>
4722    <author initials="K." surname="Moore" fullname="Keith Moore">
4723      <organization>University of Tennessee</organization>
4724      <address><email></email></address>
4725    </author>
4726    <date month="November" year="1996"/>
4727  </front>
4728  <seriesInfo name="RFC" value="2047"/>
4731<reference anchor="RFC2068">
4732  <front>
4733    <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
4734    <author initials="R." surname="Fielding" fullname="Roy T. Fielding">
4735      <organization>University of California, Irvine, Department of Information and Computer Science</organization>
4736      <address><email></email></address>
4737    </author>
4738    <author initials="J." surname="Gettys" fullname="Jim Gettys">
4739      <organization>MIT Laboratory for Computer Science</organization>
4740      <address><email></email></address>
4741    </author>
4742    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
4743      <organization>Digital Equipment Corporation, Western Research Laboratory</organization>
4744      <address><email></email></address>
4745    </author>
4746    <author initials="H." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
4747      <organization>MIT Laboratory for Computer Science</organization>
4748      <address><email></email></address>
4749    </author>
4750    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
4751      <organization>MIT Laboratory for Computer Science</organization>
4752      <address><email></email></address>
4753    </author>
4754    <date month="January" year="1997"/>
4755  </front>
4756  <seriesInfo name="RFC" value="2068"/>
4759<reference anchor="RFC2145">
4760  <front>
4761    <title abbrev="HTTP Version Numbers">Use and Interpretation of HTTP Version Numbers</title>
4762    <author initials="J.C." surname="Mogul" fullname="Jeffrey C. Mogul">
4763      <organization>Western Research Laboratory</organization>
4764      <address><email></email></address>
4765    </author>
4766    <author initials="R.T." surname="Fielding" fullname="Roy T. Fielding">
4767      <organization>Department of Information and Computer Science</organization>
4768      <address><email></email></address>
4769    </author>
4770    <author initials="J." surname="Gettys" fullname="Jim Gettys">
4771      <organization>MIT Laboratory for Computer Science</organization>
4772      <address><email></email></address>
4773    </author>
4774    <author initials="H.F." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
4775      <organization>W3 Consortium</organization>
4776      <address><email></email></address>
4777    </author>
4778    <date month="May" year="1997"/>
4779  </front>
4780  <seriesInfo name="RFC" value="2145"/>
4783<reference anchor="RFC2616">
4784  <front>
4785    <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
4786    <author initials="R." surname="Fielding" fullname="R. Fielding">
4787      <organization>University of California, Irvine</organization>
4788      <address><email></email></address>
4789    </author>
4790    <author initials="J." surname="Gettys" fullname="J. Gettys">
4791      <organization>W3C</organization>
4792      <address><email></email></address>
4793    </author>
4794    <author initials="J." surname="Mogul" fullname="J. Mogul">
4795      <organization>Compaq Computer Corporation</organization>
4796      <address><email></email></address>
4797    </author>
4798    <author initials="H." surname="Frystyk" fullname="H. Frystyk">
4799      <organization>MIT Laboratory for Computer Science</organization>
4800      <address><email></email></address>
4801    </author>
4802    <author initials="L." surname="Masinter" fullname="L. Masinter">
4803      <organization>Xerox Corporation</organization>
4804      <address><email></email></address>
4805    </author>
4806    <author initials="P." surname="Leach" fullname="P. Leach">
4807      <organization>Microsoft Corporation</organization>
4808      <address><email></email></address>
4809    </author>
4810    <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
4811      <organization>W3C</organization>
4812      <address><email></email></address>
4813    </author>
4814    <date month="June" year="1999"/>
4815  </front>
4816  <seriesInfo name="RFC" value="2616"/>
4819<reference anchor='RFC2817'>
4820  <front>
4821    <title>Upgrading to TLS Within HTTP/1.1</title>
4822    <author initials='R.' surname='Khare' fullname='R. Khare'>
4823      <organization>4K Associates / UC Irvine</organization>
4824      <address><email></email></address>
4825    </author>
4826    <author initials='S.' surname='Lawrence' fullname='S. Lawrence'>
4827      <organization>Agranat Systems, Inc.</organization>
4828      <address><email></email></address>
4829    </author>
4830    <date year='2000' month='May' />
4831  </front>
4832  <seriesInfo name='RFC' value='2817' />
4835<reference anchor='RFC2818'>
4836  <front>
4837    <title>HTTP Over TLS</title>
4838    <author initials='E.' surname='Rescorla' fullname='Eric Rescorla'>
4839      <organization>RTFM, Inc.</organization>
4840      <address><email></email></address>
4841    </author>
4842    <date year='2000' month='May' />
4843  </front>
4844  <seriesInfo name='RFC' value='2818' />
4847<reference anchor='RFC3040'>
4848  <front>
4849    <title>Internet Web Replication and Caching Taxonomy</title>
4850    <author initials='I.' surname='Cooper' fullname='I. Cooper'>
4851      <organization>Equinix, Inc.</organization>
4852    </author>
4853    <author initials='I.' surname='Melve' fullname='I. Melve'>
4854      <organization>UNINETT</organization>
4855    </author>
4856    <author initials='G.' surname='Tomlinson' fullname='G. Tomlinson'>
4857      <organization>CacheFlow Inc.</organization>
4858    </author>
4859    <date year='2001' month='January' />
4860  </front>
4861  <seriesInfo name='RFC' value='3040' />
4864<reference anchor='BCP90'>
4865  <front>
4866    <title>Registration Procedures for Message Header Fields</title>
4867    <author initials='G.' surname='Klyne' fullname='G. Klyne'>
4868      <organization>Nine by Nine</organization>
4869      <address><email></email></address>
4870    </author>
4871    <author initials='M.' surname='Nottingham' fullname='M. Nottingham'>
4872      <organization>BEA Systems</organization>
4873      <address><email></email></address>
4874    </author>
4875    <author initials='J.' surname='Mogul' fullname='J. Mogul'>
4876      <organization>HP Labs</organization>
4877      <address><email></email></address>
4878    </author>
4879    <date year='2004' month='September' />
4880  </front>
4881  <seriesInfo name='BCP' value='90' />
4882  <seriesInfo name='RFC' value='3864' />
4885<reference anchor='RFC4033'>
4886  <front>
4887    <title>DNS Security Introduction and Requirements</title>
4888    <author initials='R.' surname='Arends' fullname='R. Arends'/>
4889    <author initials='R.' surname='Austein' fullname='R. Austein'/>
4890    <author initials='M.' surname='Larson' fullname='M. Larson'/>
4891    <author initials='D.' surname='Massey' fullname='D. Massey'/>
4892    <author initials='S.' surname='Rose' fullname='S. Rose'/>
4893    <date year='2005' month='March' />
4894  </front>
4895  <seriesInfo name='RFC' value='4033' />
4898<reference anchor="BCP13">
4899  <front>
4900    <title>Media Type Specifications and Registration Procedures</title>
4901    <author initials="N." surname="Freed" fullname="Ned Freed">
4902      <organization>Oracle</organization>
4903      <address>
4904        <email></email>
4905      </address>
4906    </author>
4907    <author initials="J." surname="Klensin" fullname="John C. Klensin">
4908      <address>
4909        <email></email>
4910      </address>
4911    </author>
4912    <author initials="T." surname="Hansen" fullname="Tony Hansen">
4913      <organization>AT&amp;T Laboratories</organization>
4914      <address>
4915        <email></email>
4916      </address>
4917    </author>
4918    <date year="2013" month="January"/>
4919  </front>
4920  <seriesInfo name="BCP" value="13"/>
4921  <seriesInfo name="RFC" value="6838"/>
4924<reference anchor='BCP115'>
4925  <front>
4926    <title>Guidelines and Registration Procedures for New URI Schemes</title>
4927    <author initials='T.' surname='Hansen' fullname='T. Hansen'>
4928      <organization>AT&amp;T Laboratories</organization>
4929      <address>
4930        <email></email>
4931      </address>
4932    </author>
4933    <author initials='T.' surname='Hardie' fullname='T. Hardie'>
4934      <organization>Qualcomm, Inc.</organization>
4935      <address>
4936        <email></email>
4937      </address>
4938    </author>
4939    <author initials='L.' surname='Masinter' fullname='L. Masinter'>
4940      <organization>Adobe Systems</organization>
4941      <address>
4942        <email></email>
4943      </address>
4944    </author>
4945    <date year='2006' month='February' />
4946  </front>
4947  <seriesInfo name='BCP' value='115' />
4948  <seriesInfo name='RFC' value='4395' />
4951<reference anchor='RFC4559'>
4952  <front>
4953    <title>SPNEGO-based Kerberos and NTLM HTTP Authentication in Microsoft Windows</title>
4954    <author initials='K.' surname='Jaganathan' fullname='K. Jaganathan'/>
4955    <author initials='L.' surname='Zhu' fullname='L. Zhu'/>
4956    <author initials='J.' surname='Brezak' fullname='J. Brezak'/>
4957    <date year='2006' month='June' />
4958  </front>
4959  <seriesInfo name='RFC' value='4559' />
4962<reference anchor='RFC5226'>
4963  <front>
4964    <title>Guidelines for Writing an IANA Considerations Section in RFCs</title>
4965    <author initials='T.' surname='Narten' fullname='T. Narten'>
4966      <organization>IBM</organization>
4967      <address><email></email></address>
4968    </author>
4969    <author initials='H.' surname='Alvestrand' fullname='H. Alvestrand'>
4970      <organization>Google</organization>
4971      <address><email></email></address>
4972    </author>
4973    <date year='2008' month='May' />
4974  </front>
4975  <seriesInfo name='BCP' value='26' />
4976  <seriesInfo name='RFC' value='5226' />
4979<reference anchor='RFC5246'>
4980   <front>
4981      <title>The Transport Layer Security (TLS) Protocol Version 1.2</title>
4982      <author initials='T.' surname='Dierks' fullname='T. Dierks'/>
4983      <author initials='E.' surname='Rescorla' fullname='E. Rescorla'>
4984         <organization>RTFM, Inc.</organization>
4985      </author>
4986      <date year='2008' month='August' />
4987   </front>
4988   <seriesInfo name='RFC' value='5246' />
4991<reference anchor="RFC5322">
4992  <front>
4993    <title>Internet Message Format</title>
4994    <author initials="P." surname="Resnick" fullname="P. Resnick">
4995      <organization>Qualcomm Incorporated</organization>
4996    </author>
4997    <date year="2008" month="October"/>
4998  </front>
4999  <seriesInfo name="RFC" value="5322"/>
5002<reference anchor="RFC6265">
5003  <front>
5004    <title>HTTP State Management Mechanism</title>
5005    <author initials="A." surname="Barth" fullname="Adam Barth">
5006      <organization abbrev="U.C. Berkeley">
5007        University of California, Berkeley
5008      </organization>
5009      <address><email></email></address>
5010    </author>
5011    <date year="2011" month="April" />
5012  </front>
5013  <seriesInfo name="RFC" value="6265"/>
5016<reference anchor='RFC6585'>
5017  <front>
5018    <title>Additional HTTP Status Codes</title>
5019    <author initials='M.' surname='Nottingham' fullname='M. Nottingham'>
5020      <organization>Rackspace</organization>
5021    </author>
5022    <author initials='R.' surname='Fielding' fullname='R. Fielding'>
5023      <organization>Adobe</organization>
5024    </author>
5025    <date year='2012' month='April' />
5026   </front>
5027   <seriesInfo name='RFC' value='6585' />
5030<!--<reference anchor='BCP97'>
5031  <front>
5032    <title>Handling Normative References to Standards-Track Documents</title>
5033    <author initials='J.' surname='Klensin' fullname='J. Klensin'>
5034      <address>
5035        <email></email>
5036      </address>
5037    </author>
5038    <author initials='S.' surname='Hartman' fullname='S. Hartman'>
5039      <organization>MIT</organization>
5040      <address>
5041        <email></email>
5042      </address>
5043    </author>
5044    <date year='2007' month='June' />
5045  </front>
5046  <seriesInfo name='BCP' value='97' />
5047  <seriesInfo name='RFC' value='4897' />
5050<reference anchor="Kri2001" target="">
5051  <front>
5052    <title>HTTP Cookies: Standards, Privacy, and Politics</title>
5053    <author initials="D." surname="Kristol" fullname="David M. Kristol"/>
5054    <date year="2001" month="November"/>
5055  </front>
5056  <seriesInfo name="ACM Transactions on Internet Technology" value="1(2)"/>
5062<section title="HTTP Version History" anchor="compatibility">
5064   HTTP has been in use since 1990. The first version, later referred to as
5065   HTTP/0.9, was a simple protocol for hypertext data transfer across the
5066   Internet, using only a single request method (GET) and no metadata.
5067   HTTP/1.0, as defined by <xref target="RFC1945"/>, added a range of request
5068   methods and MIME-like messaging, allowing for metadata to be transferred
5069   and modifiers placed on the request/response semantics. However,
5070   HTTP/1.0 did not sufficiently take into consideration the effects of
5071   hierarchical proxies, caching, the need for persistent connections, or
5072   name-based virtual hosts. The proliferation of incompletely-implemented
5073   applications calling themselves "HTTP/1.0" further necessitated a
5074   protocol version change in order for two communicating applications
5075   to determine each other's true capabilities.
5078   HTTP/1.1 remains compatible with HTTP/1.0 by including more stringent
5079   requirements that enable reliable implementations, adding only
5080   those features that can either be safely ignored by an HTTP/1.0
5081   recipient or only sent when communicating with a party advertising
5082   conformance with HTTP/1.1.
5085   HTTP/1.1 has been designed to make supporting previous versions easy.
5086   A general-purpose HTTP/1.1 server ought to be able to understand any valid
5087   request in the format of HTTP/1.0, responding appropriately with an
5088   HTTP/1.1 message that only uses features understood (or safely ignored) by
5089   HTTP/1.0 clients. Likewise, an HTTP/1.1 client can be expected to
5090   understand any valid HTTP/1.0 response.
5093   Since HTTP/0.9 did not support header fields in a request, there is no
5094   mechanism for it to support name-based virtual hosts (selection of resource
5095   by inspection of the <x:ref>Host</x:ref> header field).
5096   Any server that implements name-based virtual hosts ought to disable
5097   support for HTTP/0.9. Most requests that appear to be HTTP/0.9 are, in
5098   fact, badly constructed HTTP/1.x requests caused by a client failing to
5099   properly encode the request-target.
5102<section title="Changes from HTTP/1.0" anchor="changes.from.1.0">
5104   This section summarizes major differences between versions HTTP/1.0
5105   and HTTP/1.1.
5108<section title="Multi-homed Web Servers" anchor="">
5110   The requirements that clients and servers support the <x:ref>Host</x:ref>
5111   header field (<xref target=""/>), report an error if it is
5112   missing from an HTTP/1.1 request, and accept absolute URIs (<xref target="request-target"/>)
5113   are among the most important changes defined by HTTP/1.1.
5116   Older HTTP/1.0 clients assumed a one-to-one relationship of IP
5117   addresses and servers; there was no other established mechanism for
5118   distinguishing the intended server of a request than the IP address
5119   to which that request was directed. The <x:ref>Host</x:ref> header field was
5120   introduced during the development of HTTP/1.1 and, though it was
5121   quickly implemented by most HTTP/1.0 browsers, additional requirements
5122   were placed on all HTTP/1.1 requests in order to ensure complete
5123   adoption.  At the time of this writing, most HTTP-based services
5124   are dependent upon the Host header field for targeting requests.
5128<section title="Keep-Alive Connections" anchor="compatibility.with.http.1.0.persistent.connections">
5130   In HTTP/1.0, each connection is established by the client prior to the
5131   request and closed by the server after sending the response. However, some
5132   implementations implement the explicitly negotiated ("Keep-Alive") version
5133   of persistent connections described in <xref x:sec="19.7.1" x:fmt="of"
5134   target="RFC2068"/>.
5137   Some clients and servers might wish to be compatible with these previous
5138   approaches to persistent connections, by explicitly negotiating for them
5139   with a "Connection: keep-alive" request header field. However, some
5140   experimental implementations of HTTP/1.0 persistent connections are faulty;
5141   for example, if an HTTP/1.0 proxy server doesn't understand
5142   <x:ref>Connection</x:ref>, it will erroneously forward that header field
5143   to the next inbound server, which would result in a hung connection.
5146   One attempted solution was the introduction of a Proxy-Connection header
5147   field, targeted specifically at proxies. In practice, this was also
5148   unworkable, because proxies are often deployed in multiple layers, bringing
5149   about the same problem discussed above.
5152   As a result, clients are encouraged not to send the Proxy-Connection header
5153   field in any requests.
5156   Clients are also encouraged to consider the use of Connection: keep-alive
5157   in requests carefully; while they can enable persistent connections with
5158   HTTP/1.0 servers, clients using them will need to monitor the
5159   connection for "hung" requests (which indicate that the client ought stop
5160   sending the header field), and this mechanism ought not be used by clients
5161   at all when a proxy is being used.
5165<section title="Introduction of Transfer-Encoding" anchor="introduction.of.transfer-encoding">
5167   HTTP/1.1 introduces the <x:ref>Transfer-Encoding</x:ref> header field
5168   (<xref target="header.transfer-encoding"/>).
5169   Transfer codings need to be decoded prior to forwarding an HTTP message
5170   over a MIME-compliant protocol.
5176<section title="Changes from RFC 2616" anchor="changes.from.rfc.2616">
5178  HTTP's approach to error handling has been explained.
5179  (<xref target="conformance" />)
5182  The HTTP-version ABNF production has been clarified to be case-sensitive.
5183  Additionally, version numbers has been restricted to single digits, due
5184  to the fact that implementations are known to handle multi-digit version
5185  numbers incorrectly.
5186  (<xref target="http.version"/>)
5189  Userinfo (i.e., username and password) are now disallowed in HTTP and
5190  HTTPS URIs, because of security issues related to their transmission on the
5191  wire.
5192  (<xref target="http.uri" />)
5195  The HTTPS URI scheme is now defined by this specification; previously,
5196  it was done in  <xref target="RFC2818" x:fmt="of" x:sec="2.4"/>.
5197  Furthermore, it implies end-to-end security.
5198  (<xref target="https.uri"/>)
5201  HTTP messages can be (and often are) buffered by implementations; despite
5202  it sometimes being available as a stream, HTTP is fundamentally a
5203  message-oriented protocol.
5204  Minimum supported sizes for various protocol elements have been
5205  suggested, to improve interoperability.
5206  (<xref target="http.message" />)
5209  Invalid whitespace around field-names is now required to be rejected,
5210  because accepting it represents a security vulnerability.
5211  The ABNF productions defining header fields now only list the field value.
5212  (<xref target="header.fields"/>)
5215  Rules about implicit linear whitespace between certain grammar productions
5216  have been removed; now whitespace is only allowed where specifically
5217  defined in the ABNF.
5218  (<xref target="whitespace"/>)
5221  Header fields that span multiple lines ("line folding") are deprecated.
5222  (<xref target="field.parsing" />)
5225  The NUL octet is no longer allowed in comment and quoted-string text, and
5226  handling of backslash-escaping in them has been clarified.
5227  The quoted-pair rule no longer allows escaping control characters other than
5228  HTAB.
5229  Non-ASCII content in header fields and the reason phrase has been obsoleted
5230  and made opaque (the TEXT rule was removed).
5231  (<xref target="field.components"/>)
5234  Bogus "<x:ref>Content-Length</x:ref>" header fields are now required to be
5235  handled as errors by recipients.
5236  (<xref target="header.content-length"/>)
5239  The algorithm for determining the message body length has been clarified
5240  to indicate all of the special cases (e.g., driven by methods or status
5241  codes) that affect it, and that new protocol elements cannot define such
5242  special cases.
5243  CONNECT is a new, special case in determining message body length.
5244  "multipart/byteranges" is no longer a way of determining message body length
5245  detection.
5246  (<xref target="message.body.length"/>)
5249  The "identity" transfer coding token has been removed.
5250  (Sections <xref format="counter" target="message.body"/> and
5251  <xref format="counter" target="transfer.codings"/>)
5254  Chunk length does not include the count of the octets in the
5255  chunk header and trailer.
5256  Line folding in chunk extensions is  disallowed.
5257  (<xref target="chunked.encoding"/>)
5260  The meaning of the "deflate" content coding has been clarified.
5261  (<xref target="deflate.coding" />)
5264  The segment + query components of RFC 3986 have been used to define the
5265  request-target, instead of abs_path from RFC 1808.
5266  The asterisk-form of the request-target is only allowed with the OPTIONS
5267  method.
5268  (<xref target="request-target"/>)
5271  The term "Effective Request URI" has been introduced.
5272  (<xref target="effective.request.uri" />)
5275  Gateways do not need to generate <x:ref>Via</x:ref> header fields anymore.
5276  (<xref target="header.via"/>)
5279  Exactly when "close" connection options have to be sent has been clarified.
5280  Also, "hop-by-hop" header fields are required to appear in the Connection header
5281  field; just because they're defined as hop-by-hop in this specification
5282  doesn't exempt them.
5283  (<xref target="header.connection"/>)
5286  The limit of two connections per server has been removed.
5287  An idempotent sequence of requests is no longer required to be retried.
5288  The requirement to retry requests under certain circumstances when the
5289  server prematurely closes the connection has been removed.
5290  Also, some extraneous requirements about when servers are allowed to close
5291  connections prematurely have been removed.
5292  (<xref target="persistent.connections"/>)
5295  The semantics of the <x:ref>Upgrade</x:ref> header field is now defined in
5296  responses other than 101 (this was incorporated from <xref
5297  target="RFC2817"/>). Furthermore, the ordering in the field value is now
5298  significant.
5299  (<xref target="header.upgrade"/>)
5302  Empty list elements in list productions (e.g., a list header field containing
5303  ", ,") have been deprecated.
5304  (<xref target="abnf.extension"/>)
5307  Registration of Transfer Codings now requires IETF Review
5308  (<xref target="transfer.coding.registry"/>)
5311  This specification now defines the Upgrade Token Registry, previously
5312  defined in <xref target="RFC2817" x:fmt="of" x:sec="7.2"/>.
5313  (<xref target="upgrade.token.registry"/>)
5316  The expectation to support HTTP/0.9 requests has been removed.
5317  (<xref target="compatibility"/>)
5320  Issues with the Keep-Alive and Proxy-Connection header fields in requests
5321  are pointed out, with use of the latter being discouraged altogether.
5322  (<xref target="compatibility.with.http.1.0.persistent.connections" />)
5327<?BEGININC p1-messaging.abnf-appendix ?>
5328<section xmlns:x="" title="Collected ABNF" anchor="collected.abnf">
5330<artwork type="abnf" name="p1-messaging.parsed-abnf">
5331<x:ref>BWS</x:ref> = OWS
5333<x:ref>Connection</x:ref> = *( "," OWS ) connection-option *( OWS "," [ OWS
5334 connection-option ] )
5335<x:ref>Content-Length</x:ref> = 1*DIGIT
5337<x:ref>HTTP-message</x:ref> = start-line *( header-field CRLF ) CRLF [ message-body
5338 ]
5339<x:ref>HTTP-name</x:ref> = %x48.54.54.50 ; HTTP
5340<x:ref>HTTP-version</x:ref> = HTTP-name "/" DIGIT "." DIGIT
5341<x:ref>Host</x:ref> = uri-host [ ":" port ]
5343<x:ref>OWS</x:ref> = *( SP / HTAB )
5345<x:ref>RWS</x:ref> = 1*( SP / HTAB )
5347<x:ref>TE</x:ref> = [ ( "," / t-codings ) *( OWS "," [ OWS t-codings ] ) ]
5348<x:ref>Trailer</x:ref> = *( "," OWS ) field-name *( OWS "," [ OWS field-name ] )
5349<x:ref>Transfer-Encoding</x:ref> = *( "," OWS ) transfer-coding *( OWS "," [ OWS
5350 transfer-coding ] )
5352<x:ref>URI-reference</x:ref> = &lt;URI-reference, defined in [RFC3986], Section 4.1&gt;
5353<x:ref>Upgrade</x:ref> = *( "," OWS ) protocol *( OWS "," [ OWS protocol ] )
5355<x:ref>Via</x:ref> = *( "," OWS ) ( received-protocol RWS received-by [ RWS comment
5356 ] ) *( OWS "," [ OWS ( received-protocol RWS received-by [ RWS
5357 comment ] ) ] )
5359<x:ref>absolute-URI</x:ref> = &lt;absolute-URI, defined in [RFC3986], Section 4.3&gt;
5360<x:ref>absolute-form</x:ref> = absolute-URI
5361<x:ref>absolute-path</x:ref> = 1*( "/" segment )
5362<x:ref>asterisk-form</x:ref> = "*"
5363<x:ref>authority</x:ref> = &lt;authority, defined in [RFC3986], Section 3.2&gt;
5364<x:ref>authority-form</x:ref> = authority
5366<x:ref>chunk</x:ref> = chunk-size [ chunk-ext ] CRLF chunk-data CRLF
5367<x:ref>chunk-data</x:ref> = 1*OCTET
5368<x:ref>chunk-ext</x:ref> = *( ";" chunk-ext-name [ "=" chunk-ext-val ] )
5369<x:ref>chunk-ext-name</x:ref> = token
5370<x:ref>chunk-ext-val</x:ref> = token / quoted-string
5371<x:ref>chunk-size</x:ref> = 1*HEXDIG
5372<x:ref>chunked-body</x:ref> = *chunk last-chunk trailer-part CRLF
5373<x:ref>comment</x:ref> = "(" *( ctext / quoted-pair / comment ) ")"
5374<x:ref>connection-option</x:ref> = token
5375<x:ref>ctext</x:ref> = HTAB / SP / %x21-27 ; '!'-'''
5376 / %x2A-5B ; '*'-'['
5377 / %x5D-7E ; ']'-'~'
5378 / obs-text
5380<x:ref>field-content</x:ref> = field-vchar [ 1*( SP / HTAB ) field-vchar ]
5381<x:ref>field-name</x:ref> = token
5382<x:ref>field-value</x:ref> = *( field-content / obs-fold )
5383<x:ref>field-vchar</x:ref> = VCHAR / obs-text
5384<x:ref>fragment</x:ref> = &lt;fragment, defined in [RFC3986], Section 3.5&gt;
5386<x:ref>header-field</x:ref> = field-name ":" OWS field-value OWS
5387<x:ref>http-URI</x:ref> = "http://" authority path-abempty [ "?" query ] [ "#"
5388 fragment ]
5389<x:ref>https-URI</x:ref> = "https://" authority path-abempty [ "?" query ] [ "#"
5390 fragment ]
5392<x:ref>last-chunk</x:ref> = 1*"0" [ chunk-ext ] CRLF
5394<x:ref>message-body</x:ref> = *OCTET
5395<x:ref>method</x:ref> = token
5397<x:ref>obs-fold</x:ref> = CRLF 1*( SP / HTAB )
5398<x:ref>obs-text</x:ref> = %x80-FF
5399<x:ref>origin-form</x:ref> = absolute-path [ "?" query ]
5401<x:ref>partial-URI</x:ref> = relative-part [ "?" query ]
5402<x:ref>path-abempty</x:ref> = &lt;path-abempty, defined in [RFC3986], Section 3.3&gt;
5403<x:ref>port</x:ref> = &lt;port, defined in [RFC3986], Section 3.2.3&gt;
5404<x:ref>protocol</x:ref> = protocol-name [ "/" protocol-version ]
5405<x:ref>protocol-name</x:ref> = token
5406<x:ref>protocol-version</x:ref> = token
5407<x:ref>pseudonym</x:ref> = token
5409<x:ref>qdtext</x:ref> = HTAB / SP / "!" / %x23-5B ; '#'-'['
5410 / %x5D-7E ; ']'-'~'
5411 / obs-text
5412<x:ref>query</x:ref> = &lt;query, defined in [RFC3986], Section 3.4&gt;
5413<x:ref>quoted-pair</x:ref> = "\" ( HTAB / SP / VCHAR / obs-text )
5414<x:ref>quoted-string</x:ref> = DQUOTE *( qdtext / quoted-pair ) DQUOTE
5416<x:ref>rank</x:ref> = ( "0" [ "." *3DIGIT ] ) / ( "1" [ "." *3"0" ] )
5417<x:ref>reason-phrase</x:ref> = *( HTAB / SP / VCHAR / obs-text )
5418<x:ref>received-by</x:ref> = ( uri-host [ ":" port ] ) / pseudonym
5419<x:ref>received-protocol</x:ref> = [ protocol-name "/" ] protocol-version
5420<x:ref>relative-part</x:ref> = &lt;relative-part, defined in [RFC3986], Section 4.2&gt;
5421<x:ref>request-line</x:ref> = method SP request-target SP HTTP-version CRLF
5422<x:ref>request-target</x:ref> = origin-form / absolute-form / authority-form /
5423 asterisk-form
5425<x:ref>scheme</x:ref> = &lt;scheme, defined in [RFC3986], Section 3.1&gt;
5426<x:ref>segment</x:ref> = &lt;segment, defined in [RFC3986], Section 3.3&gt;
5427<x:ref>start-line</x:ref> = request-line / status-line
5428<x:ref>status-code</x:ref> = 3DIGIT
5429<x:ref>status-line</x:ref> = HTTP-version SP status-code SP reason-phrase CRLF
5431<x:ref>t-codings</x:ref> = "trailers" / ( transfer-coding [ t-ranking ] )
5432<x:ref>t-ranking</x:ref> = OWS ";" OWS "q=" rank
5433<x:ref>tchar</x:ref> = "!" / "#" / "$" / "%" / "&amp;" / "'" / "*" / "+" / "-" / "." /
5434 "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA
5435<x:ref>token</x:ref> = 1*tchar
5436<x:ref>trailer-part</x:ref> = *( header-field CRLF )
5437<x:ref>transfer-coding</x:ref> = "chunked" / "compress" / "deflate" / "gzip" /
5438 transfer-extension
5439<x:ref>transfer-extension</x:ref> = token *( OWS ";" OWS transfer-parameter )
5440<x:ref>transfer-parameter</x:ref> = token BWS "=" BWS ( token / quoted-string )
5442<x:ref>uri-host</x:ref> = &lt;host, defined in [RFC3986], Section 3.2.2&gt;
5446<?ENDINC p1-messaging.abnf-appendix ?>
5448<section title="Change Log (to be removed by RFC Editor before publication)" anchor="change.log">
5450<section title="Since RFC 2616">
5452  Changes up to the IETF Last Call draft are summarized
5453  in <eref target=""/>.
5457<section title="Since draft-ietf-httpbis-p1-messaging-24" anchor="changes.since.24">
5459  Closed issues:
5460  <list style="symbols">
5461    <t>
5462      <eref target=""/>:
5463      "APPSDIR review of draft-ietf-httpbis-p1-messaging-24"
5464    </t>
5465    <t>
5466      <eref target=""/>:
5467      "integer value parsing"
5468    </t>
5469    <t>
5470      <eref target=""/>:
5471      "move IANA registrations to correct draft"
5472    </t>
5473  </list>
5477<section title="Since draft-ietf-httpbis-p1-messaging-25" anchor="changes.since.25">
5479  Closed issues:
5480  <list style="symbols">
5481    <t>
5482      <eref target=""/>:
5483      "check media type registration templates"
5484    </t>
5485    <t>
5486      <eref target=""/>:
5487      "Redundant rule quoted-str-nf"
5488    </t>
5489    <t>
5490      <eref target=""/>:
5491      "add 'stateless' to Abstract"
5492    </t>
5493    <t>
5494      <eref target=""/>:
5495      "clarify ABNF layering"
5496    </t>
5497    <t>
5498      <eref target=""/>:
5499      "use of 'word' ABNF production"
5500    </t>
5501    <t>
5502      <eref target=""/>:
5503      "improve introduction of list rule"
5504    </t>
5505    <t>
5506      <eref target=""/>:
5507      "moving 2616/2068/2145 to historic"
5508    </t>
5509    <t>
5510      <eref target=""/>:
5511      "augment security considerations with pointers to current research"
5512    </t>
5513    <t>
5514      <eref target=""/>:
5515      "intermediaries handling trailers"
5516    </t>
5517  </list>
5520  Partly resolved issues:
5521  <list style="symbols">
5522    <t>
5523      <eref target=""/>:
5524      "IESG ballot on draft-ietf-httpbis-p1-messaging-25"
5525    </t>
5526  </list>
Note: See TracBrowser for help on using the repository browser.