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

Last change on this file since 1323 was 1323, checked in by julian.reschke@…, 11 years ago

add guidance on minimum sizes of protocol elements (see #282)

  • Property svn:eol-style set to native
File size: 252.9 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 "July">
16  <!ENTITY ID-YEAR "2011">
17  <!ENTITY mdash "&#8212;">
18  <!ENTITY caching-overview       "<xref target='Part6' x:rel='#caching.overview' xmlns:x=''/>">
19  <!ENTITY cache-incomplete       "<xref target='Part6' x:rel='#errors.or.incomplete.response.cache.behavior' xmlns:x=''/>">
20  <!ENTITY payload                "<xref target='Part3' xmlns:x=''/>">
21  <!ENTITY media-types            "<xref target='Part3' x:rel='#media.types' xmlns:x=''/>">
22  <!ENTITY content-codings        "<xref target='Part3' x:rel='#content.codings' xmlns:x=''/>">
23  <!ENTITY CONNECT                "<xref target='Part2' x:rel='#CONNECT' xmlns:x=''/>">
24  <!ENTITY content.negotiation    "<xref target='Part3' x:rel='#content.negotiation' xmlns:x=''/>">
25  <!ENTITY diff-mime              "<xref target='Part3' x:rel='#differences.between.http.and.mime' xmlns:x=''/>">
26  <!ENTITY representation         "<xref target='Part3' x:rel='#representation' xmlns:x=''/>">
27  <!ENTITY header-cache-control   "<xref target='Part6' x:rel='#header.cache-control' xmlns:x=''/>">
28  <!ENTITY header-expect          "<xref target='Part2' x:rel='#header.expect' xmlns:x=''/>">
29  <!ENTITY header-mime-version    "<xref target='Part3' x:rel='#mime-version' xmlns:x=''/>">
30  <!ENTITY header-pragma          "<xref target='Part6' x:rel='#header.pragma' xmlns:x=''/>">
31  <!ENTITY header-warning         "<xref target='Part6' x:rel='#header.warning' xmlns:x=''/>">
32  <!ENTITY idempotent-methods     "<xref target='Part2' x:rel='#idempotent.methods' xmlns:x=''/>">
33  <!ENTITY status-codes           "<xref target='Part2' x:rel='' xmlns:x=''/>">
34  <!ENTITY status-100             "<xref target='Part2' x:rel='#status.100' xmlns:x=''/>">
35  <!ENTITY status-1xx             "<xref target='Part2' x:rel='#status.1xx' xmlns:x=''/>">
36  <!ENTITY status-203             "<xref target='Part2' x:rel='#status.203' xmlns:x=''/>">
37  <!ENTITY status-3xx             "<xref target='Part2' x:rel='#status.3xx' xmlns:x=''/>">
38  <!ENTITY status-4xx             "<xref target='Part2' x:rel='#status.4xx' xmlns:x=''/>">
39  <!ENTITY status-414             "<xref target='Part2' x:rel='#status.414' xmlns:x=''/>">
41<?rfc toc="yes" ?>
42<?rfc symrefs="yes" ?>
43<?rfc sortrefs="yes" ?>
44<?rfc compact="yes"?>
45<?rfc subcompact="no" ?>
46<?rfc linkmailto="no" ?>
47<?rfc editing="no" ?>
48<?rfc comments="yes"?>
49<?rfc inline="yes"?>
50<?rfc rfcedstyle="yes"?>
51<?rfc-ext allow-markup-in-artwork="yes" ?>
52<?rfc-ext include-references-in-index="yes" ?>
53<rfc obsoletes="2145,2616" updates="2817" category="std" x:maturity-level="draft"
54     ipr="pre5378Trust200902" docName="draft-ietf-httpbis-p1-messaging-&ID-VERSION;"
55     xmlns:x=''>
58  <title abbrev="HTTP/1.1, Part 1">HTTP/1.1, part 1: URIs, Connections, and Message Parsing</title>
60  <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
61    <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
62    <address>
63      <postal>
64        <street>345 Park Ave</street>
65        <city>San Jose</city>
66        <region>CA</region>
67        <code>95110</code>
68        <country>USA</country>
69      </postal>
70      <email></email>
71      <uri></uri>
72    </address>
73  </author>
75  <author initials="J." surname="Gettys" fullname="Jim Gettys">
76    <organization abbrev="Alcatel-Lucent">Alcatel-Lucent Bell Labs</organization>
77    <address>
78      <postal>
79        <street>21 Oak Knoll Road</street>
80        <city>Carlisle</city>
81        <region>MA</region>
82        <code>01741</code>
83        <country>USA</country>
84      </postal>
85      <email></email>
86      <uri></uri>
87    </address>
88  </author>
90  <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
91    <organization abbrev="HP">Hewlett-Packard Company</organization>
92    <address>
93      <postal>
94        <street>HP Labs, Large Scale Systems Group</street>
95        <street>1501 Page Mill Road, MS 1177</street>
96        <city>Palo Alto</city>
97        <region>CA</region>
98        <code>94304</code>
99        <country>USA</country>
100      </postal>
101      <email></email>
102    </address>
103  </author>
105  <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
106    <organization abbrev="Microsoft">Microsoft Corporation</organization>
107    <address>
108      <postal>
109        <street>1 Microsoft Way</street>
110        <city>Redmond</city>
111        <region>WA</region>
112        <code>98052</code>
113        <country>USA</country>
114      </postal>
115      <email></email>
116    </address>
117  </author>
119  <author initials="L." surname="Masinter" fullname="Larry Masinter">
120    <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
121    <address>
122      <postal>
123        <street>345 Park Ave</street>
124        <city>San Jose</city>
125        <region>CA</region>
126        <code>95110</code>
127        <country>USA</country>
128      </postal>
129      <email></email>
130      <uri></uri>
131    </address>
132  </author>
134  <author initials="P." surname="Leach" fullname="Paul J. Leach">
135    <organization abbrev="Microsoft">Microsoft Corporation</organization>
136    <address>
137      <postal>
138        <street>1 Microsoft Way</street>
139        <city>Redmond</city>
140        <region>WA</region>
141        <code>98052</code>
142      </postal>
143      <email></email>
144    </address>
145  </author>
147  <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
148    <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
149    <address>
150      <postal>
151        <street>MIT Computer Science and Artificial Intelligence Laboratory</street>
152        <street>The Stata Center, Building 32</street>
153        <street>32 Vassar Street</street>
154        <city>Cambridge</city>
155        <region>MA</region>
156        <code>02139</code>
157        <country>USA</country>
158      </postal>
159      <email></email>
160      <uri></uri>
161    </address>
162  </author>
164  <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
165    <organization abbrev="W3C">World Wide Web Consortium</organization>
166    <address>
167      <postal>
168        <street>W3C / ERCIM</street>
169        <street>2004, rte des Lucioles</street>
170        <city>Sophia-Antipolis</city>
171        <region>AM</region>
172        <code>06902</code>
173        <country>France</country>
174      </postal>
175      <email></email>
176      <uri></uri>
177    </address>
178  </author>
180  <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
181    <organization abbrev="greenbytes">greenbytes GmbH</organization>
182    <address>
183      <postal>
184        <street>Hafenweg 16</street>
185        <city>Muenster</city><region>NW</region><code>48155</code>
186        <country>Germany</country>
187      </postal>
188      <phone>+49 251 2807760</phone>
189      <facsimile>+49 251 2807761</facsimile>
190      <email></email>
191      <uri></uri>
192    </address>
193  </author>
195  <date month="&ID-MONTH;" year="&ID-YEAR;"/>
196  <workgroup>HTTPbis Working Group</workgroup>
200   The Hypertext Transfer Protocol (HTTP) is an application-level
201   protocol for distributed, collaborative, hypertext information
202   systems. HTTP has been in use by the World Wide Web global information
203   initiative since 1990. This document is Part 1 of the seven-part specification
204   that defines the protocol referred to as "HTTP/1.1" and, taken together,
205   obsoletes RFC 2616.  Part 1 provides an overview of HTTP and
206   its associated terminology, defines the "http" and "https" Uniform
207   Resource Identifier (URI) schemes, defines the generic message syntax
208   and parsing requirements for HTTP message frames, and describes
209   general security concerns for implementations.
213<note title="Editorial Note (To be removed by RFC Editor)">
214  <t>
215    Discussion of this draft should take place on the HTTPBIS working group
216    mailing list (, which is archived at
217    <eref target=""/>.
218  </t>
219  <t>
220    The current issues list is at
221    <eref target=""/> and related
222    documents (including fancy diffs) can be found at
223    <eref target=""/>.
224  </t>
225  <t>
226    The changes in this draft are summarized in <xref target="changes.since.14"/>.
227  </t>
231<section title="Introduction" anchor="introduction">
233   The Hypertext Transfer Protocol (HTTP) is an application-level
234   request/response protocol that uses extensible semantics and MIME-like
235   message payloads for flexible interaction with network-based hypertext
236   information systems. HTTP relies upon the Uniform Resource Identifier (URI)
237   standard <xref target="RFC3986"/> to indicate the target resource and
238   relationships between resources.
239   Messages are passed in a format similar to that used by Internet mail
240   <xref target="RFC5322"/> and the Multipurpose Internet Mail Extensions
241   (MIME) <xref target="RFC2045"/> (see &diff-mime; for the differences
242   between HTTP and MIME messages).
245   HTTP is a generic interface protocol for information systems. It is
246   designed to hide the details of how a service is implemented by presenting
247   a uniform interface to clients that is independent of the types of
248   resources provided. Likewise, servers do not need to be aware of each
249   client's purpose: an HTTP request can be considered in isolation rather
250   than being associated with a specific type of client or a predetermined
251   sequence of application steps. The result is a protocol that can be used
252   effectively in many different contexts and for which implementations can
253   evolve independently over time.
256   HTTP is also designed for use as an intermediation protocol for translating
257   communication to and from non-HTTP information systems.
258   HTTP proxies and gateways can provide access to alternative information
259   services by translating their diverse protocols into a hypertext
260   format that can be viewed and manipulated by clients in the same way
261   as HTTP services.
264   One consequence of HTTP flexibility is that the protocol cannot be
265   defined in terms of what occurs behind the interface. Instead, we
266   are limited to defining the syntax of communication, the intent
267   of received communication, and the expected behavior of recipients.
268   If the communication is considered in isolation, then successful
269   actions ought to be reflected in corresponding changes to the
270   observable interface provided by servers. However, since multiple
271   clients might act in parallel and perhaps at cross-purposes, we
272   cannot require that such changes be observable beyond the scope
273   of a single response.
276   This document is Part 1 of the seven-part specification of HTTP,
277   defining the protocol referred to as "HTTP/1.1", obsoleting
278   <xref target="RFC2616"/> and <xref target="RFC2145"/>.
279   Part 1 describes the architectural elements that are used or
280   referred to in HTTP, defines the "http" and "https" URI schemes,
281   describes overall network operation and connection management,
282   and defines HTTP message framing and forwarding requirements.
283   Our goal is to define all of the mechanisms necessary for HTTP message
284   handling that are independent of message semantics, thereby defining the
285   complete set of requirements for message parsers and
286   message-forwarding intermediaries.
289<section title="Requirements" anchor="intro.requirements">
291   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
292   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
293   document are to be interpreted as described in <xref target="RFC2119"/>.
296   An implementation is not compliant if it fails to satisfy one or more
297   of the "MUST" or "REQUIRED" level requirements for the protocols it
298   implements. An implementation that satisfies all the "MUST" or "REQUIRED"
299   level and all the "SHOULD" level requirements for its protocols is said
300   to be "unconditionally compliant"; one that satisfies all the "MUST"
301   level requirements but not all the "SHOULD" level requirements for its
302   protocols is said to be "conditionally compliant".
306<section title="Syntax Notation" anchor="notation">
307<iref primary="true" item="Grammar" subitem="ALPHA"/>
308<iref primary="true" item="Grammar" subitem="CR"/>
309<iref primary="true" item="Grammar" subitem="CRLF"/>
310<iref primary="true" item="Grammar" subitem="CTL"/>
311<iref primary="true" item="Grammar" subitem="DIGIT"/>
312<iref primary="true" item="Grammar" subitem="DQUOTE"/>
313<iref primary="true" item="Grammar" subitem="HEXDIG"/>
314<iref primary="true" item="Grammar" subitem="LF"/>
315<iref primary="true" item="Grammar" subitem="OCTET"/>
316<iref primary="true" item="Grammar" subitem="SP"/>
317<iref primary="true" item="Grammar" subitem="VCHAR"/>
318<iref primary="true" item="Grammar" subitem="WSP"/>
320   This specification uses the Augmented Backus-Naur Form (ABNF) notation
321   of <xref target="RFC5234"/>.
323<t anchor="core.rules">
324  <x:anchor-alias value="ALPHA"/>
325  <x:anchor-alias value="CTL"/>
326  <x:anchor-alias value="CR"/>
327  <x:anchor-alias value="CRLF"/>
328  <x:anchor-alias value="DIGIT"/>
329  <x:anchor-alias value="DQUOTE"/>
330  <x:anchor-alias value="HEXDIG"/>
331  <x:anchor-alias value="LF"/>
332  <x:anchor-alias value="OCTET"/>
333  <x:anchor-alias value="SP"/>
334  <x:anchor-alias value="VCHAR"/>
335  <x:anchor-alias value="WSP"/>
336   The following core rules are included by
337   reference, as defined in <xref target="RFC5234" x:fmt="," x:sec="B.1"/>:
338   ALPHA (letters), CR (carriage return), CRLF (CR LF), CTL (controls),
339   DIGIT (decimal 0-9), DQUOTE (double quote),
340   HEXDIG (hexadecimal 0-9/A-F/a-f), LF (line feed),
341   OCTET (any 8-bit sequence of data), SP (space),
342   VCHAR (any visible <xref target="USASCII"/> character),
343   and WSP (whitespace).
346   As a syntactic convention, ABNF rule names prefixed with "obs-" denote
347   "obsolete" grammar rules that appear for historical reasons.
350<section title="ABNF Extension: #rule" anchor="notation.abnf">
352  The #rule extension to the ABNF rules of <xref target="RFC5234"/> is used to
353  improve readability.
356  A construct "#" is defined, similar to "*", for defining comma-delimited
357  lists of elements. The full form is "&lt;n&gt;#&lt;m&gt;element" indicating
358  at least &lt;n&gt; and at most &lt;m&gt; elements, each separated by a single
359  comma (",") and optional whitespace (OWS,
360  <xref target="basic.rules"/>).   
363  Thus,
364</preamble><artwork type="example">
365  1#element =&gt; element *( OWS "," OWS element )
368  and:
369</preamble><artwork type="example">
370  #element =&gt; [ 1#element ]
373  and for n &gt;= 1 and m &gt; 1:
374</preamble><artwork type="example">
375  &lt;n&gt;#&lt;m&gt;element =&gt; element &lt;n-1&gt;*&lt;m-1&gt;( OWS "," OWS element )
378  For compatibility with legacy list rules, recipients &SHOULD; accept empty
379  list elements. In other words, consumers would follow the list productions:
381<figure><artwork type="example">
382  #element =&gt; [ ( "," / element ) *( OWS "," [ OWS element ] ) ]
384  1#element =&gt; *( "," OWS ) element *( OWS "," [ OWS element ] )
387  Note that empty elements do not contribute to the count of elements present,
388  though.
391  For example, given these ABNF productions:
393<figure><artwork type="example">
394  example-list      = 1#example-list-elmt
395  example-list-elmt = token ; see <xref target="basic.rules"/>
398  Then these are valid values for example-list (not including the double
399  quotes, which are present for delimitation only):
401<figure><artwork type="example">
402  "foo,bar"
403  " foo ,bar,"
404  "  foo , ,bar,charlie   "
405  "foo ,bar,   charlie "
408  But these values would be invalid, as at least one non-empty element is
409  required:
411<figure><artwork type="example">
412  ""
413  ","
414  ",   ,"
417  <xref target="collected.abnf"/> shows the collected ABNF, with the list rules
418  expanded as explained above.
422<section title="Basic Rules" anchor="basic.rules">
423<t anchor="rule.CRLF">
424  <x:anchor-alias value="CRLF"/>
425   HTTP/1.1 defines the sequence CR LF as the end-of-line marker for all
426   protocol elements other than the message-body
427   (see <xref target="tolerant.applications"/> for tolerant applications).
429<t anchor="rule.LWS">
430   This specification uses three rules to denote the use of linear
431   whitespace: OWS (optional whitespace), RWS (required whitespace), and
432   BWS ("bad" whitespace).
435   The OWS rule is used where zero or more linear whitespace octets might
436   appear. OWS &SHOULD; either not be produced or be produced as a single
437   SP. Multiple OWS octets that occur within field-content &SHOULD;
438   be replaced with a single SP before interpreting the field value or
439   forwarding the message downstream.
442   RWS is used when at least one linear whitespace octet is required to
443   separate field tokens. RWS &SHOULD; be produced as a single SP.
444   Multiple RWS octets that occur within field-content &SHOULD; be
445   replaced with a single SP before interpreting the field value or
446   forwarding the message downstream.
449   BWS is used where the grammar allows optional whitespace for historical
450   reasons but senders &SHOULD-NOT; produce it in messages. HTTP/1.1
451   recipients &MUST; accept such bad optional whitespace and remove it before
452   interpreting the field value or forwarding the message downstream.
454<t anchor="rule.whitespace">
455  <x:anchor-alias value="BWS"/>
456  <x:anchor-alias value="OWS"/>
457  <x:anchor-alias value="RWS"/>
458  <x:anchor-alias value="obs-fold"/>
460<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"/>
461  <x:ref>OWS</x:ref>            = *( [ obs-fold ] <x:ref>WSP</x:ref> )
462                 ; "optional" whitespace
463  <x:ref>RWS</x:ref>            = 1*( [ obs-fold ] <x:ref>WSP</x:ref> )
464                 ; "required" whitespace
465  <x:ref>BWS</x:ref>            = <x:ref>OWS</x:ref>
466                 ; "bad" whitespace
467  <x:ref>obs-fold</x:ref>       = <x:ref>CRLF</x:ref>
468                 ; see <xref target="header.fields"/>
470<t anchor="rule.token.separators">
471  <x:anchor-alias value="tchar"/>
472  <x:anchor-alias value="token"/>
473  <x:anchor-alias value="special"/>
474  <x:anchor-alias value="word"/>
475   Many HTTP/1.1 header field values consist of words (token or quoted-string)
476   separated by whitespace or special characters. These special characters
477   &MUST; be in a quoted string to be used within a parameter value (as defined
478   in <xref target="transfer.codings"/>).
480<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="word"/><iref primary="true" item="Grammar" subitem="token"/><iref primary="true" item="Grammar" subitem="tchar"/><iref primary="true" item="Grammar" subitem="special"/>
481  <x:ref>word</x:ref>           = <x:ref>token</x:ref> / <x:ref>quoted-string</x:ref>
483  <x:ref>token</x:ref>          = 1*<x:ref>tchar</x:ref>
485  IMPORTANT: when editing "tchar" make sure that "special" is updated accordingly!!!
486 -->
487  <x:ref>tchar</x:ref>          = "!" / "#" / "$" / "%" / "&amp;" / "'" / "*"
488                 / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
489                 / <x:ref>DIGIT</x:ref> / <x:ref>ALPHA</x:ref>
490                 ; any <x:ref>VCHAR</x:ref>, except <x:ref>special</x:ref>
492  <x:ref>special</x:ref>        = "(" / ")" / "&lt;" / ">" / "@" / ","
493                 / ";" / ":" / "\" / DQUOTE / "/" / "["
494                 / "]" / "?" / "=" / "{" / "}"
496<t anchor="rule.quoted-string">
497  <x:anchor-alias value="quoted-string"/>
498  <x:anchor-alias value="qdtext"/>
499  <x:anchor-alias value="obs-text"/>
500   A string of text is parsed as a single word if it is quoted using
501   double-quote marks.
503<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"/>
504  <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>
505  <x:ref>qdtext</x:ref>         = <x:ref>OWS</x:ref> / %x21 / %x23-5B / %x5D-7E / <x:ref>obs-text</x:ref>
506                 ; <x:ref>OWS</x:ref> / &lt;<x:ref>VCHAR</x:ref> except <x:ref>DQUOTE</x:ref> and "\"&gt; / <x:ref>obs-text</x:ref>
507  <x:ref>obs-text</x:ref>       = %x80-FF
509<t anchor="rule.quoted-pair">
510  <x:anchor-alias value="quoted-pair"/>
511   The backslash octet ("\") can be used as a single-octet
512   quoting mechanism within quoted-string constructs:
514<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="quoted-pair"/>
515  <x:ref>quoted-pair</x:ref>    = "\" ( <x:ref>WSP</x:ref> / <x:ref>VCHAR</x:ref> / <x:ref>obs-text</x:ref> )
518   Senders &SHOULD-NOT; escape octets that do not require escaping
519   (i.e., other than DQUOTE and the backslash octet).
526<section title="HTTP-related architecture" anchor="architecture">
528   HTTP was created for the World Wide Web architecture
529   and has evolved over time to support the scalability needs of a worldwide
530   hypertext system. Much of that architecture is reflected in the terminology
531   and syntax productions used to define HTTP.
534<section title="Client/Server Messaging" anchor="operation">
535<iref primary="true" item="client"/>
536<iref primary="true" item="server"/>
537<iref primary="true" item="connection"/>
539   HTTP is a stateless request/response protocol that operates by exchanging
540   messages across a reliable transport or session-layer
541   "<x:dfn>connection</x:dfn>". An HTTP "<x:dfn>client</x:dfn>" is a
542   program that establishes a connection to a server for the purpose of
543   sending one or more HTTP requests.  An HTTP "<x:dfn>server</x:dfn>" is a
544   program that accepts connections in order to service HTTP requests by
545   sending HTTP responses.
547<iref primary="true" item="user agent"/>
548<iref primary="true" item="origin server"/>
549<iref primary="true" item="browser"/>
550<iref primary="true" item="spider"/>
551<iref primary="true" item="sender"/>
552<iref primary="true" item="recipient"/>
554   Note that the terms client and server refer only to the roles that
555   these programs perform for a particular connection.  The same program
556   might act as a client on some connections and a server on others.  We use
557   the term "<x:dfn>user agent</x:dfn>" to refer to the program that initiates a request,
558   such as a WWW browser, editor, or spider (web-traversing robot), and
559   the term "<x:dfn>origin server</x:dfn>" to refer to the program that can originate
560   authoritative responses to a request.  For general requirements, we use
561   the term "<x:dfn>sender</x:dfn>" to refer to whichever component sent a given message
562   and the term "<x:dfn>recipient</x:dfn>" to refer to any component that receives the
563   message.
566   Most HTTP communication consists of a retrieval request (GET) for
567   a representation of some resource identified by a URI.  In the
568   simplest case, this might be accomplished via a single bidirectional
569   connection (===) between the user agent (UA) and the origin server (O).
571<figure><artwork type="drawing">
572         request   &gt;
573    UA ======================================= O
574                                &lt;   response
576<iref primary="true" item="message"/>
577<iref primary="true" item="request"/>
578<iref primary="true" item="response"/>
580   A client sends an HTTP request to the server in the form of a <x:dfn>request</x:dfn>
581   <x:dfn>message</x:dfn> (<xref target="request"/>), beginning with a method, URI, and
582   protocol version, followed by MIME-like header fields containing
583   request modifiers, client information, and payload metadata, an empty
584   line to indicate the end of the header section, and finally the payload
585   body (if any).
588   A server responds to the client's request by sending an HTTP <x:dfn>response</x:dfn>
589   <x:dfn>message</x:dfn> (<xref target="response"/>), beginning with a status line that
590   includes the protocol version, a success or error code, and textual
591   reason phrase, followed by MIME-like header fields containing server
592   information, resource metadata, and payload metadata, an empty line to
593   indicate the end of the header section, and finally the payload body (if any).
596   The following example illustrates a typical message exchange for a
597   GET request on the URI "":
600client request:
601</preamble><artwork type="message/http; msgtype=&#34;request&#34;" x:indent-with="  ">
602GET /hello.txt HTTP/1.1
603User-Agent: curl/7.16.3 libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3
605Accept: */*
609server response:
610</preamble><artwork type="message/http; msgtype=&#34;response&#34;" x:indent-with="  ">
611HTTP/1.1 200 OK
612Date: Mon, 27 Jul 2009 12:28:53 GMT
613Server: Apache
614Last-Modified: Wed, 22 Jul 2009 19:15:56 GMT
615ETag: "34aa387-d-1568eb00"
616Accept-Ranges: bytes
617Content-Length: <x:length-of target="exbody"/>
618Vary: Accept-Encoding
619Content-Type: text/plain
621<x:span anchor="exbody">Hello World!
625<section title="Message Orientation and Buffering" anchor="message-orientation-and-buffering">
627   Fundamentally, HTTP is a message-based protocol. Although message bodies can
628   be chunked (<xref target="chunked.encoding"/>) and implementations often
629   make parts of a message available progressively, this is not required, and
630   some widely-used implementations only make a message available when it is
631   complete. Furthermore, while most proxies will progressively stream messages,
632   some amount of buffering will take place, and some proxies might buffer
633   messages to perform transformations, check content or provide other services.
636   Therefore, extensions to and uses of HTTP cannot rely on the availability of
637   a partial message, or assume that messages will not be buffered. There are
638   strategies that can be used to test for buffering in a given connection, but
639   it should be understood that behaviors can differ across connections, and
640   between requests and responses.
643   Recipients &MUST; consider every message in a connection in isolation;
644   because HTTP is a stateless protocol, it cannot be assumed that two requests
645   on the same connection are from the same client or share any other common
646   attributes.
650<section title="Connections and Transport Independence" anchor="transport-independence">
652   HTTP messaging is independent of the underlying transport or
653   session-layer connection protocol(s).  HTTP only presumes a reliable
654   transport with in-order delivery of requests and the corresponding
655   in-order delivery of responses.  The mapping of HTTP request and
656   response structures onto the data units of the underlying transport
657   protocol is outside the scope of this specification.
660   The specific connection protocols to be used for an interaction
661   are determined by client configuration and the target resource's URI.
662   For example, the "http" URI scheme
663   (<xref target="http.uri"/>) indicates a default connection of TCP
664   over IP, with a default TCP port of 80, but the client might be
665   configured to use a proxy via some other connection port or protocol
666   instead of using the defaults.
669   A connection might be used for multiple HTTP request/response exchanges,
670   as defined in <xref target="persistent.connections"/>.
674<section title="Intermediaries" anchor="intermediaries">
675<iref primary="true" item="intermediary"/>
677   HTTP enables the use of intermediaries to satisfy requests through
678   a chain of connections.  There are three common forms of HTTP
679   <x:dfn>intermediary</x:dfn>: proxy, gateway, and tunnel.  In some cases,
680   a single intermediary might act as an origin server, proxy, gateway,
681   or tunnel, switching behavior based on the nature of each request.
683<figure><artwork type="drawing">
684         &gt;             &gt;             &gt;             &gt;
685    <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>
686               &lt;             &lt;             &lt;             &lt;
689   The figure above shows three intermediaries (A, B, and C) between the
690   user agent and origin server. A request or response message that
691   travels the whole chain will pass through four separate connections.
692   Some HTTP communication options
693   might apply only to the connection with the nearest, non-tunnel
694   neighbor, only to the end-points of the chain, or to all connections
695   along the chain. Although the diagram is linear, each participant might
696   be engaged in multiple, simultaneous communications. For example, B
697   might be receiving requests from many clients other than A, and/or
698   forwarding requests to servers other than C, at the same time that it
699   is handling A's request.
702<iref primary="true" item="upstream"/><iref primary="true" item="downstream"/>
703<iref primary="true" item="inbound"/><iref primary="true" item="outbound"/>
704   We use the terms "<x:dfn>upstream</x:dfn>" and "<x:dfn>downstream</x:dfn>"
705   to describe various requirements in relation to the directional flow of a
706   message: all messages flow from upstream to downstream.
707   Likewise, we use the terms inbound and outbound to refer to
708   directions in relation to the request path:
709   "<x:dfn>inbound</x:dfn>" means toward the origin server and
710   "<x:dfn>outbound</x:dfn>" means toward the user agent.
712<t><iref primary="true" item="proxy"/>
713   A "<x:dfn>proxy</x:dfn>" is a message forwarding agent that is selected by the
714   client, usually via local configuration rules, to receive requests
715   for some type(s) of absolute URI and attempt to satisfy those
716   requests via translation through the HTTP interface.  Some translations
717   are minimal, such as for proxy requests for "http" URIs, whereas
718   other requests might require translation to and from entirely different
719   application-layer protocols. Proxies are often used to group an
720   organization's HTTP requests through a common intermediary for the
721   sake of security, annotation services, or shared caching.
724<iref primary="true" item="transforming proxy"/>
725<iref primary="true" item="non-transforming proxy"/>
726   An HTTP-to-HTTP proxy is called a "<x:dfn>transforming proxy</x:dfn>" if it is designed
727   or configured to modify request or response messages in a semantically
728   meaningful way (i.e., modifications, beyond those required by normal
729   HTTP processing, that change the message in a way that would be
730   significant to the original sender or potentially significant to
731   downstream recipients).  For example, a transforming proxy might be
732   acting as a shared annotation server (modifying responses to include
733   references to a local annotation database), a malware filter, a
734   format transcoder, or an intranet-to-Internet privacy filter.  Such
735   transformations are presumed to be desired by the client (or client
736   organization) that selected the proxy and are beyond the scope of
737   this specification.  However, when a proxy is not intended to transform
738   a given message, we use the term "<x:dfn>non-transforming proxy</x:dfn>" to target
739   requirements that preserve HTTP message semantics. See &status-203; and
740   &header-warning; for status and warning codes related to transformations.
742<t><iref primary="true" item="gateway"/><iref primary="true" item="reverse proxy"/>
743<iref primary="true" item="accelerator"/>
744   A "<x:dfn>gateway</x:dfn>" (a.k.a., "<x:dfn>reverse proxy</x:dfn>")
745   is a receiving agent that acts
746   as a layer above some other server(s) and translates the received
747   requests to the underlying server's protocol.  Gateways are often
748   used to encapsulate legacy or untrusted information services, to
749   improve server performance through "<x:dfn>accelerator</x:dfn>" caching, and to
750   enable partitioning or load-balancing of HTTP services across
751   multiple machines.
754   A gateway behaves as an origin server on its outbound connection and
755   as a user agent on its inbound connection.
756   All HTTP requirements applicable to an origin server
757   also apply to the outbound communication of a gateway.
758   A gateway communicates with inbound servers using any protocol that
759   it desires, including private extensions to HTTP that are outside
760   the scope of this specification.  However, an HTTP-to-HTTP gateway
761   that wishes to interoperate with third-party HTTP servers &MUST;
762   comply with HTTP user agent requirements on the gateway's inbound
763   connection and &MUST; implement the Connection
764   (<xref target="header.connection"/>) and Via (<xref target="header.via"/>)
765   header fields for both connections.
767<t><iref primary="true" item="tunnel"/>
768   A "<x:dfn>tunnel</x:dfn>" acts as a blind relay between two connections
769   without changing the messages. Once active, a tunnel is not
770   considered a party to the HTTP communication, though the tunnel might
771   have been initiated by an HTTP request. A tunnel ceases to exist when
772   both ends of the relayed connection are closed. Tunnels are used to
773   extend a virtual connection through an intermediary, such as when
774   transport-layer security is used to establish private communication
775   through a shared firewall proxy.
777<t><iref primary="true" item="interception proxy"/><iref primary="true" item="transparent proxy"/>
778<iref primary="true" item="captive portal"/>
779   In addition, there may exist network intermediaries that are not
780   considered part of the HTTP communication but nevertheless act as
781   filters or redirecting agents (usually violating HTTP semantics,
782   causing security problems, and otherwise making a mess of things).
783   Such a network intermediary, often referred to as an "<x:dfn>interception proxy</x:dfn>"
784   <xref target="RFC3040"/>, "<x:dfn>transparent proxy</x:dfn>" <xref target="RFC1919"/>,
785   or "<x:dfn>captive portal</x:dfn>",
786   differs from an HTTP proxy because it has not been selected by the client.
787   Instead, the network intermediary redirects outgoing TCP port 80 packets
788   (and occasionally other common port traffic) to an internal HTTP server.
789   Interception proxies are commonly found on public network access points,
790   as a means of enforcing account subscription prior to allowing use of
791   non-local Internet services, and within corporate firewalls to enforce
792   network usage policies.
793   They are indistinguishable from a man-in-the-middle attack.
797<section title="Caches" anchor="caches">
798<iref primary="true" item="cache"/>
800   A "<x:dfn>cache</x:dfn>" is a local store of previous response messages and the
801   subsystem that controls its message storage, retrieval, and deletion.
802   A cache stores cacheable responses in order to reduce the response
803   time and network bandwidth consumption on future, equivalent
804   requests. Any client or server &MAY; employ a cache, though a cache
805   cannot be used by a server while it is acting as a tunnel.
808   The effect of a cache is that the request/response chain is shortened
809   if one of the participants along the chain has a cached response
810   applicable to that request. The following illustrates the resulting
811   chain if B has a cached copy of an earlier response from O (via C)
812   for a request which has not been cached by UA or A.
814<figure><artwork type="drawing">
815            &gt;             &gt;
816       UA =========== A =========== B - - - - - - C - - - - - - O
817                  &lt;             &lt;
819<t><iref primary="true" item="cacheable"/>
820   A response is "<x:dfn>cacheable</x:dfn>" if a cache is allowed to store a copy of
821   the response message for use in answering subsequent requests.
822   Even when a response is cacheable, there might be additional
823   constraints placed by the client or by the origin server on when
824   that cached response can be used for a particular request. HTTP
825   requirements for cache behavior and cacheable responses are
826   defined in &caching-overview;. 
829   There are a wide variety of architectures and configurations
830   of caches and proxies deployed across the World Wide Web and
831   inside large organizations. These systems include national hierarchies
832   of proxy caches to save transoceanic bandwidth, systems that
833   broadcast or multicast cache entries, organizations that distribute
834   subsets of cached data via optical media, and so on.
838<section title="Protocol Versioning" anchor="http.version">
839  <x:anchor-alias value="HTTP-Version"/>
840  <x:anchor-alias value="HTTP-Prot-Name"/>
842   HTTP uses a "&lt;major&gt;.&lt;minor&gt;" numbering scheme to indicate
843   versions of the protocol. This specification defines version "1.1".
844   The protocol version as a whole indicates the sender's compliance
845   with the set of requirements laid out in that version's corresponding
846   specification of HTTP.
849   The version of an HTTP message is indicated by an HTTP-Version field
850   in the first line of the message. HTTP-Version is case-sensitive.
852<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="HTTP-Version"/><iref primary="true" item="Grammar" subitem="HTTP-Prot-Name"/>
853  <x:ref>HTTP-Version</x:ref>   = <x:ref>HTTP-Prot-Name</x:ref> "/" <x:ref>DIGIT</x:ref> "." <x:ref>DIGIT</x:ref>
854  <x:ref>HTTP-Prot-Name</x:ref> = <x:abnf-char-sequence>"HTTP"</x:abnf-char-sequence> ; "HTTP", case-sensitive
857   The HTTP version number consists of two decimal digits separated by a "."
858   (period or decimal point).  The first digit ("major version") indicates the
859   HTTP messaging syntax, whereas the second digit ("minor version") indicates
860   the highest minor version to which the sender is at least conditionally
861   compliant and able to understand for future communication.  The minor
862   version advertises the sender's communication capabilities even when the
863   sender is only using a backwards-compatible subset of the protocol,
864   thereby letting the recipient know that more advanced features can
865   be used in response (by servers) or in future requests (by clients).
868   When an HTTP/1.1 message is sent to an HTTP/1.0 recipient
869   <xref target="RFC1945"/> or a recipient whose version is unknown,
870   the HTTP/1.1 message is constructed such that it can be interpreted
871   as a valid HTTP/1.0 message if all of the newer features are ignored.
872   This specification places recipient-version requirements on some
873   new features so that a compliant sender will only use compatible
874   features until it has determined, through configuration or the
875   receipt of a message, that the recipient supports HTTP/1.1.
878   The interpretation of an HTTP header field does not change
879   between minor versions of the same major version, though the default
880   behavior of a recipient in the absence of such a field can change.
881   Unless specified otherwise, header fields defined in HTTP/1.1 are
882   defined for all versions of HTTP/1.x.  In particular, the Host and
883   Connection header fields ought to be implemented by all HTTP/1.x
884   implementations whether or not they advertise compliance with HTTP/1.1.
887   New header fields can be defined such that, when they are
888   understood by a recipient, they might override or enhance the
889   interpretation of previously defined header fields.  When an
890   implementation receives an unrecognized header field, the recipient
891   &MUST; ignore that header field for local processing regardless of
892   the message's HTTP version.  An unrecognized header field received
893   by a proxy &MUST; be forwarded downstream unless the header field's
894   field-name is listed in the message's Connection header-field
895   (see <xref target="header.connection"/>).
896   These requirements allow HTTP's functionality to be enhanced without
897   requiring prior update of all compliant intermediaries.
900   Intermediaries that process HTTP messages (i.e., all intermediaries
901   other than those acting as a tunnel) &MUST; send their own HTTP-Version
902   in forwarded messages.  In other words, they &MUST-NOT; blindly
903   forward the first line of an HTTP message without ensuring that the
904   protocol version matches what the intermediary understands, and
905   is at least conditionally compliant to, for both the receiving and
906   sending of messages.  Forwarding an HTTP message without rewriting
907   the HTTP-Version might result in communication errors when downstream
908   recipients use the message sender's version to determine what features
909   are safe to use for later communication with that sender.
912   An HTTP client &SHOULD; send a request version equal to the highest
913   version for which the client is at least conditionally compliant and
914   whose major version is no higher than the highest version supported
915   by the server, if this is known.  An HTTP client &MUST-NOT; send a
916   version for which it is not at least conditionally compliant.
919   An HTTP client &MAY; send a lower request version if it is known that
920   the server incorrectly implements the HTTP specification, but only
921   after the client has attempted at least one normal request and determined
922   from the response status or header fields (e.g., Server) that the
923   server improperly handles higher request versions.
926   An HTTP server &SHOULD; send a response version equal to the highest
927   version for which the server is at least conditionally compliant and
928   whose major version is less than or equal to the one received in the
929   request.  An HTTP server &MUST-NOT; send a version for which it is not
930   at least conditionally compliant.  A server &MAY; send a 505 (HTTP
931   Version Not Supported) response if it cannot send a response using the
932   major version used in the client's request.
935   An HTTP server &MAY; send an HTTP/1.0 response to an HTTP/1.0 request
936   if it is known or suspected that the client incorrectly implements the
937   HTTP specification and is incapable of correctly processing later
938   version responses, such as when a client fails to parse the version
939   number correctly or when an intermediary is known to blindly forward
940   the HTTP-Version even when it doesn't comply with the given minor
941   version of the protocol. Such protocol downgrades &SHOULD-NOT; be
942   performed unless triggered by specific client attributes, such as when
943   one or more of the request header fields (e.g., User-Agent) uniquely
944   match the values sent by a client known to be in error.
947   The intention of HTTP's versioning design is that the major number
948   will only be incremented if an incompatible message syntax is
949   introduced, and that the minor number will only be incremented when
950   changes made to the protocol have the effect of adding to the message
951   semantics or implying additional capabilities of the sender.  However,
952   the minor version was not incremented for the changes introduced between
953   <xref target="RFC2068"/> and <xref target="RFC2616"/>, and this revision
954   is specifically avoiding any such changes to the protocol.
958<section title="Uniform Resource Identifiers" anchor="uri">
959<iref primary="true" item="resource"/>
961   Uniform Resource Identifiers (URIs) <xref target="RFC3986"/> are used
962   throughout HTTP as the means for identifying resources. URI references
963   are used to target requests, indicate redirects, and define relationships.
964   HTTP does not limit what a resource might be; it merely defines an interface
965   that can be used to interact with a resource via HTTP. More information on
966   the scope of URIs and resources can be found in <xref target="RFC3986"/>.
968  <x:anchor-alias value="URI-reference"/>
969  <x:anchor-alias value="absolute-URI"/>
970  <x:anchor-alias value="relative-part"/>
971  <x:anchor-alias value="authority"/>
972  <x:anchor-alias value="path-abempty"/>
973  <x:anchor-alias value="path-absolute"/>
974  <x:anchor-alias value="port"/>
975  <x:anchor-alias value="query"/>
976  <x:anchor-alias value="uri-host"/>
977  <x:anchor-alias value="partial-URI"/>
979   This specification adopts the definitions of "URI-reference",
980   "absolute-URI", "relative-part", "port", "host",
981   "path-abempty", "path-absolute", "query", and "authority" from the
982   URI generic syntax <xref target="RFC3986"/>.
983   In addition, we define a partial-URI rule for protocol elements
984   that allow a relative URI but not a fragment.
986<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="URI-reference"/><iref primary="true" item="Grammar" subitem="absolute-URI"/><iref primary="true" item="Grammar" subitem="authority"/><iref primary="true" item="Grammar" subitem="path-absolute"/><iref primary="true" item="Grammar" subitem="port"/><iref primary="true" item="Grammar" subitem="query"/><iref primary="true" item="Grammar" subitem="uri-host"/>
987  <x:ref>URI-reference</x:ref> = &lt;URI-reference, defined in <xref target="RFC3986" x:fmt="," x:sec="4.1"/>&gt;
988  <x:ref>absolute-URI</x:ref>  = &lt;absolute-URI, defined in <xref target="RFC3986" x:fmt="," x:sec="4.3"/>&gt;
989  <x:ref>relative-part</x:ref> = &lt;relative-part, defined in <xref target="RFC3986" x:fmt="," x:sec="4.2"/>&gt;
990  <x:ref>authority</x:ref>     = &lt;authority, defined in <xref target="RFC3986" x:fmt="," x:sec="3.2"/>&gt;
991  <x:ref>path-abempty</x:ref>  = &lt;path-abempty, defined in <xref target="RFC3986" x:fmt="," x:sec="3.3"/>&gt;
992  <x:ref>path-absolute</x:ref> = &lt;path-absolute, defined in <xref target="RFC3986" x:fmt="," x:sec="3.3"/>&gt;
993  <x:ref>port</x:ref>          = &lt;port, defined in <xref target="RFC3986" x:fmt="," x:sec="3.2.3"/>&gt;
994  <x:ref>query</x:ref>         = &lt;query, defined in <xref target="RFC3986" x:fmt="," x:sec="3.4"/>&gt;
995  <x:ref>uri-host</x:ref>      = &lt;host, defined in <xref target="RFC3986" x:fmt="," x:sec="3.2.2"/>&gt;
997  <x:ref>partial-URI</x:ref>   = relative-part [ "?" query ]
1000   Each protocol element in HTTP that allows a URI reference will indicate
1001   in its ABNF production whether the element allows any form of reference
1002   (URI-reference), only a URI in absolute form (absolute-URI), only the
1003   path and optional query components, or some combination of the above.
1004   Unless otherwise indicated, URI references are parsed relative to the
1005   effective request URI, which defines the default base URI for references
1006   in both the request and its corresponding response.
1009<section title="http URI scheme" anchor="http.uri">
1010  <x:anchor-alias value="http-URI"/>
1011  <iref item="http URI scheme" primary="true"/>
1012  <iref item="URI scheme" subitem="http" primary="true"/>
1014   The "http" URI scheme is hereby defined for the purpose of minting
1015   identifiers according to their association with the hierarchical
1016   namespace governed by a potential HTTP origin server listening for
1017   TCP connections on a given port.
1019<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="http-URI"/>
1020  <x:ref>http-URI</x:ref> = "http:" "//" <x:ref>authority</x:ref> <x:ref>path-abempty</x:ref> [ "?" <x:ref>query</x:ref> ]
1023   The HTTP origin server is identified by the generic syntax's
1024   <x:ref>authority</x:ref> component, which includes a host identifier
1025   and optional TCP port (<xref target="RFC3986" x:fmt="," x:sec="3.2.2"/>).
1026   The remainder of the URI, consisting of both the hierarchical path
1027   component and optional query component, serves as an identifier for
1028   a potential resource within that origin server's name space.
1031   If the host identifier is provided as an IP literal or IPv4 address,
1032   then the origin server is any listener on the indicated TCP port at
1033   that IP address. If host is a registered name, then that name is
1034   considered an indirect identifier and the recipient might use a name
1035   resolution service, such as DNS, to find the address of a listener
1036   for that host.
1037   The host &MUST-NOT; be empty; if an "http" URI is received with an
1038   empty host, then it &MUST; be rejected as invalid.
1039   If the port subcomponent is empty or not given, then TCP port 80 is
1040   assumed (the default reserved port for WWW services).
1043   Regardless of the form of host identifier, access to that host is not
1044   implied by the mere presence of its name or address. The host might or might
1045   not exist and, even when it does exist, might or might not be running an
1046   HTTP server or listening to the indicated port. The "http" URI scheme
1047   makes use of the delegated nature of Internet names and addresses to
1048   establish a naming authority (whatever entity has the ability to place
1049   an HTTP server at that Internet name or address) and allows that
1050   authority to determine which names are valid and how they might be used.
1053   When an "http" URI is used within a context that calls for access to the
1054   indicated resource, a client &MAY; attempt access by resolving
1055   the host to an IP address, establishing a TCP connection to that address
1056   on the indicated port, and sending an HTTP request message to the server
1057   containing the URI's identifying data as described in <xref target="request"/>.
1058   If the server responds to that request with a non-interim HTTP response
1059   message, as described in <xref target="response"/>, then that response
1060   is considered an authoritative answer to the client's request.
1063   Although HTTP is independent of the transport protocol, the "http"
1064   scheme is specific to TCP-based services because the name delegation
1065   process depends on TCP for establishing authority.
1066   An HTTP service based on some other underlying connection protocol
1067   would presumably be identified using a different URI scheme, just as
1068   the "https" scheme (below) is used for servers that require an SSL/TLS
1069   transport layer on a connection. Other protocols might also be used to
1070   provide access to "http" identified resources &mdash; it is only the
1071   authoritative interface used for mapping the namespace that is
1072   specific to TCP.
1075   The URI generic syntax for authority also includes a deprecated
1076   userinfo subcomponent (<xref target="RFC3986" x:fmt="," x:sec="3.2.1"/>)
1077   for including user authentication information in the URI.  Some
1078   implementations make use of the userinfo component for internal
1079   configuration of authentication information, such as within command
1080   invocation options, configuration files, or bookmark lists, even
1081   though such usage might expose a user identifier or password.
1082   Senders &MUST-NOT; include a userinfo subcomponent (and its "@"
1083   delimiter) when transmitting an "http" URI in a message.  Recipients
1084   of HTTP messages that contain a URI reference &SHOULD; parse for the
1085   existence of userinfo and treat its presence as an error, likely
1086   indicating that the deprecated subcomponent is being used to obscure
1087   the authority for the sake of phishing attacks.
1091<section title="https URI scheme" anchor="https.uri">
1092   <x:anchor-alias value="https-URI"/>
1093   <iref item="https URI scheme"/>
1094   <iref item="URI scheme" subitem="https"/>
1096   The "https" URI scheme is hereby defined for the purpose of minting
1097   identifiers according to their association with the hierarchical
1098   namespace governed by a potential HTTP origin server listening for
1099   SSL/TLS-secured connections on a given TCP port.
1102   All of the requirements listed above for the "http" scheme are also
1103   requirements for the "https" scheme, except that a default TCP port
1104   of 443 is assumed if the port subcomponent is empty or not given,
1105   and the TCP connection &MUST; be secured for privacy through the
1106   use of strong encryption prior to sending the first HTTP request.
1108<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="https-URI"/>
1109  <x:ref>https-URI</x:ref> = "https:" "//" <x:ref>authority</x:ref> <x:ref>path-abempty</x:ref> [ "?" <x:ref>query</x:ref> ]
1112   Unlike the "http" scheme, responses to "https" identified requests
1113   are never "public" and thus &MUST-NOT; be reused for shared caching.
1114   They can, however, be reused in a private cache if the message is
1115   cacheable by default in HTTP or specifically indicated as such by
1116   the Cache-Control header field (&header-cache-control;).
1119   Resources made available via the "https" scheme have no shared
1120   identity with the "http" scheme even if their resource identifiers
1121   indicate the same authority (the same host listening to the same
1122   TCP port).  They are distinct name spaces and are considered to be
1123   distinct origin servers.  However, an extension to HTTP that is
1124   defined to apply to entire host domains, such as the Cookie protocol
1125   <xref target="RFC6265"/>, can allow information
1126   set by one service to impact communication with other services
1127   within a matching group of host domains.
1130   The process for authoritative access to an "https" identified
1131   resource is defined in <xref target="RFC2818"/>.
1135<section title="http and https URI Normalization and Comparison" anchor="uri.comparison">
1137   Since the "http" and "https" schemes conform to the URI generic syntax,
1138   such URIs are normalized and compared according to the algorithm defined
1139   in <xref target="RFC3986" x:fmt="," x:sec="6"/>, using the defaults
1140   described above for each scheme.
1143   If the port is equal to the default port for a scheme, the normal
1144   form is to elide the port subcomponent. Likewise, an empty path
1145   component is equivalent to an absolute path of "/", so the normal
1146   form is to provide a path of "/" instead. The scheme and host
1147   are case-insensitive and normally provided in lowercase; all
1148   other components are compared in a case-sensitive manner.
1149   Characters other than those in the "reserved" set are equivalent
1150   to their percent-encoded octets (see <xref target="RFC3986"
1151   x:fmt="," x:sec="2.1"/>): the normal form is to not encode them.
1154   For example, the following three URIs are equivalent:
1156<figure><artwork type="example">
1165<section title="Message Format" anchor="http.message">
1166<x:anchor-alias value="generic-message"/>
1167<x:anchor-alias value="message.types"/>
1168<x:anchor-alias value="HTTP-message"/>
1169<x:anchor-alias value="start-line"/>
1170<iref item="header section"/>
1171<iref item="headers"/>
1172<iref item="header field"/>
1174   All HTTP/1.1 messages consist of a start-line followed by a sequence of
1175   octets in a format similar to the Internet Message Format
1176   <xref target="RFC5322"/>: zero or more header fields (collectively
1177   referred to as the "headers" or the "header section"), an empty line
1178   indicating the end of the header section, and an optional message-body.
1181   An HTTP message can either be a request from client to server or a
1182   response from server to client.  Syntactically, the two types of message
1183   differ only in the start-line, which is either a Request-Line (for requests)
1184   or a Status-Line (for responses), and in the algorithm for determining
1185   the length of the message-body (<xref target="message.body"/>).
1186   In theory, a client could receive requests and a server could receive
1187   responses, distinguishing them by their different start-line formats,
1188   but in practice servers are implemented to only expect a request
1189   (a response is interpreted as an unknown or invalid request method)
1190   and clients are implemented to only expect a response.
1192<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="HTTP-message"/>
1193  <x:ref>HTTP-message</x:ref>    = <x:ref>start-line</x:ref>
1194                    *( <x:ref>header-field</x:ref> <x:ref>CRLF</x:ref> )
1195                    <x:ref>CRLF</x:ref>
1196                    [ <x:ref>message-body</x:ref> ]
1197  <x:ref>start-line</x:ref>      = <x:ref>Request-Line</x:ref> / <x:ref>Status-Line</x:ref>
1200   Implementations &MUST-NOT; send whitespace between the start-line and
1201   the first header field. The presence of such whitespace in a request
1202   might be an attempt to trick a server into ignoring that field or
1203   processing the line after it as a new request, either of which might
1204   result in a security vulnerability if other implementations within
1205   the request chain interpret the same message differently.
1206   Likewise, the presence of such whitespace in a response might be
1207   ignored by some clients or cause others to cease parsing.
1210<section title="Message Parsing Robustness" anchor="message.robustness">
1212   In the interest of robustness, servers &SHOULD; ignore at least one
1213   empty line received where a Request-Line is expected. In other words, if
1214   the server is reading the protocol stream at the beginning of a
1215   message and receives a CRLF first, it &SHOULD; ignore the CRLF.
1218   Some old HTTP/1.0 client implementations send an extra CRLF
1219   after a POST request as a lame workaround for some early server
1220   applications that failed to read message-body content that was
1221   not terminated by a line-ending. An HTTP/1.1 client &MUST-NOT;
1222   preface or follow a request with an extra CRLF.  If terminating
1223   the request message-body with a line-ending is desired, then the
1224   client &MUST; include the terminating CRLF octets as part of the
1225   message-body length.
1228   When a server listening only for HTTP request messages, or processing
1229   what appears from the start-line to be an HTTP request message,
1230   receives a sequence of octets that does not match the HTTP-message
1231   grammar aside from the robustness exceptions listed above, the
1232   server &MUST; respond with an HTTP/1.1 400 (Bad Request) response. 
1235   The normal procedure for parsing an HTTP message is to read the
1236   start-line into a structure, read each header field into a hash
1237   table by field name until the empty line, and then use the parsed
1238   data to determine if a message-body is expected.  If a message-body
1239   has been indicated, then it is read as a stream until an amount
1240   of octets equal to the message-body length is read or the connection
1241   is closed.  Care must be taken to parse an HTTP message as a sequence
1242   of octets in an encoding that is a superset of US-ASCII.  Attempting
1243   to parse HTTP as a stream of Unicode characters in a character encoding
1244   like UTF-16 might introduce security flaws due to the differing ways
1245   that such parsers interpret invalid characters.
1248   HTTP allows the set of defined header fields to be extended without
1249   changing the protocol version (see <xref target="header.field.registration"/>).
1250   Unrecognized header fields &MUST; be forwarded by a proxy unless the
1251   proxy is specifically configured to block or otherwise transform such
1252   fields.  Unrecognized header fields &SHOULD; be ignored by other recipients.
1256<section title="Header Fields" anchor="header.fields">
1257  <x:anchor-alias value="header-field"/>
1258  <x:anchor-alias value="field-content"/>
1259  <x:anchor-alias value="field-name"/>
1260  <x:anchor-alias value="field-value"/>
1261  <x:anchor-alias value="OWS"/>
1263   Each HTTP header field consists of a case-insensitive field name
1264   followed by a colon (":"), optional whitespace, and the field value.
1266<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-content"/>
1267  <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>
1268  <x:ref>field-name</x:ref>     = <x:ref>token</x:ref>
1269  <x:ref>field-value</x:ref>    = *( <x:ref>field-content</x:ref> / <x:ref>OWS</x:ref> )
1270  <x:ref>field-content</x:ref>  = *( <x:ref>WSP</x:ref> / <x:ref>VCHAR</x:ref> / <x:ref>obs-text</x:ref> )
1273   No whitespace is allowed between the header field name and colon. For
1274   security reasons, any request message received containing such whitespace
1275   &MUST; be rejected with a response code of 400 (Bad Request). A proxy
1276   &MUST; remove any such whitespace from a response message before
1277   forwarding the message downstream.
1280   A field value &MAY; be preceded by optional whitespace (OWS); a single SP is
1281   preferred. The field value does not include any leading or trailing white
1282   space: OWS occurring before the first non-whitespace octet of the
1283   field value or after the last non-whitespace octet of the field value
1284   is ignored and &SHOULD; be removed before further processing (as this does
1285   not change the meaning of the header field).
1288   The order in which header fields with differing field names are
1289   received is not significant. However, it is "good practice" to send
1290   header fields that contain control data first, such as Host on
1291   requests and Date on responses, so that implementations can decide
1292   when not to handle a message as early as possible.  A server &MUST;
1293   wait until the entire header section is received before interpreting
1294   a request message, since later header fields might include conditionals,
1295   authentication credentials, or deliberately misleading duplicate
1296   header fields that would impact request processing.
1299   Multiple header fields with the same field name &MUST-NOT; be
1300   sent in a message unless the entire field value for that
1301   header field is defined as a comma-separated list [i.e., #(values)].
1302   Multiple header fields with the same field name can be combined into
1303   one "field-name: field-value" pair, without changing the semantics of the
1304   message, by appending each subsequent field value to the combined
1305   field value in order, separated by a comma. The order in which
1306   header fields with the same field name are received is therefore
1307   significant to the interpretation of the combined field value;
1308   a proxy &MUST-NOT; change the order of these field values when
1309   forwarding a message.
1312  <t>
1313   <x:h>Note:</x:h> The "Set-Cookie" header field as implemented in
1314   practice can occur multiple times, but does not use the list syntax, and
1315   thus cannot be combined into a single line (<xref target="RFC6265"/>). (See Appendix A.2.3 of <xref target="Kri2001"/>
1316   for details.) Also note that the Set-Cookie2 header field specified in
1317   <xref target="RFC2965"/> does not share this problem.
1318  </t>
1321   Historically, HTTP header field values could be extended over multiple
1322   lines by preceding each extra line with at least one space or horizontal
1323   tab octet (line folding). This specification deprecates such line
1324   folding except within the message/http media type
1325   (<xref target=""/>).
1326   HTTP/1.1 senders &MUST-NOT; produce messages that include line folding
1327   (i.e., that contain any field-content that matches the obs-fold rule) unless
1328   the message is intended for packaging within the message/http media type.
1329   HTTP/1.1 recipients &SHOULD; accept line folding and replace any embedded
1330   obs-fold whitespace with a single SP prior to interpreting the field value
1331   or forwarding the message downstream.
1334   Historically, HTTP has allowed field content with text in the ISO-8859-1
1335   <xref target="ISO-8859-1"/> character encoding and supported other
1336   character sets only through use of <xref target="RFC2047"/> encoding.
1337   In practice, most HTTP header field values use only a subset of the
1338   US-ASCII character encoding <xref target="USASCII"/>. Newly defined
1339   header fields &SHOULD; limit their field values to US-ASCII octets.
1340   Recipients &SHOULD; treat other (obs-text) octets in field content as
1341   opaque data.
1343<t anchor="rule.comment">
1344  <x:anchor-alias value="comment"/>
1345  <x:anchor-alias value="ctext"/>
1346   Comments can be included in some HTTP header fields by surrounding
1347   the comment text with parentheses. Comments are only allowed in
1348   fields containing "comment" as part of their field value definition.
1350<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="comment"/><iref primary="true" item="Grammar" subitem="ctext"/>
1351  <x:ref>comment</x:ref>        = "(" *( <x:ref>ctext</x:ref> / <x:ref>quoted-cpair</x:ref> / <x:ref>comment</x:ref> ) ")"
1352  <x:ref>ctext</x:ref>          = <x:ref>OWS</x:ref> / %x21-27 / %x2A-5B / %x5D-7E / <x:ref>obs-text</x:ref>
1353                 ; <x:ref>OWS</x:ref> / &lt;<x:ref>VCHAR</x:ref> except "(", ")", and "\"&gt; / <x:ref>obs-text</x:ref>
1355<t anchor="rule.quoted-cpair">
1356  <x:anchor-alias value="quoted-cpair"/>
1357   The backslash octet ("\") can be used as a single-octet
1358   quoting mechanism within comment constructs:
1360<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="quoted-cpair"/>
1361  <x:ref>quoted-cpair</x:ref>    = "\" ( <x:ref>WSP</x:ref> / <x:ref>VCHAR</x:ref> / <x:ref>obs-text</x:ref> )
1364   Senders &SHOULD-NOT; escape octets that do not require escaping
1365   (i.e., other than the backslash octet "\" and the parentheses "(" and
1366   ")").
1369   HTTP does not place a pre-defined limit on the length of header fields,
1370   either in isolation or as a set. A server &MUST; be prepared to receive
1371   request header fields of unbounded length and respond with a 4xx status
1372   code if the received header field(s) would be longer than the server wishes
1373   to handle.
1376   A client that receives response headers that are longer than it wishes to
1377   handle can only treat it as a server error.
1380   Various ad-hoc limitations on header length are found in practice. It is
1381   &RECOMMENDED; that all HTTP senders and recipients support messages whose
1382   combined header fields have 4000 or more octets.
1386<section title="Message Body" anchor="message.body">
1387  <x:anchor-alias value="message-body"/>
1389   The message-body (if any) of an HTTP message is used to carry the
1390   payload body associated with the request or response.
1392<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="message-body"/>
1393  <x:ref>message-body</x:ref> = *OCTET
1396   The message-body differs from the payload body only when a transfer-coding
1397   has been applied, as indicated by the Transfer-Encoding header field
1398   (<xref target="header.transfer-encoding"/>).  If more than one
1399   Transfer-Encoding header field is present in a message, the multiple
1400   field-values &MUST; be combined into one field-value, according to the
1401   algorithm defined in <xref target="header.fields"/>, before determining
1402   the message-body length.
1405   When one or more transfer-codings are applied to a payload in order to
1406   form the message-body, the Transfer-Encoding header field &MUST; contain
1407   the list of transfer-codings applied. Transfer-Encoding is a property of
1408   the message, not of the payload, and thus &MAY; be added or removed by
1409   any implementation along the request/response chain under the constraints
1410   found in <xref target="transfer.codings"/>.
1413   If a message is received that has multiple Content-Length header fields
1414   (<xref target="header.content-length"/>) with field-values consisting
1415   of the same decimal value, or a single Content-Length header field with
1416   a field value containing a list of identical decimal values (e.g.,
1417   "Content-Length: 42, 42"), indicating that duplicate Content-Length
1418   header fields have been generated or combined by an upstream message
1419   processor, then the recipient &MUST; either reject the message as invalid
1420   or replace the duplicated field-values with a single valid Content-Length
1421   field containing that decimal value prior to determining the message-body
1422   length.
1425   The rules for when a message-body is allowed in a message differ for
1426   requests and responses.
1429   The presence of a message-body in a request is signaled by the
1430   inclusion of a Content-Length or Transfer-Encoding header field in
1431   the request's header fields, even if the request method does not
1432   define any use for a message-body.  This allows the request
1433   message framing algorithm to be independent of method semantics.
1436   For response messages, whether or not a message-body is included with
1437   a message is dependent on both the request method and the response
1438   status code (<xref target="status.code.and.reason.phrase"/>).
1439   Responses to the HEAD request method never include a message-body
1440   because the associated response header fields (e.g., Transfer-Encoding,
1441   Content-Length, etc.) only indicate what their values would have been
1442   if the request method had been GET.  All 1xx (Informational), 204 (No Content),
1443   and 304 (Not Modified) responses &MUST-NOT; include a message-body.
1444   All other responses do include a message-body, although the body
1445   &MAY; be of zero length.
1448   The length of the message-body is determined by one of the following
1449   (in order of precedence):
1452  <list style="numbers">
1453    <x:lt><t>
1454     Any response to a HEAD request and any response with a status
1455     code of 100-199, 204, or 304 is always terminated by the first
1456     empty line after the header fields, regardless of the header
1457     fields present in the message, and thus cannot contain a message-body.
1458    </t></x:lt>
1459    <x:lt><t>
1460     If a Transfer-Encoding header field is present
1461     and the "chunked" transfer-coding (<xref target="transfer.codings"/>)
1462     is the final encoding, the message-body length is determined by reading
1463     and decoding the chunked data until the transfer-coding indicates the
1464     data is complete.
1465    </t>
1466    <t>
1467     If a Transfer-Encoding header field is present in a response and the
1468     "chunked" transfer-coding is not the final encoding, the message-body
1469     length is determined by reading the connection until it is closed by
1470     the server.
1471     If a Transfer-Encoding header field is present in a request and the
1472     "chunked" transfer-coding is not the final encoding, the message-body
1473     length cannot be determined reliably; the server &MUST; respond with
1474     the 400 (Bad Request) status code and then close the connection.
1475    </t>
1476    <t>
1477     If a message is received with both a Transfer-Encoding header field
1478     and a Content-Length header field, the Transfer-Encoding overrides
1479     the Content-Length.
1480     Such a message might indicate an attempt to perform request or response
1481     smuggling (bypass of security-related checks on message routing or content)
1482     and thus ought to be handled as an error.  The provided Content-Length &MUST;
1483     be removed, prior to forwarding the message downstream, or replaced with
1484     the real message-body length after the transfer-coding is decoded.
1485    </t></x:lt>
1486    <x:lt><t>
1487     If a message is received without Transfer-Encoding and with either
1488     multiple Content-Length header fields having differing field-values or
1489     a single Content-Length header field having an invalid value, then the
1490     message framing is invalid and &MUST; be treated as an error to
1491     prevent request or response smuggling.
1492     If this is a request message, the server &MUST; respond with
1493     a 400 (Bad Request) status code and then close the connection.
1494     If this is a response message received by a proxy, the proxy
1495     &MUST; discard the received response, send a 502 (Bad Gateway)
1496     status code as its downstream response, and then close the connection.
1497     If this is a response message received by a user-agent, it &MUST; be
1498     treated as an error by discarding the message and closing the connection.
1499    </t></x:lt>
1500    <x:lt><t>
1501     If a valid Content-Length header field
1502     is present without Transfer-Encoding, its decimal value defines the
1503     message-body length in octets.  If the actual number of octets sent in
1504     the message is less than the indicated Content-Length, the recipient
1505     &MUST; consider the message to be incomplete and treat the connection
1506     as no longer usable.
1507     If the actual number of octets sent in the message is more than the indicated
1508     Content-Length, the recipient &MUST; only process the message-body up to the
1509     field value's number of octets; the remainder of the message &MUST; either
1510     be discarded or treated as the next message in a pipeline.  For the sake of
1511     robustness, a user-agent &MAY; attempt to detect and correct such an error
1512     in message framing if it is parsing the response to the last request on
1513     on a connection and the connection has been closed by the server.
1514    </t></x:lt>
1515    <x:lt><t>
1516     If this is a request message and none of the above are true, then the
1517     message-body length is zero (no message-body is present).
1518    </t></x:lt>
1519    <x:lt><t>
1520     Otherwise, this is a response message without a declared message-body
1521     length, so the message-body length is determined by the number of octets
1522     received prior to the server closing the connection.
1523    </t></x:lt>
1524  </list>
1527   Since there is no way to distinguish a successfully completed,
1528   close-delimited message from a partially-received message interrupted
1529   by network failure, implementations &SHOULD; use encoding or
1530   length-delimited messages whenever possible.  The close-delimiting
1531   feature exists primarily for backwards compatibility with HTTP/1.0.
1534   A server &MAY; reject a request that contains a message-body but
1535   not a Content-Length by responding with 411 (Length Required).
1538   Unless a transfer-coding other than "chunked" has been applied,
1539   a client that sends a request containing a message-body &SHOULD;
1540   use a valid Content-Length header field if the message-body length
1541   is known in advance, rather than the "chunked" encoding, since some
1542   existing services respond to "chunked" with a 411 (Length Required)
1543   status code even though they understand the chunked encoding.  This
1544   is typically because such services are implemented via a gateway that
1545   requires a content-length in advance of being called and the server
1546   is unable or unwilling to buffer the entire request before processing.
1549   A client that sends a request containing a message-body &MUST; include a
1550   valid Content-Length header field if it does not know the server will
1551   handle HTTP/1.1 (or later) requests; such knowledge can be in the form
1552   of specific user configuration or by remembering the version of a prior
1553   received response.
1556   Request messages that are prematurely terminated, possibly due to a
1557   cancelled connection or a server-imposed time-out exception, &MUST;
1558   result in closure of the connection; sending an HTTP/1.1 error response
1559   prior to closing the connection is &OPTIONAL;.
1560   Response messages that are prematurely terminated, usually by closure
1561   of the connection prior to receiving the expected number of octets or by
1562   failure to decode a transfer-encoded message-body, &MUST; be recorded
1563   as incomplete.  A user agent &MUST-NOT; render an incomplete response
1564   message-body as if it were complete (i.e., some indication must be given
1565   to the user that an error occurred).  Cache requirements for incomplete
1566   responses are defined in &cache-incomplete;.
1569   A server &MUST; read the entire request message-body or close
1570   the connection after sending its response, since otherwise the
1571   remaining data on a persistent connection would be misinterpreted
1572   as the next request.  Likewise,
1573   a client &MUST; read the entire response message-body if it intends
1574   to reuse the same connection for a subsequent request.  Pipelining
1575   multiple requests on a connection is described in <xref target="pipelining"/>.
1579<section title="General Header Fields" anchor="general.header.fields">
1580  <x:anchor-alias value="general-header"/>
1582   There are a few header fields which have general applicability for
1583   both request and response messages, but which do not apply to the
1584   payload being transferred. These header fields apply only to the
1585   message being transmitted.
1587<texttable align="left">
1588  <ttcol>Header Field Name</ttcol>
1589  <ttcol>Defined in...</ttcol>
1591  <c>Connection</c> <c><xref target="header.connection"/></c>
1592  <c>Date</c> <c><xref target=""/></c>
1593  <c>Trailer</c> <c><xref target="header.trailer"/></c>
1594  <c>Transfer-Encoding</c> <c><xref target="header.transfer-encoding"/></c>
1595  <c>Upgrade</c> <c><xref target="header.upgrade"/></c>
1596  <c>Via</c> <c><xref target="header.via"/></c>
1601<section title="Request" anchor="request">
1602  <x:anchor-alias value="Request"/>
1604   A request message from a client to a server begins with a
1605   Request-Line, followed by zero or more header fields, an empty
1606   line signifying the end of the header block, and an optional
1607   message body.
1609<!--                 Host                      ; should be moved here eventually -->
1610<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Request"/>
1611  <x:ref>Request</x:ref>       = <x:ref>Request-Line</x:ref>              ; <xref target="request-line"/>
1612                  *( <x:ref>header-field</x:ref> <x:ref>CRLF</x:ref> )    ; <xref target="header.fields"/>
1613                  <x:ref>CRLF</x:ref>
1614                  [ <x:ref>message-body</x:ref> ]          ; <xref target="message.body"/>
1617<section title="Request-Line" anchor="request-line">
1618  <x:anchor-alias value="Request-Line"/>
1620   The Request-Line begins with a method token, followed by a single
1621   space (SP), the request-target, another single space (SP), the
1622   protocol version, and ending with CRLF.
1624<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Request-Line"/>
1625  <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>
1628<section title="Method" anchor="method">
1629  <x:anchor-alias value="Method"/>
1631   The Method token indicates the request method to be performed on the
1632   target resource. The request method is case-sensitive.
1634<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Method"/>
1635  <x:ref>Method</x:ref>         = <x:ref>token</x:ref>
1639<section title="request-target" anchor="request-target">
1640  <x:anchor-alias value="request-target"/>
1642   The request-target identifies the target resource upon which to apply
1643   the request.  In most cases, the user agent is provided a URI reference
1644   from which it determines an absolute URI for identifying the target
1645   resource.  When a request to the resource is initiated, all or part
1646   of that URI is used to construct the HTTP request-target.
1648<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="request-target"/>
1649  <x:ref>request-target</x:ref> = "*"
1650                 / <x:ref>absolute-URI</x:ref>
1651                 / ( <x:ref>path-absolute</x:ref> [ "?" <x:ref>query</x:ref> ] )
1652                 / <x:ref>authority</x:ref>
1655   The four options for request-target are dependent on the nature of the
1656   request.
1658<t><iref item="asterisk form (of request-target)"/>
1659   The asterisk "*" form of request-target, which &MUST-NOT; be used
1660   with any request method other than OPTIONS, means that the request
1661   applies to the server as a whole (the listening process) rather than
1662   to a specific named resource at that server.  For example,
1664<figure><artwork type="message/http; msgtype=&#34;request&#34;" x:indent-with="  ">
1665OPTIONS * HTTP/1.1
1667<t><iref item="absolute-URI form (of request-target)"/>
1668   The "absolute-URI" form is &REQUIRED; when the request is being made to a
1669   proxy. The proxy is requested to either forward the request or service it
1670   from a valid cache, and then return the response. Note that the proxy &MAY;
1671   forward the request on to another proxy or directly to the server
1672   specified by the absolute-URI. In order to avoid request loops, a
1673   proxy that forwards requests to other proxies &MUST; be able to
1674   recognize and exclude all of its own server names, including
1675   any aliases, local variations, and the numeric IP address. An example
1676   Request-Line would be:
1678<figure><artwork type="message/http; msgtype=&#34;request&#34;" x:indent-with="  ">
1679GET HTTP/1.1
1682   To allow for transition to absolute-URIs in all requests in future
1683   versions of HTTP, all HTTP/1.1 servers &MUST; accept the absolute-URI
1684   form in requests, even though HTTP/1.1 clients will only generate
1685   them in requests to proxies.
1688   If a proxy receives a host name that is not a fully qualified domain
1689   name, it &MAY; add its domain to the host name it received. If a proxy
1690   receives a fully qualified domain name, the proxy &MUST-NOT; change
1691   the host name.
1693<t><iref item="authority form (of request-target)"/>
1694   The "authority form" is only used by the CONNECT request method (&CONNECT;).
1696<t><iref item="origin form (of request-target)"/>
1697   The most common form of request-target is that used when making
1698   a request to an origin server ("origin form").
1699   In this case, the absolute path and query components of the URI
1700   &MUST; be transmitted as the request-target, and the authority component
1701   &MUST; be transmitted in a Host header field. For example, a client wishing
1702   to retrieve a representation of the resource, as identified above,
1703   directly from the origin server would open (or reuse) a TCP connection
1704   to port 80 of the host "" and send the lines:
1706<figure><artwork type="message/http; msgtype=&#34;request&#34;" x:indent-with="  ">
1707GET /pub/WWW/TheProject.html HTTP/1.1
1711   followed by the remainder of the Request. Note that the origin form
1712   of request-target always starts with an absolute path; if the target
1713   resource's URI path is empty, then an absolute path of "/" &MUST; be
1714   provided in the request-target.
1717   If a proxy receives an OPTIONS request with an absolute-URI form of
1718   request-target in which the URI has an empty path and no query component,
1719   then the last proxy on the request chain &MUST; use a request-target
1720   of "*" when it forwards the request to the indicated origin server.
1723   For example, the request
1724</preamble><artwork type="message/http; msgtype=&#34;request&#34;" x:indent-with="  ">
1728  would be forwarded by the final proxy as
1729</preamble><artwork type="message/http; msgtype=&#34;request&#34;" x:indent-with="  ">
1730OPTIONS * HTTP/1.1
1734   after connecting to port 8001 of host "".
1738   The request-target is transmitted in the format specified in
1739   <xref target="http.uri"/>. If the request-target is percent-encoded
1740   (<xref target="RFC3986" x:fmt="," x:sec="2.1"/>), the origin server
1741   &MUST; decode the request-target in order to
1742   properly interpret the request. Servers &SHOULD; respond to invalid
1743   request-targets with an appropriate status code.
1746   A non-transforming proxy &MUST-NOT; rewrite the "path-absolute" part of the
1747   received request-target when forwarding it to the next inbound server,
1748   except as noted above to replace a null path-absolute with "/" or "*".
1751  <t>
1752    <x:h>Note:</x:h> The "no rewrite" rule prevents the proxy from changing the
1753    meaning of the request when the origin server is improperly using
1754    a non-reserved URI character for a reserved purpose.  Implementors
1755    need to be aware that some pre-HTTP/1.1 proxies have been known to
1756    rewrite the request-target.
1757  </t>
1760   HTTP does not place a pre-defined limit on the length of a request-target.
1761   A server &MUST; be prepared to receive URIs of unbounded length and
1762   respond with the 414 (URI Too Long) status code if the received
1763   request-target would be longer than the server wishes to handle
1764   (see &status-414;).
1767   Various ad-hoc limitations on request-target length are found in practice.
1768   It is &RECOMMENDED; that all HTTP senders and recipients support
1769   request-target lengths of 8000 or more octets.
1772  <t>
1773    <x:h>Note:</x:h> Fragments (<xref target="RFC3986" x:fmt="," x:sec="3.5"/>)
1774    are not part of the request-target and thus will not be transmitted
1775    in an HTTP request.
1776  </t>
1781<section title="The Resource Identified by a Request" anchor="">
1783   The exact resource identified by an Internet request is determined by
1784   examining both the request-target and the Host header field.
1787   An origin server that does not allow resources to differ by the
1788   requested host &MAY; ignore the Host header field value when
1789   determining the resource identified by an HTTP/1.1 request. (But see
1790   <xref target=""/>
1791   for other requirements on Host support in HTTP/1.1.)
1794   An origin server that does differentiate resources based on the host
1795   requested (sometimes referred to as virtual hosts or vanity host
1796   names) &MUST; use the following rules for determining the requested
1797   resource on an HTTP/1.1 request:
1798  <list style="numbers">
1799    <t>If request-target is an absolute-URI, the host is part of the
1800     request-target. Any Host header field value in the request &MUST; be
1801     ignored.</t>
1802    <t>If the request-target is not an absolute-URI, and the request includes
1803     a Host header field, the host is determined by the Host header
1804     field value.</t>
1805    <t>If the host as determined by rule 1 or 2 is not a valid host on
1806     the server, the response &MUST; be a 400 (Bad Request) error message.</t>
1807  </list>
1810   Recipients of an HTTP/1.0 request that lacks a Host header field &MAY;
1811   attempt to use heuristics (e.g., examination of the URI path for
1812   something unique to a particular host) in order to determine what
1813   exact resource is being requested.
1817<section title="Effective Request URI" anchor="effective.request.uri">
1818  <iref primary="true" item="effective request URI"/>
1819  <iref primary="true" item="target resource"/>
1821   HTTP requests often do not carry the absolute URI (<xref target="RFC3986" x:fmt="," x:sec="4.3"/>)
1822   for the target resource; instead, the URI needs to be inferred from the
1823   request-target, Host header field, and connection context. The result of
1824   this process is called the "effective request URI".  The "target resource"
1825   is the resource identified by the effective request URI.
1828   If the request-target is an absolute-URI, then the effective request URI is
1829   the request-target.
1832   If the request-target uses the path-absolute form or the asterisk form,
1833   and the Host header field is present, then the effective request URI is
1834   constructed by concatenating
1837  <list style="symbols">
1838    <t>
1839      the scheme name: "http" if the request was received over an insecure
1840      TCP connection, or "https" when received over a SSL/TLS-secured TCP
1841      connection,
1842    </t>
1843    <t>
1844      the octet sequence "://",
1845    </t>
1846    <t>
1847      the authority component, as specified in the Host header field
1848      (<xref target=""/>), and
1849    </t>
1850    <t>
1851      the request-target obtained from the Request-Line, unless the
1852      request-target is just the asterisk "*".
1853    </t>
1854  </list>
1857   If the request-target uses the path-absolute form or the asterisk form,
1858   and the Host header field is not present, then the effective request URI is
1859   undefined.
1862   Otherwise, when request-target uses the authority form, the effective
1863   request URI is undefined.
1867   Example 1: the effective request URI for the message
1869<artwork type="example" x:indent-with="  ">
1870GET /pub/WWW/TheProject.html HTTP/1.1
1874  (received over an insecure TCP connection) is "http", plus "://", plus the
1875  authority component "", plus the request-target
1876  "/pub/WWW/TheProject.html", thus
1877  "".
1882   Example 2: the effective request URI for the message
1884<artwork type="example" x:indent-with="  ">
1885GET * HTTP/1.1
1889  (received over an SSL/TLS secured TCP connection) is "https", plus "://", plus the
1890  authority component "", thus "".
1894   Effective request URIs are compared using the rules described in
1895   <xref target="uri.comparison"/>, except that empty path components &MUST-NOT;
1896   be treated as equivalent to an absolute path of "/".
1903<section title="Response" anchor="response">
1904  <x:anchor-alias value="Response"/>
1906   After receiving and interpreting a request message, a server responds
1907   with an HTTP response message.
1909<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Response"/>
1910  <x:ref>Response</x:ref>      = <x:ref>Status-Line</x:ref>               ; <xref target="status-line"/>
1911                  *( <x:ref>header-field</x:ref> <x:ref>CRLF</x:ref> )    ; <xref target="header.fields"/>
1912                  <x:ref>CRLF</x:ref>
1913                  [ <x:ref>message-body</x:ref> ]          ; <xref target="message.body"/>
1916<section title="Status-Line" anchor="status-line">
1917  <x:anchor-alias value="Status-Line"/>
1919   The first line of a Response message is the Status-Line, consisting
1920   of the protocol version, a space (SP), the status code, another space,
1921   a possibly-empty textual phrase describing the status code, and
1922   ending with CRLF.
1924<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Status-Line"/>
1925  <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>
1928<section title="Status Code and Reason Phrase" anchor="status.code.and.reason.phrase">
1929  <x:anchor-alias value="Reason-Phrase"/>
1930  <x:anchor-alias value="Status-Code"/>
1932   The Status-Code element is a 3-digit integer result code of the
1933   attempt to understand and satisfy the request. These codes are fully
1934   defined in &status-codes;.  The Reason Phrase exists for the sole
1935   purpose of providing a textual description associated with the numeric
1936   status code, out of deference to earlier Internet application protocols
1937   that were more frequently used with interactive text clients.
1938   A client &SHOULD; ignore the content of the Reason Phrase.
1941   The first digit of the Status-Code defines the class of response. The
1942   last two digits do not have any categorization role. There are 5
1943   values for the first digit:
1944  <list style="symbols">
1945    <t>
1946      1xx: Informational - Request received, continuing process
1947    </t>
1948    <t>
1949      2xx: Success - The action was successfully received,
1950        understood, and accepted
1951    </t>
1952    <t>
1953      3xx: Redirection - Further action must be taken in order to
1954        complete the request
1955    </t>
1956    <t>
1957      4xx: Client Error - The request contains bad syntax or cannot
1958        be fulfilled
1959    </t>
1960    <t>
1961      5xx: Server Error - The server failed to fulfill an apparently
1962        valid request
1963    </t>
1964  </list>
1966<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Status-Code"/><iref primary="true" item="Grammar" subitem="Reason-Phrase"/>
1967  <x:ref>Status-Code</x:ref>    = 3<x:ref>DIGIT</x:ref>
1968  <x:ref>Reason-Phrase</x:ref>  = *( <x:ref>WSP</x:ref> / <x:ref>VCHAR</x:ref> / <x:ref>obs-text</x:ref> )
1976<section title="Protocol Parameters" anchor="protocol.parameters">
1978<section title="Date/Time Formats: Full Date" anchor="">
1979  <x:anchor-alias value="HTTP-date"/>
1981   HTTP applications have historically allowed three different formats
1982   for date/time stamps. However, the preferred format is a fixed-length subset
1983   of that defined by <xref target="RFC1123"/>:
1985<figure><artwork type="example" x:indent-with="  ">
1986Sun, 06 Nov 1994 08:49:37 GMT  ; RFC 1123
1989   The other formats are described here only for compatibility with obsolete
1990   implementations.
1992<figure><artwork type="example" x:indent-with="  ">
1993Sunday, 06-Nov-94 08:49:37 GMT ; obsolete RFC 850 format
1994Sun Nov  6 08:49:37 1994       ; ANSI C's asctime() format
1997   HTTP/1.1 clients and servers that parse a date value &MUST; accept
1998   all three formats (for compatibility with HTTP/1.0), though they &MUST;
1999   only generate the RFC 1123 format for representing HTTP-date values
2000   in header fields. See <xref target="tolerant.applications"/> for further information.
2003   All HTTP date/time stamps &MUST; be represented in Greenwich Mean Time
2004   (GMT), without exception. For the purposes of HTTP, GMT is exactly
2005   equal to UTC (Coordinated Universal Time). This is indicated in the
2006   first two formats by the inclusion of "GMT" as the three-letter
2007   abbreviation for time zone, and &MUST; be assumed when reading the
2008   asctime format. HTTP-date is case sensitive and &MUST-NOT; include
2009   additional whitespace beyond that specifically included as SP in the
2010   grammar.
2012<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="HTTP-date"/>
2013  <x:ref>HTTP-date</x:ref>    = <x:ref>rfc1123-date</x:ref> / <x:ref>obs-date</x:ref>
2015<t anchor="">
2016  <x:anchor-alias value="rfc1123-date"/>
2017  <x:anchor-alias value="time-of-day"/>
2018  <x:anchor-alias value="hour"/>
2019  <x:anchor-alias value="minute"/>
2020  <x:anchor-alias value="second"/>
2021  <x:anchor-alias value="day-name"/>
2022  <x:anchor-alias value="day"/>
2023  <x:anchor-alias value="month"/>
2024  <x:anchor-alias value="year"/>
2025  <x:anchor-alias value="GMT"/>
2026  Preferred format:
2028<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="rfc1123-date"/><iref primary="true" item="Grammar" subitem="date1"/><iref primary="true" item="Grammar" subitem="time-of-day"/><iref primary="true" item="Grammar" subitem="hour"/><iref primary="true" item="Grammar" subitem="minute"/><iref primary="true" item="Grammar" subitem="second"/><iref primary="true" item="Grammar" subitem="day-name"/><iref primary="true" item="Grammar" subitem="day-name-l"/><iref primary="true" item="Grammar" subitem="day"/><iref primary="true" item="Grammar" subitem="month"/><iref primary="true" item="Grammar" subitem="year"/><iref primary="true" item="Grammar" subitem="GMT"/>
2029  <x:ref>rfc1123-date</x:ref> = <x:ref>day-name</x:ref> "," <x:ref>SP</x:ref> date1 <x:ref>SP</x:ref> <x:ref>time-of-day</x:ref> <x:ref>SP</x:ref> <x:ref>GMT</x:ref>
2030  ; fixed length subset of the format defined in
2031  ; <xref target="RFC1123" x:fmt="of" x:sec="5.2.14"/>
2033  <x:ref>day-name</x:ref>     = <x:abnf-char-sequence>"Mon"</x:abnf-char-sequence> ; "Mon", case-sensitive
2034               / <x:abnf-char-sequence>"Tue"</x:abnf-char-sequence> ; "Tue", case-sensitive
2035               / <x:abnf-char-sequence>"Wed"</x:abnf-char-sequence> ; "Wed", case-sensitive
2036               / <x:abnf-char-sequence>"Thu"</x:abnf-char-sequence> ; "Thu", case-sensitive
2037               / <x:abnf-char-sequence>"Fri"</x:abnf-char-sequence> ; "Fri", case-sensitive
2038               / <x:abnf-char-sequence>"Sat"</x:abnf-char-sequence> ; "Sat", case-sensitive
2039               / <x:abnf-char-sequence>"Sun"</x:abnf-char-sequence> ; "Sun", case-sensitive
2041  <x:ref>date1</x:ref>        = <x:ref>day</x:ref> <x:ref>SP</x:ref> <x:ref>month</x:ref> <x:ref>SP</x:ref> <x:ref>year</x:ref>
2042               ; e.g., 02 Jun 1982
2044  <x:ref>day</x:ref>          = 2<x:ref>DIGIT</x:ref>
2045  <x:ref>month</x:ref>        = <x:abnf-char-sequence>"Jan"</x:abnf-char-sequence> ; "Jan", case-sensitive
2046               / <x:abnf-char-sequence>"Feb"</x:abnf-char-sequence> ; "Feb", case-sensitive
2047               / <x:abnf-char-sequence>"Mar"</x:abnf-char-sequence> ; "Mar", case-sensitive
2048               / <x:abnf-char-sequence>"Apr"</x:abnf-char-sequence> ; "Apr", case-sensitive
2049               / <x:abnf-char-sequence>"May"</x:abnf-char-sequence> ; "May", case-sensitive
2050               / <x:abnf-char-sequence>"Jun"</x:abnf-char-sequence> ; "Jun", case-sensitive
2051               / <x:abnf-char-sequence>"Jul"</x:abnf-char-sequence> ; "Jul", case-sensitive
2052               / <x:abnf-char-sequence>"Aug"</x:abnf-char-sequence> ; "Aug", case-sensitive
2053               / <x:abnf-char-sequence>"Sep"</x:abnf-char-sequence> ; "Sep", case-sensitive
2054               / <x:abnf-char-sequence>"Oct"</x:abnf-char-sequence> ; "Oct", case-sensitive
2055               / <x:abnf-char-sequence>"Nov"</x:abnf-char-sequence> ; "Nov", case-sensitive
2056               / <x:abnf-char-sequence>"Dec"</x:abnf-char-sequence> ; "Dec", case-sensitive
2057  <x:ref>year</x:ref>         = 4<x:ref>DIGIT</x:ref>
2059  <x:ref>GMT</x:ref>   = <x:abnf-char-sequence>"GMT"</x:abnf-char-sequence> ; "GMT", case-sensitive
2061  <x:ref>time-of-day</x:ref>  = <x:ref>hour</x:ref> ":" <x:ref>minute</x:ref> ":" <x:ref>second</x:ref>
2062                 ; 00:00:00 - 23:59:59
2064  <x:ref>hour</x:ref>         = 2<x:ref>DIGIT</x:ref>               
2065  <x:ref>minute</x:ref>       = 2<x:ref>DIGIT</x:ref>               
2066  <x:ref>second</x:ref>       = 2<x:ref>DIGIT</x:ref>               
2069  The semantics of <x:ref>day-name</x:ref>, <x:ref>day</x:ref>,
2070  <x:ref>month</x:ref>, <x:ref>year</x:ref>, and <x:ref>time-of-day</x:ref> are the
2071  same as those defined for the RFC 5322 constructs
2072  with the corresponding name (<xref target="RFC5322" x:fmt="," x:sec="3.3"/>).
2074<t anchor="">
2075  <x:anchor-alias value="obs-date"/>
2076  <x:anchor-alias value="rfc850-date"/>
2077  <x:anchor-alias value="asctime-date"/>
2078  <x:anchor-alias value="date1"/>
2079  <x:anchor-alias value="date2"/>
2080  <x:anchor-alias value="date3"/>
2081  <x:anchor-alias value="rfc1123-date"/>
2082  <x:anchor-alias value="day-name-l"/>
2083  Obsolete formats:
2085<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="obs-date"/>
2086  <x:ref>obs-date</x:ref>     = <x:ref>rfc850-date</x:ref> / <x:ref>asctime-date</x:ref>
2088<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="rfc850-date"/>
2089  <x:ref>rfc850-date</x:ref>  = <x:ref>day-name-l</x:ref> "," <x:ref>SP</x:ref> <x:ref>date2</x:ref> <x:ref>SP</x:ref> <x:ref>time-of-day</x:ref> <x:ref>SP</x:ref> <x:ref>GMT</x:ref>
2090  <x:ref>date2</x:ref>        = <x:ref>day</x:ref> "-" <x:ref>month</x:ref> "-" 2<x:ref>DIGIT</x:ref>
2091                 ; day-month-year (e.g., 02-Jun-82)
2093  <x:ref>day-name-l</x:ref>   = <x:abnf-char-sequence>"Monday"</x:abnf-char-sequence> ; "Monday", case-sensitive
2094         / <x:abnf-char-sequence>"Tuesday"</x:abnf-char-sequence> ; "Tuesday", case-sensitive
2095         / <x:abnf-char-sequence>"Wednesday"</x:abnf-char-sequence> ; "Wednesday", case-sensitive
2096         / <x:abnf-char-sequence>"Thursday"</x:abnf-char-sequence> ; "Thursday", case-sensitive
2097         / <x:abnf-char-sequence>"Friday"</x:abnf-char-sequence> ; "Friday", case-sensitive
2098         / <x:abnf-char-sequence>"Saturday"</x:abnf-char-sequence> ; "Saturday", case-sensitive
2099         / <x:abnf-char-sequence>"Sunday"</x:abnf-char-sequence> ; "Sunday", case-sensitive
2101<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="asctime-date"/>
2102  <x:ref>asctime-date</x:ref> = <x:ref>day-name</x:ref> <x:ref>SP</x:ref> <x:ref>date3</x:ref> <x:ref>SP</x:ref> <x:ref>time-of-day</x:ref> <x:ref>SP</x:ref> <x:ref>year</x:ref>
2103  <x:ref>date3</x:ref>        = <x:ref>month</x:ref> <x:ref>SP</x:ref> ( 2<x:ref>DIGIT</x:ref> / ( <x:ref>SP</x:ref> 1<x:ref>DIGIT</x:ref> ))
2104                 ; month day (e.g., Jun  2)
2107  <t>
2108    <x:h>Note:</x:h> Recipients of date values are encouraged to be robust in
2109    accepting date values that might have been sent by non-HTTP
2110    applications, as is sometimes the case when retrieving or posting
2111    messages via proxies/gateways to SMTP or NNTP.
2112  </t>
2115  <t>
2116    <x:h>Note:</x:h> HTTP requirements for the date/time stamp format apply only
2117    to their usage within the protocol stream. Clients and servers are
2118    not required to use these formats for user presentation, request
2119    logging, etc.
2120  </t>
2124<section title="Transfer Codings" anchor="transfer.codings">
2125  <x:anchor-alias value="transfer-coding"/>
2126  <x:anchor-alias value="transfer-extension"/>
2128   Transfer-coding values are used to indicate an encoding
2129   transformation that has been, can be, or might need to be applied to a
2130   payload body in order to ensure "safe transport" through the network.
2131   This differs from a content coding in that the transfer-coding is a
2132   property of the message rather than a property of the representation
2133   that is being transferred.
2135<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="transfer-coding"/><iref primary="true" item="Grammar" subitem="transfer-extension"/>
2136  <x:ref>transfer-coding</x:ref>         = "chunked" ; <xref target="chunked.encoding"/>
2137                          / "compress" ; <xref target="compress.coding"/>
2138                          / "deflate" ; <xref target="deflate.coding"/>
2139                          / "gzip" ; <xref target="gzip.coding"/>
2140                          / <x:ref>transfer-extension</x:ref>
2141  <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> )
2143<t anchor="rule.parameter">
2144  <x:anchor-alias value="attribute"/>
2145  <x:anchor-alias value="transfer-parameter"/>
2146  <x:anchor-alias value="value"/>
2147   Parameters are in the form of attribute/value pairs.
2149<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="transfer-parameter"/><iref primary="true" item="Grammar" subitem="attribute"/><iref primary="true" item="Grammar" subitem="value"/><iref primary="true" item="Grammar" subitem="date2"/><iref primary="true" item="Grammar" subitem="date3"/>
2150  <x:ref>transfer-parameter</x:ref>      = <x:ref>attribute</x:ref> <x:ref>BWS</x:ref> "=" <x:ref>BWS</x:ref> <x:ref>value</x:ref>
2151  <x:ref>attribute</x:ref>               = <x:ref>token</x:ref>
2152  <x:ref>value</x:ref>                   = <x:ref>word</x:ref>
2155   All transfer-coding values are case-insensitive. HTTP/1.1 uses
2156   transfer-coding values in the TE header field (<xref target="header.te"/>) and in
2157   the Transfer-Encoding header field (<xref target="header.transfer-encoding"/>).
2160   Transfer-codings are analogous to the Content-Transfer-Encoding values of
2161   MIME, which were designed to enable safe transport of binary data over a
2162   7-bit transport service (<xref target="RFC2045" x:fmt="," x:sec="6"/>).
2163   However, safe transport
2164   has a different focus for an 8bit-clean transfer protocol. In HTTP,
2165   the only unsafe characteristic of message-bodies is the difficulty in
2166   determining the exact message body length (<xref target="message.body"/>),
2167   or the desire to encrypt data over a shared transport.
2170   A server that receives a request message with a transfer-coding it does
2171   not understand &SHOULD; respond with 501 (Not Implemented) and then
2172   close the connection. A server &MUST-NOT; send transfer-codings to an HTTP/1.0
2173   client.
2176<section title="Chunked Transfer Coding" anchor="chunked.encoding">
2177  <iref item="chunked (Coding Format)"/>
2178  <iref item="Coding Format" subitem="chunked"/>
2179  <x:anchor-alias value="chunk"/>
2180  <x:anchor-alias value="Chunked-Body"/>
2181  <x:anchor-alias value="chunk-data"/>
2182  <x:anchor-alias value="chunk-ext"/>
2183  <x:anchor-alias value="chunk-ext-name"/>
2184  <x:anchor-alias value="chunk-ext-val"/>
2185  <x:anchor-alias value="chunk-size"/>
2186  <x:anchor-alias value="last-chunk"/>
2187  <x:anchor-alias value="trailer-part"/>
2188  <x:anchor-alias value="quoted-str-nf"/>
2189  <x:anchor-alias value="qdtext-nf"/>
2191   The chunked encoding modifies the body of a message in order to
2192   transfer it as a series of chunks, each with its own size indicator,
2193   followed by an &OPTIONAL; trailer containing header fields. This
2194   allows dynamically produced content to be transferred along with the
2195   information necessary for the recipient to verify that it has
2196   received the full message.
2198<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Chunked-Body"/><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="true" item="Grammar" subitem="chunk-ext"/><iref primary="true" item="Grammar" subitem="chunk-ext-name"/><iref primary="true" item="Grammar" subitem="chunk-ext-val"/><iref primary="true" item="Grammar" subitem="chunk-data"/><iref primary="true" item="Grammar" subitem="trailer-part"/><iref primary="true" item="Grammar" subitem="quoted-str-nf"/><iref primary="true" item="Grammar" subitem="qdtext-nf"/>
2199  <x:ref>Chunked-Body</x:ref>   = *<x:ref>chunk</x:ref>
2200                   <x:ref>last-chunk</x:ref>
2201                   <x:ref>trailer-part</x:ref>
2202                   <x:ref>CRLF</x:ref>
2204  <x:ref>chunk</x:ref>          = <x:ref>chunk-size</x:ref> *WSP [ <x:ref>chunk-ext</x:ref> ] <x:ref>CRLF</x:ref>
2205                   <x:ref>chunk-data</x:ref> <x:ref>CRLF</x:ref>
2206  <x:ref>chunk-size</x:ref>     = 1*<x:ref>HEXDIG</x:ref>
2207  <x:ref>last-chunk</x:ref>     = 1*("0") *WSP [ <x:ref>chunk-ext</x:ref> ] <x:ref>CRLF</x:ref>
2209  <x:ref>chunk-ext</x:ref>      = *( ";" *WSP <x:ref>chunk-ext-name</x:ref>
2210                      [ "=" <x:ref>chunk-ext-val</x:ref> ] *WSP )
2211  <x:ref>chunk-ext-name</x:ref> = <x:ref>token</x:ref>
2212  <x:ref>chunk-ext-val</x:ref>  = <x:ref>token</x:ref> / <x:ref>quoted-str-nf</x:ref>
2213  <x:ref>chunk-data</x:ref>     = 1*<x:ref>OCTET</x:ref> ; a sequence of chunk-size octets
2214  <x:ref>trailer-part</x:ref>   = *( <x:ref>header-field</x:ref> <x:ref>CRLF</x:ref> )
2216  <x:ref>quoted-str-nf</x:ref>  = <x:ref>DQUOTE</x:ref> *( <x:ref>qdtext-nf</x:ref> / <x:ref>quoted-pair</x:ref> ) <x:ref>DQUOTE</x:ref>
2217                 ; like <x:ref>quoted-string</x:ref>, but disallowing line folding
2218  <x:ref>qdtext-nf</x:ref>      = <x:ref>WSP</x:ref> / %x21 / %x23-5B / %x5D-7E / <x:ref>obs-text</x:ref>
2219                 ; <x:ref>WSP</x:ref> / &lt;<x:ref>VCHAR</x:ref> except <x:ref>DQUOTE</x:ref> and "\"&gt; / <x:ref>obs-text</x:ref>
2222   The chunk-size field is a string of hex digits indicating the size of
2223   the chunk-data in octets. The chunked encoding is ended by any chunk whose size is
2224   zero, followed by the trailer, which is terminated by an empty line.
2227   The trailer allows the sender to include additional HTTP header
2228   fields at the end of the message. The Trailer header field can be
2229   used to indicate which header fields are included in a trailer (see
2230   <xref target="header.trailer"/>).
2233   A server using chunked transfer-coding in a response &MUST-NOT; use the
2234   trailer for any header fields unless at least one of the following is
2235   true:
2236  <list style="numbers">
2237    <t>the request included a TE header field that indicates "trailers" is
2238     acceptable in the transfer-coding of the  response, as described in
2239     <xref target="header.te"/>; or,</t>
2241    <t>the trailer fields consist entirely of optional metadata, and the
2242    recipient could use the message (in a manner acceptable to the server where
2243    the field originated) without receiving it. In other words, the server that
2244    generated the header (often but not always the origin server) is willing to
2245    accept the possibility that the trailer fields might be silently discarded
2246    along the path to the client.</t>
2247  </list>
2250   This requirement prevents an interoperability failure when the
2251   message is being received by an HTTP/1.1 (or later) proxy and
2252   forwarded to an HTTP/1.0 recipient. It avoids a situation where
2253   compliance with the protocol would have necessitated a possibly
2254   infinite buffer on the proxy.
2257   A process for decoding the "chunked" transfer-coding
2258   can be represented in pseudo-code as:
2260<figure><artwork type="code">
2261  length := 0
2262  read chunk-size, chunk-ext (if any) and CRLF
2263  while (chunk-size &gt; 0) {
2264     read chunk-data and CRLF
2265     append chunk-data to decoded-body
2266     length := length + chunk-size
2267     read chunk-size and CRLF
2268  }
2269  read header-field
2270  while (header-field not empty) {
2271     append header-field to existing header fields
2272     read header-field
2273  }
2274  Content-Length := length
2275  Remove "chunked" from Transfer-Encoding
2278   All HTTP/1.1 applications &MUST; be able to receive and decode the
2279   "chunked" transfer-coding and &MUST; ignore chunk-ext extensions
2280   they do not understand.
2283   Since "chunked" is the only transfer-coding required to be understood
2284   by HTTP/1.1 recipients, it plays a crucial role in delimiting messages
2285   on a persistent connection.  Whenever a transfer-coding is applied to
2286   a payload body in a request, the final transfer-coding applied &MUST;
2287   be "chunked".  If a transfer-coding is applied to a response payload
2288   body, then either the final transfer-coding applied &MUST; be "chunked"
2289   or the message &MUST; be terminated by closing the connection. When the
2290   "chunked" transfer-coding is used, it &MUST; be the last transfer-coding
2291   applied to form the message-body. The "chunked" transfer-coding &MUST-NOT;
2292   be applied more than once in a message-body.
2296<section title="Compression Codings" anchor="compression.codings">
2298   The codings defined below can be used to compress the payload of a
2299   message.
2302   <x:h>Note:</x:h> Use of program names for the identification of encoding formats
2303   is not desirable and is discouraged for future encodings. Their
2304   use here is representative of historical practice, not good
2305   design.
2308   <x:h>Note:</x:h> For compatibility with previous implementations of HTTP,
2309   applications &SHOULD; consider "x-gzip" and "x-compress" to be
2310   equivalent to "gzip" and "compress" respectively.
2313<section title="Compress Coding" anchor="compress.coding">
2314<iref item="compress (Coding Format)"/>
2315<iref item="Coding Format" subitem="compress"/>
2317   The "compress" format is produced by the common UNIX file compression
2318   program "compress". This format is an adaptive Lempel-Ziv-Welch
2319   coding (LZW).
2323<section title="Deflate Coding" anchor="deflate.coding">
2324<iref item="deflate (Coding Format)"/>
2325<iref item="Coding Format" subitem="deflate"/>
2327   The "deflate" format is defined as the "deflate" compression mechanism
2328   (described in <xref target="RFC1951"/>) used inside the "zlib"
2329   data format (<xref target="RFC1950"/>).
2332  <t>
2333    <x:h>Note:</x:h> Some incorrect implementations send the "deflate"
2334    compressed data without the zlib wrapper.
2335   </t>
2339<section title="Gzip Coding" anchor="gzip.coding">
2340<iref item="gzip (Coding Format)"/>
2341<iref item="Coding Format" subitem="gzip"/>
2343   The "gzip" format is produced by the file compression program
2344   "gzip" (GNU zip), as described in <xref target="RFC1952"/>. This format is a
2345   Lempel-Ziv coding (LZ77) with a 32 bit CRC.
2351<section title="Transfer Coding Registry" anchor="transfer.coding.registry">
2353   The HTTP Transfer Coding Registry defines the name space for the transfer
2354   coding names.
2357   Registrations &MUST; include the following fields:
2358   <list style="symbols">
2359     <t>Name</t>
2360     <t>Description</t>
2361     <t>Pointer to specification text</t>
2362   </list>
2365   Names of transfer codings &MUST-NOT; overlap with names of content codings
2366   (&content-codings;), unless the encoding transformation is identical (as it
2367   is the case for the compression codings defined in
2368   <xref target="compression.codings"/>).
2371   Values to be added to this name space require a specification
2372   (see "Specification Required" in <xref target="RFC5226" x:fmt="of" x:sec="4.1"/>), and &MUST;
2373   conform to the purpose of transfer coding defined in this section.
2376   The registry itself is maintained at
2377   <eref target=""/>.
2382<section title="Product Tokens" anchor="product.tokens">
2383  <x:anchor-alias value="product"/>
2384  <x:anchor-alias value="product-version"/>
2386   Product tokens are used to allow communicating applications to
2387   identify themselves by software name and version. Most fields using
2388   product tokens also allow sub-products which form a significant part
2389   of the application to be listed, separated by whitespace. By
2390   convention, the products are listed in order of their significance
2391   for identifying the application.
2393<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="product"/><iref primary="true" item="Grammar" subitem="product-version"/>
2394  <x:ref>product</x:ref>         = <x:ref>token</x:ref> ["/" <x:ref>product-version</x:ref>]
2395  <x:ref>product-version</x:ref> = <x:ref>token</x:ref>
2398   Examples:
2400<figure><artwork type="example">
2401  User-Agent: CERN-LineMode/2.15 libwww/2.17b3
2402  Server: Apache/0.8.4
2405   Product tokens &SHOULD; be short and to the point. They &MUST-NOT; be
2406   used for advertising or other non-essential information. Although any
2407   token octet &MAY; appear in a product-version, this token &SHOULD;
2408   only be used for a version identifier (i.e., successive versions of
2409   the same product &SHOULD; only differ in the product-version portion of
2410   the product value).
2414<section title="Quality Values" anchor="quality.values">
2415  <x:anchor-alias value="qvalue"/>
2417   Both transfer codings (TE request header field, <xref target="header.te"/>)
2418   and content negotiation (&content.negotiation;) use short "floating point"
2419   numbers to indicate the relative importance ("weight") of various
2420   negotiable parameters.  A weight is normalized to a real number in
2421   the range 0 through 1, where 0 is the minimum and 1 the maximum
2422   value. If a parameter has a quality value of 0, then content with
2423   this parameter is "not acceptable" for the client. HTTP/1.1
2424   applications &MUST-NOT; generate more than three digits after the
2425   decimal point. User configuration of these values &SHOULD; also be
2426   limited in this fashion.
2428<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="qvalue"/>
2429  <x:ref>qvalue</x:ref>         = ( "0" [ "." 0*3<x:ref>DIGIT</x:ref> ] )
2430                 / ( "1" [ "." 0*3("0") ] )
2433  <t>
2434     <x:h>Note:</x:h> "Quality values" is a misnomer, since these values merely represent
2435     relative degradation in desired quality.
2436  </t>
2442<section title="Connections" anchor="connections">
2444<section title="Persistent Connections" anchor="persistent.connections">
2446<section title="Purpose" anchor="persistent.purpose">
2448   Prior to persistent connections, a separate TCP connection was
2449   established for each request, increasing the load on HTTP servers
2450   and causing congestion on the Internet. The use of inline images and
2451   other associated data often requires a client to make multiple
2452   requests of the same server in a short amount of time. Analysis of
2453   these performance problems and results from a prototype
2454   implementation are available <xref target="Pad1995"/> <xref target="Spe"/>. Implementation experience and
2455   measurements of actual HTTP/1.1 implementations show good
2456   results <xref target="Nie1997"/>. Alternatives have also been explored, for example,
2457   T/TCP <xref target="Tou1998"/>.
2460   Persistent HTTP connections have a number of advantages:
2461  <list style="symbols">
2462      <t>
2463        By opening and closing fewer TCP connections, CPU time is saved
2464        in routers and hosts (clients, servers, proxies, gateways,
2465        tunnels, or caches), and memory used for TCP protocol control
2466        blocks can be saved in hosts.
2467      </t>
2468      <t>
2469        HTTP requests and responses can be pipelined on a connection.
2470        Pipelining allows a client to make multiple requests without
2471        waiting for each response, allowing a single TCP connection to
2472        be used much more efficiently, with much lower elapsed time.
2473      </t>
2474      <t>
2475        Network congestion is reduced by reducing the number of packets
2476        caused by TCP opens, and by allowing TCP sufficient time to
2477        determine the congestion state of the network.
2478      </t>
2479      <t>
2480        Latency on subsequent requests is reduced since there is no time
2481        spent in TCP's connection opening handshake.
2482      </t>
2483      <t>
2484        HTTP can evolve more gracefully, since errors can be reported
2485        without the penalty of closing the TCP connection. Clients using
2486        future versions of HTTP might optimistically try a new feature,
2487        but if communicating with an older server, retry with old
2488        semantics after an error is reported.
2489      </t>
2490    </list>
2493   HTTP implementations &SHOULD; implement persistent connections.
2497<section title="Overall Operation" anchor="persistent.overall">
2499   A significant difference between HTTP/1.1 and earlier versions of
2500   HTTP is that persistent connections are the default behavior of any
2501   HTTP connection. That is, unless otherwise indicated, the client
2502   &SHOULD; assume that the server will maintain a persistent connection,
2503   even after error responses from the server.
2506   Persistent connections provide a mechanism by which a client and a
2507   server can signal the close of a TCP connection. This signaling takes
2508   place using the Connection header field (<xref target="header.connection"/>). Once a close
2509   has been signaled, the client &MUST-NOT; send any more requests on that
2510   connection.
2513<section title="Negotiation" anchor="persistent.negotiation">
2515   An HTTP/1.1 server &MAY; assume that a HTTP/1.1 client intends to
2516   maintain a persistent connection unless a Connection header field including
2517   the connection-token "close" was sent in the request. If the server
2518   chooses to close the connection immediately after sending the
2519   response, it &SHOULD; send a Connection header field including the
2520   connection-token "close".
2523   An HTTP/1.1 client &MAY; expect a connection to remain open, but would
2524   decide to keep it open based on whether the response from a server
2525   contains a Connection header field with the connection-token close. In case
2526   the client does not want to maintain a connection for more than that
2527   request, it &SHOULD; send a Connection header field including the
2528   connection-token close.
2531   If either the client or the server sends the close token in the
2532   Connection header field, that request becomes the last one for the
2533   connection.
2536   Clients and servers &SHOULD-NOT;  assume that a persistent connection is
2537   maintained for HTTP versions less than 1.1 unless it is explicitly
2538   signaled. See <xref target="compatibility.with.http.1.0.persistent.connections"/> for more information on backward
2539   compatibility with HTTP/1.0 clients.
2542   In order to remain persistent, all messages on the connection &MUST;
2543   have a self-defined message length (i.e., one not defined by closure
2544   of the connection), as described in <xref target="message.body"/>.
2548<section title="Pipelining" anchor="pipelining">
2550   A client that supports persistent connections &MAY; "pipeline" its
2551   requests (i.e., send multiple requests without waiting for each
2552   response). A server &MUST; send its responses to those requests in the
2553   same order that the requests were received.
2556   Clients which assume persistent connections and pipeline immediately
2557   after connection establishment &SHOULD; be prepared to retry their
2558   connection if the first pipelined attempt fails. If a client does
2559   such a retry, it &MUST-NOT; pipeline before it knows the connection is
2560   persistent. Clients &MUST; also be prepared to resend their requests if
2561   the server closes the connection before sending all of the
2562   corresponding responses.
2565   Clients &SHOULD-NOT; pipeline requests using non-idempotent request methods or
2566   non-idempotent sequences of request methods (see &idempotent-methods;). Otherwise, a
2567   premature termination of the transport connection could lead to
2568   indeterminate results. A client wishing to send a non-idempotent
2569   request &SHOULD; wait to send that request until it has received the
2570   response status line for the previous request.
2575<section title="Proxy Servers" anchor="persistent.proxy">
2577   It is especially important that proxies correctly implement the
2578   properties of the Connection header field as specified in <xref target="header.connection"/>.
2581   The proxy server &MUST; signal persistent connections separately with
2582   its clients and the origin servers (or other proxy servers) that it
2583   connects to. Each persistent connection applies to only one transport
2584   link.
2587   A proxy server &MUST-NOT; establish a HTTP/1.1 persistent connection
2588   with an HTTP/1.0 client (but see <xref x:sec="19.7.1" x:fmt="of" target="RFC2068"/>
2589   for information and discussion of the problems with the Keep-Alive header field
2590   implemented by many HTTP/1.0 clients).
2593<section title="End-to-end and Hop-by-hop Header Fields" anchor="end-to-end.and.hop-by-hop.header-fields">
2595  <cref anchor="TODO-end-to-end" source="jre">
2596    Restored from <eref target=""/>.
2597    See also <eref target=""/>.
2598  </cref>
2601   For the purpose of defining the behavior of caches and non-caching
2602   proxies, we divide HTTP header fields into two categories:
2603  <list style="symbols">
2604      <t>End-to-end header fields, which are  transmitted to the ultimate
2605        recipient of a request or response. End-to-end header fields in
2606        responses MUST be stored as part of a cache entry and &MUST; be
2607        transmitted in any response formed from a cache entry.</t>
2609      <t>Hop-by-hop header fields, which are meaningful only for a single
2610        transport-level connection, and are not stored by caches or
2611        forwarded by proxies.</t>
2612  </list>
2615   The following HTTP/1.1 header fields are hop-by-hop header fields:
2616  <list style="symbols">
2617      <t>Connection</t>
2618      <t>Keep-Alive</t>
2619      <t>Proxy-Authenticate</t>
2620      <t>Proxy-Authorization</t>
2621      <t>TE</t>
2622      <t>Trailer</t>
2623      <t>Transfer-Encoding</t>
2624      <t>Upgrade</t>
2625  </list>
2628   All other header fields defined by HTTP/1.1 are end-to-end header fields.
2631   Other hop-by-hop header fields &MUST; be listed in a Connection header field
2632   (<xref target="header.connection"/>).
2636<section title="Non-modifiable Header Fields" anchor="non-modifiable.header-fields">
2638  <cref anchor="TODO-non-mod-headers" source="jre">
2639    Restored from <eref target=""/>.
2640    See also <eref target=""/>.
2641  </cref>
2644   Some features of HTTP/1.1, such as Digest Authentication, depend on the
2645   value of certain end-to-end header fields. A non-transforming proxy &SHOULD-NOT;
2646   modify an end-to-end header field unless the definition of that header field requires
2647   or specifically allows that.
2650   A non-transforming proxy &MUST-NOT; modify any of the following fields in a
2651   request or response, and it &MUST-NOT; add any of these fields if not
2652   already present:
2653  <list style="symbols">
2654    <t>Allow</t>
2655    <t>Content-Location</t>
2656    <t>Content-MD5</t>
2657    <t>ETag</t>
2658    <t>Last-Modified</t>
2659    <t>Server</t>
2660  </list>
2663   A non-transforming proxy &MUST-NOT; modify any of the following fields in a
2664   response:
2665  <list style="symbols">
2666    <t>Expires</t>
2667  </list>
2670   but it &MAY; add any of these fields if not already present. If an
2671   Expires header field is added, it &MUST; be given a field-value identical to
2672   that of the Date header field in that response.
2675   A proxy &MUST-NOT; modify or add any of the following fields in a
2676   message that contains the no-transform cache-control directive, or in
2677   any request:
2678  <list style="symbols">
2679    <t>Content-Encoding</t>
2680    <t>Content-Range</t>
2681    <t>Content-Type</t>
2682  </list>
2685   A transforming proxy &MAY; modify or add these fields to a message
2686   that does not include no-transform, but if it does so, it &MUST; add a
2687   Warning 214 (Transformation applied) if one does not already appear
2688   in the message (see &header-warning;).
2691  <t>
2692    <x:h>Warning:</x:h> Unnecessary modification of end-to-end header fields might
2693    cause authentication failures if stronger authentication
2694    mechanisms are introduced in later versions of HTTP. Such
2695    authentication mechanisms &MAY; rely on the values of header fields
2696    not listed here.
2697  </t>
2700   A non-transforming proxy &MUST; preserve the message payload (&payload;),
2701   though it &MAY; change the message-body through application or removal
2702   of a transfer-coding (<xref target="transfer.codings"/>).
2708<section title="Practical Considerations" anchor="persistent.practical">
2710   Servers will usually have some time-out value beyond which they will
2711   no longer maintain an inactive connection. Proxy servers might make
2712   this a higher value since it is likely that the client will be making
2713   more connections through the same server. The use of persistent
2714   connections places no requirements on the length (or existence) of
2715   this time-out for either the client or the server.
2718   When a client or server wishes to time-out it &SHOULD; issue a graceful
2719   close on the transport connection. Clients and servers &SHOULD; both
2720   constantly watch for the other side of the transport close, and
2721   respond to it as appropriate. If a client or server does not detect
2722   the other side's close promptly it could cause unnecessary resource
2723   drain on the network.
2726   A client, server, or proxy &MAY; close the transport connection at any
2727   time. For example, a client might have started to send a new request
2728   at the same time that the server has decided to close the "idle"
2729   connection. From the server's point of view, the connection is being
2730   closed while it was idle, but from the client's point of view, a
2731   request is in progress.
2734   This means that clients, servers, and proxies &MUST; be able to recover
2735   from asynchronous close events. Client software &SHOULD; reopen the
2736   transport connection and retransmit the aborted sequence of requests
2737   without user interaction so long as the request sequence is
2738   idempotent (see &idempotent-methods;). Non-idempotent request methods or sequences
2739   &MUST-NOT; be automatically retried, although user agents &MAY; offer a
2740   human operator the choice of retrying the request(s). Confirmation by
2741   user-agent software with semantic understanding of the application
2742   &MAY; substitute for user confirmation. The automatic retry &SHOULD-NOT;
2743   be repeated if the second sequence of requests fails.
2746   Servers &SHOULD; always respond to at least one request per connection,
2747   if at all possible. Servers &SHOULD-NOT;  close a connection in the
2748   middle of transmitting a response, unless a network or client failure
2749   is suspected.
2752   Clients (including proxies) &SHOULD; limit the number of simultaneous
2753   connections that they maintain to a given server (including proxies).
2756   Previous revisions of HTTP gave a specific number of connections as a
2757   ceiling, but this was found to be impractical for many applications. As a
2758   result, this specification does not mandate a particular maximum number of
2759   connections, but instead encourages clients to be conservative when opening
2760   multiple connections.
2763   In particular, while using multiple connections avoids the "head-of-line
2764   blocking" problem (whereby a request that takes significant server-side
2765   processing and/or has a large payload can block subsequent requests on the
2766   same connection), each connection used consumes server resources (sometimes
2767   significantly), and furthermore using multiple connections can cause
2768   undesirable side effects in congested networks.
2771   Note that servers might reject traffic that they deem abusive, including an
2772   excessive number of connections from a client.
2777<section title="Message Transmission Requirements" anchor="message.transmission.requirements">
2779<section title="Persistent Connections and Flow Control" anchor="persistent.flow">
2781   HTTP/1.1 servers &SHOULD; maintain persistent connections and use TCP's
2782   flow control mechanisms to resolve temporary overloads, rather than
2783   terminating connections with the expectation that clients will retry.
2784   The latter technique can exacerbate network congestion.
2788<section title="Monitoring Connections for Error Status Messages" anchor="persistent.monitor">
2790   An HTTP/1.1 (or later) client sending a message-body &SHOULD; monitor
2791   the network connection for an error status code while it is transmitting
2792   the request. If the client sees an error status code, it &SHOULD;
2793   immediately cease transmitting the body. If the body is being sent
2794   using a "chunked" encoding (<xref target="transfer.codings"/>), a zero length chunk and
2795   empty trailer &MAY; be used to prematurely mark the end of the message.
2796   If the body was preceded by a Content-Length header field, the client &MUST;
2797   close the connection.
2801<section title="Use of the 100 (Continue) Status" anchor="use.of.the.100.status">
2803   The purpose of the 100 (Continue) status code (see &status-100;) is to
2804   allow a client that is sending a request message with a request body
2805   to determine if the origin server is willing to accept the request
2806   (based on the request header fields) before the client sends the request
2807   body. In some cases, it might either be inappropriate or highly
2808   inefficient for the client to send the body if the server will reject
2809   the message without looking at the body.
2812   Requirements for HTTP/1.1 clients:
2813  <list style="symbols">
2814    <t>
2815        If a client will wait for a 100 (Continue) response before
2816        sending the request body, it &MUST; send an Expect header
2817        field (&header-expect;) with the "100-continue" expectation.
2818    </t>
2819    <t>
2820        A client &MUST-NOT; send an Expect header field (&header-expect;)
2821        with the "100-continue" expectation if it does not intend
2822        to send a request body.
2823    </t>
2824  </list>
2827   Because of the presence of older implementations, the protocol allows
2828   ambiguous situations in which a client might send "Expect: 100-continue"
2829   without receiving either a 417 (Expectation Failed)
2830   or a 100 (Continue) status code. Therefore, when a client sends this
2831   header field to an origin server (possibly via a proxy) from which it
2832   has never seen a 100 (Continue) status code, the client &SHOULD-NOT; 
2833   wait for an indefinite period before sending the request body.
2836   Requirements for HTTP/1.1 origin servers:
2837  <list style="symbols">
2838    <t> Upon receiving a request which includes an Expect header
2839        field with the "100-continue" expectation, an origin server &MUST;
2840        either respond with 100 (Continue) status code and continue to read
2841        from the input stream, or respond with a final status code. The
2842        origin server &MUST-NOT; wait for the request body before sending
2843        the 100 (Continue) response. If it responds with a final status
2844        code, it &MAY; close the transport connection or it &MAY; continue
2845        to read and discard the rest of the request.  It &MUST-NOT;
2846        perform the request method if it returns a final status code.
2847    </t>
2848    <t> An origin server &SHOULD-NOT;  send a 100 (Continue) response if
2849        the request message does not include an Expect header
2850        field with the "100-continue" expectation, and &MUST-NOT; send a
2851        100 (Continue) response if such a request comes from an HTTP/1.0
2852        (or earlier) client. There is an exception to this rule: for
2853        compatibility with <xref target="RFC2068"/>, a server &MAY; send a 100 (Continue)
2854        status code in response to an HTTP/1.1 PUT or POST request that does
2855        not include an Expect header field with the "100-continue"
2856        expectation. This exception, the purpose of which is
2857        to minimize any client processing delays associated with an
2858        undeclared wait for 100 (Continue) status code, applies only to
2859        HTTP/1.1 requests, and not to requests with any other HTTP-version
2860        value.
2861    </t>
2862    <t> An origin server &MAY; omit a 100 (Continue) response if it has
2863        already received some or all of the request body for the
2864        corresponding request.
2865    </t>
2866    <t> An origin server that sends a 100 (Continue) response &MUST;
2867    ultimately send a final status code, once the request body is
2868        received and processed, unless it terminates the transport
2869        connection prematurely.
2870    </t>
2871    <t> If an origin server receives a request that does not include an
2872        Expect header field with the "100-continue" expectation,
2873        the request includes a request body, and the server responds
2874        with a final status code before reading the entire request body
2875        from the transport connection, then the server &SHOULD-NOT;  close
2876        the transport connection until it has read the entire request,
2877        or until the client closes the connection. Otherwise, the client
2878        might not reliably receive the response message. However, this
2879        requirement is not be construed as preventing a server from
2880        defending itself against denial-of-service attacks, or from
2881        badly broken client implementations.
2882      </t>
2883    </list>
2886   Requirements for HTTP/1.1 proxies:
2887  <list style="symbols">
2888    <t> If a proxy receives a request that includes an Expect header
2889        field with the "100-continue" expectation, and the proxy
2890        either knows that the next-hop server complies with HTTP/1.1 or
2891        higher, or does not know the HTTP version of the next-hop
2892        server, it &MUST; forward the request, including the Expect header
2893        field.
2894    </t>
2895    <t> If the proxy knows that the version of the next-hop server is
2896        HTTP/1.0 or lower, it &MUST-NOT; forward the request, and it &MUST;
2897        respond with a 417 (Expectation Failed) status code.
2898    </t>
2899    <t> Proxies &SHOULD; maintain a cache recording the HTTP version
2900        numbers received from recently-referenced next-hop servers.
2901    </t>
2902    <t> A proxy &MUST-NOT; forward a 100 (Continue) response if the
2903        request message was received from an HTTP/1.0 (or earlier)
2904        client and did not include an Expect header field with
2905        the "100-continue" expectation. This requirement overrides the
2906        general rule for forwarding of 1xx responses (see &status-1xx;).
2907    </t>
2908  </list>
2912<section title="Client Behavior if Server Prematurely Closes Connection" anchor="connection.premature">
2914   If an HTTP/1.1 client sends a request which includes a request body,
2915   but which does not include an Expect header field with the
2916   "100-continue" expectation, and if the client is not directly
2917   connected to an HTTP/1.1 origin server, and if the client sees the
2918   connection close before receiving a status line from the server, the
2919   client &SHOULD; retry the request.  If the client does retry this
2920   request, it &MAY; use the following "binary exponential backoff"
2921   algorithm to be assured of obtaining a reliable response:
2922  <list style="numbers">
2923    <t>
2924      Initiate a new connection to the server
2925    </t>
2926    <t>
2927      Transmit the request-line, header fields, and the CRLF that
2928      indicates the end of header fields.
2929    </t>
2930    <t>
2931      Initialize a variable R to the estimated round-trip time to the
2932         server (e.g., based on the time it took to establish the
2933         connection), or to a constant value of 5 seconds if the round-trip
2934         time is not available.
2935    </t>
2936    <t>
2937       Compute T = R * (2**N), where N is the number of previous
2938         retries of this request.
2939    </t>
2940    <t>
2941       Wait either for an error response from the server, or for T
2942         seconds (whichever comes first)
2943    </t>
2944    <t>
2945       If no error response is received, after T seconds transmit the
2946         body of the request.
2947    </t>
2948    <t>
2949       If client sees that the connection is closed prematurely,
2950         repeat from step 1 until the request is accepted, an error
2951         response is received, or the user becomes impatient and
2952         terminates the retry process.
2953    </t>
2954  </list>
2957   If at any point an error status code is received, the client
2958  <list style="symbols">
2959      <t>&SHOULD-NOT;  continue and</t>
2961      <t>&SHOULD; close the connection if it has not completed sending the
2962        request message.</t>
2963    </list>
2970<section title="Miscellaneous notes that might disappear" anchor="misc">
2971<section title="Scheme aliases considered harmful" anchor="scheme.aliases">
2973   <cref anchor="TBD-aliases-harmful">describe why aliases like webcal are harmful.</cref>
2977<section title="Use of HTTP for proxy communication" anchor="http.proxy">
2979   <cref anchor="TBD-proxy-other">Configured to use HTTP to proxy HTTP or other protocols.</cref>
2983<section title="Interception of HTTP for access control" anchor="http.intercept">
2985   <cref anchor="TBD-intercept">Interception of HTTP traffic for initiating access control.</cref>
2989<section title="Use of HTTP by other protocols" anchor="http.others">
2991   <cref anchor="TBD-profiles">Profiles of HTTP defined by other protocol.
2992   Extensions of HTTP like WebDAV.</cref>
2996<section title="Use of HTTP by media type specification" anchor="">
2998   <cref anchor="TBD-hypertext">Instructions on composing HTTP requests via hypertext formats.</cref>
3003<section title="Header Field Definitions" anchor="header.field.definitions">
3005   This section defines the syntax and semantics of HTTP header fields
3006   related to message framing and transport protocols.
3009<section title="Connection" anchor="header.connection">
3010  <iref primary="true" item="Connection header field" x:for-anchor=""/>
3011  <iref primary="true" item="Header Fields" subitem="Connection" x:for-anchor=""/>
3012  <x:anchor-alias value="Connection"/>
3013  <x:anchor-alias value="connection-token"/>
3015   The "Connection" header field allows the sender to specify
3016   options that are desired only for that particular connection.
3017   Such connection options &MUST; be removed or replaced before the
3018   message can be forwarded downstream by a proxy or gateway.
3019   This mechanism also allows the sender to indicate which HTTP
3020   header fields used in the message are only intended for the
3021   immediate recipient ("hop-by-hop"), as opposed to all recipients
3022   on the chain ("end-to-end"), enabling the message to be
3023   self-descriptive and allowing future connection-specific extensions
3024   to be deployed in HTTP without fear that they will be blindly
3025   forwarded by previously deployed intermediaries.
3028   The Connection header field's value has the following grammar:
3030<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Connection"/><iref primary="true" item="Grammar" subitem="connection-token"/>
3031  <x:ref>Connection</x:ref>       = 1#<x:ref>connection-token</x:ref>
3032  <x:ref>connection-token</x:ref> = <x:ref>token</x:ref>
3035   A proxy or gateway &MUST; parse a received Connection
3036   header field before a message is forwarded and, for each
3037   connection-token in this field, remove any header field(s) from
3038   the message with the same name as the connection-token, and then
3039   remove the Connection header field itself or replace it with the
3040   sender's own connection options for the forwarded message.
3043   A sender &MUST-NOT; include field-names in the Connection header
3044   field-value for fields that are defined as expressing constraints
3045   for all recipients in the request or response chain, such as the
3046   Cache-Control header field (&header-cache-control;).
3049   The connection options do not have to correspond to a header field
3050   present in the message, since a connection-specific header field
3051   might not be needed if there are no parameters associated with that
3052   connection option.  Recipients that trigger certain connection
3053   behavior based on the presence of connection options &MUST; do so
3054   based on the presence of the connection-token rather than only the
3055   presence of the optional header field.  In other words, if the
3056   connection option is received as a header field but not indicated
3057   within the Connection field-value, then the recipient &MUST; ignore
3058   the connection-specific header field because it has likely been
3059   forwarded by an intermediary that is only partially compliant.
3062   When defining new connection options, specifications ought to
3063   carefully consider existing deployed header fields and ensure
3064   that the new connection-token does not share the same name as
3065   an unrelated header field that might already be deployed.
3066   Defining a new connection-token essentially reserves that potential
3067   field-name for carrying additional information related to the
3068   connection option, since it would be unwise for senders to use
3069   that field-name for anything else.
3072   HTTP/1.1 defines the "close" connection option for the sender to
3073   signal that the connection will be closed after completion of the
3074   response. For example,
3076<figure><artwork type="example">
3077  Connection: close
3080   in either the request or the response header fields indicates that
3081   the connection &SHOULD-NOT;  be considered "persistent" (<xref target="persistent.connections"/>)
3082   after the current request/response is complete.
3085   An HTTP/1.1 client that does not support persistent connections &MUST;
3086   include the "close" connection option in every request message.
3089   An HTTP/1.1 server that does not support persistent connections &MUST;
3090   include the "close" connection option in every response message that
3091   does not have a 1xx (Informational) status code.
3095<section title="Content-Length" anchor="header.content-length">
3096  <iref primary="true" item="Content-Length header field" x:for-anchor=""/>
3097  <iref primary="true" item="Header Fields" subitem="Content-Length" x:for-anchor=""/>
3098  <x:anchor-alias value="Content-Length"/>
3100   The "Content-Length" header field indicates the size of the
3101   message-body, in decimal number of octets, for any message other than
3102   a response to a HEAD request or a response with a status code of 304.
3103   In the case of a response to a HEAD request, Content-Length indicates
3104   the size of the payload body (not including any potential transfer-coding)
3105   that would have been sent had the request been a GET.
3106   In the case of a 304 (Not Modified) response to a GET request,
3107   Content-Length indicates the size of the payload body (not including
3108   any potential transfer-coding) that would have been sent in a 200 (OK)
3109   response.
3111<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Length"/>
3112  <x:ref>Content-Length</x:ref> = 1*<x:ref>DIGIT</x:ref>
3115   An example is
3117<figure><artwork type="example">
3118  Content-Length: 3495
3121   Implementations &SHOULD; use this field to indicate the message-body
3122   length when no transfer-coding is being applied and the
3123   payload's body length can be determined prior to being transferred.
3124   <xref target="message.body"/> describes how recipients determine the length
3125   of a message-body.
3128   Any Content-Length greater than or equal to zero is a valid value.
3131   Note that the use of this field in HTTP is significantly different from
3132   the corresponding definition in MIME, where it is an optional field
3133   used within the "message/external-body" content-type.
3137<section title="Date" anchor="">
3138  <iref primary="true" item="Date header field" x:for-anchor=""/>
3139  <iref primary="true" item="Header Fields" subitem="Date" x:for-anchor=""/>
3140  <x:anchor-alias value="Date"/>
3142   The "Date" header field represents the date and time at which
3143   the message was originated, having the same semantics as the Origination
3144   Date Field (orig-date) defined in <xref target="RFC5322" x:fmt="of" x:sec="3.6.1"/>.
3145   The field value is an HTTP-date, as described in <xref target=""/>;
3146   it &MUST; be sent in rfc1123-date format.
3148<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Date"/>
3149  <x:ref>Date</x:ref> = <x:ref>HTTP-date</x:ref>
3152   An example is
3154<figure><artwork type="example">
3155  Date: Tue, 15 Nov 1994 08:12:31 GMT
3158   Origin servers &MUST; include a Date header field in all responses,
3159   except in these cases:
3160  <list style="numbers">
3161      <t>If the response status code is 100 (Continue) or 101 (Switching
3162         Protocols), the response &MAY; include a Date header field, at
3163         the server's option.</t>
3165      <t>If the response status code conveys a server error, e.g., 500
3166         (Internal Server Error) or 503 (Service Unavailable), and it is
3167         inconvenient or impossible to generate a valid Date.</t>
3169      <t>If the server does not have a clock that can provide a
3170         reasonable approximation of the current time, its responses
3171         &MUST-NOT; include a Date header field. In this case, the rules
3172         in <xref target="clockless.origin.server.operation"/> &MUST; be followed.</t>
3173  </list>
3176   A received message that does not have a Date header field &MUST; be
3177   assigned one by the recipient if the message will be cached by that
3178   recipient.
3181   Clients can use the Date header field as well; in order to keep request
3182   messages small, they are advised not to include it when it doesn't convey
3183   any useful information (as it is usually the case for requests that do not
3184   contain a payload).
3187   The HTTP-date sent in a Date header field &SHOULD-NOT;  represent a date and
3188   time subsequent to the generation of the message. It &SHOULD; represent
3189   the best available approximation of the date and time of message
3190   generation, unless the implementation has no means of generating a
3191   reasonably accurate date and time. In theory, the date ought to
3192   represent the moment just before the payload is generated. In
3193   practice, the date can be generated at any time during the message
3194   origination without affecting its semantic value.
3197<section title="Clockless Origin Server Operation" anchor="clockless.origin.server.operation">
3199   Some origin server implementations might not have a clock available.
3200   An origin server without a clock &MUST-NOT; assign Expires or Last-Modified
3201   values to a response, unless these values were associated
3202   with the resource by a system or user with a reliable clock. It &MAY;
3203   assign an Expires value that is known, at or before server
3204   configuration time, to be in the past (this allows "pre-expiration"
3205   of responses without storing separate Expires values for each
3206   resource).
3211<section title="Host" anchor="">
3212  <iref primary="true" item="Host header field" x:for-anchor=""/>
3213  <iref primary="true" item="Header Fields" subitem="Host" x:for-anchor=""/>
3214  <x:anchor-alias value="Host"/>
3216   The "Host" header field in a request provides the host and port
3217   information from the target resource's URI, enabling the origin
3218   server to distinguish between resources while servicing requests
3219   for multiple host names on a single IP address.  Since the Host
3220   field-value is critical information for handling a request, it
3221   &SHOULD; be sent as the first header field following the Request-Line.
3223<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Host"/>
3224  <x:ref>Host</x:ref> = <x:ref>uri-host</x:ref> [ ":" <x:ref>port</x:ref> ] ; <xref target="http.uri"/>
3227   A client &MUST; send a Host header field in all HTTP/1.1 request
3228   messages.  If the target resource's URI includes an authority
3229   component, then the Host field-value &MUST; be identical to that
3230   authority component after excluding any userinfo (<xref target="http.uri"/>).
3231   If the authority component is missing or undefined for the target
3232   resource's URI, then the Host header field &MUST; be sent with an
3233   empty field-value.
3236   For example, a GET request to the origin server for
3237   &lt;; would begin with:
3239<figure><artwork type="message/http; msgtype=&#34;request&#34;" x:indent-with="  ">
3240GET /pub/WWW/ HTTP/1.1
3244   The Host header field &MUST; be sent in an HTTP/1.1 request even
3245   if the request-target is in the form of an absolute-URI, since this
3246   allows the Host information to be forwarded through ancient HTTP/1.0
3247   proxies that might not have implemented Host.
3250   When an HTTP/1.1 proxy receives a request with a request-target in
3251   the form of an absolute-URI, the proxy &MUST; ignore the received
3252   Host header field (if any) and instead replace it with the host
3253   information of the request-target.  When a proxy forwards a request,
3254   it &MUST; generate the Host header field based on the received
3255   absolute-URI rather than the received Host.
3258   Since the Host header field acts as an application-level routing
3259   mechanism, it is a frequent target for malware seeking to poison
3260   a shared cache or redirect a request to an unintended server.
3261   An interception proxy is particularly vulnerable if it relies on
3262   the Host header field value for redirecting requests to internal
3263   servers, or for use as a cache key in a shared cache, without
3264   first verifying that the intercepted connection is targeting a
3265   valid IP address for that host.
3268   A server &MUST; respond with a 400 (Bad Request) status code to
3269   any HTTP/1.1 request message that lacks a Host header field and
3270   to any request message that contains more than one Host header field
3271   or a Host header field with an invalid field-value.
3274   See Sections <xref target="" format="counter"/>
3275   and <xref target="" format="counter"/>
3276   for other requirements relating to Host.
3280<section title="TE" anchor="header.te">
3281  <iref primary="true" item="TE header field" x:for-anchor=""/>
3282  <iref primary="true" item="Header Fields" subitem="TE" x:for-anchor=""/>
3283  <x:anchor-alias value="TE"/>
3284  <x:anchor-alias value="t-codings"/>
3285  <x:anchor-alias value="te-params"/>
3286  <x:anchor-alias value="te-ext"/>
3288   The "TE" header field indicates what extension transfer-codings
3289   it is willing to accept in the response, and whether or not it is
3290   willing to accept trailer fields in a chunked transfer-coding.
3293   Its value consists of the keyword "trailers" and/or a comma-separated
3294   list of extension transfer-coding names with optional accept
3295   parameters (as described in <xref target="transfer.codings"/>).
3297<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="te-params"/><iref primary="true" item="Grammar" subitem="te-ext"/>
3298  <x:ref>TE</x:ref>        = #<x:ref>t-codings</x:ref>
3299  <x:ref>t-codings</x:ref> = "trailers" / ( <x:ref>transfer-extension</x:ref> [ <x:ref>te-params</x:ref> ] )
3300  <x:ref>te-params</x:ref> = <x:ref>OWS</x:ref> ";" <x:ref>OWS</x:ref> "q=" <x:ref>qvalue</x:ref> *( <x:ref>te-ext</x:ref> )
3301  <x:ref>te-ext</x:ref>    = <x:ref>OWS</x:ref> ";" <x:ref>OWS</x:ref> <x:ref>token</x:ref> [ "=" <x:ref>word</x:ref> ]
3304   The presence of the keyword "trailers" indicates that the client is
3305   willing to accept trailer fields in a chunked transfer-coding, as
3306   defined in <xref target="chunked.encoding"/>. This keyword is reserved for use with
3307   transfer-coding values even though it does not itself represent a
3308   transfer-coding.
3311   Examples of its use are:
3313<figure><artwork type="example">
3314  TE: deflate
3315  TE:
3316  TE: trailers, deflate;q=0.5
3319   The TE header field only applies to the immediate connection.
3320   Therefore, the keyword &MUST; be supplied within a Connection header
3321   field (<xref target="header.connection"/>) whenever TE is present in an HTTP/1.1 message.
3324   A server tests whether a transfer-coding is acceptable, according to
3325   a TE field, using these rules:
3326  <list style="numbers">
3327    <x:lt>
3328      <t>The "chunked" transfer-coding is always acceptable. If the
3329         keyword "trailers" is listed, the client indicates that it is
3330         willing to accept trailer fields in the chunked response on
3331         behalf of itself and any downstream clients. The implication is
3332         that, if given, the client is stating that either all
3333         downstream clients are willing to accept trailer fields in the
3334         forwarded response, or that it will attempt to buffer the
3335         response on behalf of downstream recipients.
3336      </t><t>
3337         <x:h>Note:</x:h> HTTP/1.1 does not define any means to limit the size of a
3338         chunked response such that a client can be assured of buffering
3339         the entire response.</t>
3340    </x:lt>
3341    <x:lt>
3342      <t>If the transfer-coding being tested is one of the transfer-codings
3343         listed in the TE field, then it is acceptable unless it
3344         is accompanied by a qvalue of 0. (As defined in <xref target="quality.values"/>, a
3345         qvalue of 0 means "not acceptable".)</t>
3346    </x:lt>
3347    <x:lt>
3348      <t>If multiple transfer-codings are acceptable, then the
3349         acceptable transfer-coding with the highest non-zero qvalue is
3350         preferred.  The "chunked" transfer-coding always has a qvalue
3351         of 1.</t>
3352    </x:lt>
3353  </list>
3356   If the TE field-value is empty or if no TE field is present, the only
3357   transfer-coding is "chunked". A message with no transfer-coding is
3358   always acceptable.
3362<section title="Trailer" anchor="header.trailer">
3363  <iref primary="true" item="Trailer header field" x:for-anchor=""/>
3364  <iref primary="true" item="Header Fields" subitem="Trailer" x:for-anchor=""/>
3365  <x:anchor-alias value="Trailer"/>
3367   The "Trailer" header field indicates that the given set of
3368   header fields is present in the trailer of a message encoded with
3369   chunked transfer-coding.
3371<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Trailer"/>
3372  <x:ref>Trailer</x:ref> = 1#<x:ref>field-name</x:ref>
3375   An HTTP/1.1 message &SHOULD; include a Trailer header field in a
3376   message using chunked transfer-coding with a non-empty trailer. Doing
3377   so allows the recipient to know which header fields to expect in the
3378   trailer.
3381   If no Trailer header field is present, the trailer &SHOULD-NOT;  include
3382   any header fields. See <xref target="chunked.encoding"/> for restrictions on the use of
3383   trailer fields in a "chunked" transfer-coding.
3386   Message header fields listed in the Trailer header field &MUST-NOT;
3387   include the following header fields:
3388  <list style="symbols">
3389    <t>Transfer-Encoding</t>
3390    <t>Content-Length</t>
3391    <t>Trailer</t>
3392  </list>
3396<section title="Transfer-Encoding" anchor="header.transfer-encoding">
3397  <iref primary="true" item="Transfer-Encoding header field" x:for-anchor=""/>
3398  <iref primary="true" item="Header Fields" subitem="Transfer-Encoding" x:for-anchor=""/>
3399  <x:anchor-alias value="Transfer-Encoding"/>
3401   The "Transfer-Encoding" header field indicates what transfer-codings
3402   (if any) have been applied to the message body. It differs from
3403   Content-Encoding (&content-codings;) in that transfer-codings are a property
3404   of the message (and therefore are removed by intermediaries), whereas
3405   content-codings are not.
3407<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Transfer-Encoding"/>
3408  <x:ref>Transfer-Encoding</x:ref> = 1#<x:ref>transfer-coding</x:ref>
3411   Transfer-codings are defined in <xref target="transfer.codings"/>. An example is:
3413<figure><artwork type="example">
3414  Transfer-Encoding: chunked
3417   If multiple encodings have been applied to a representation, the transfer-codings
3418   &MUST; be listed in the order in which they were applied.
3419   Additional information about the encoding parameters &MAY; be provided
3420   by other header fields not defined by this specification.
3423   Many older HTTP/1.0 applications do not understand the Transfer-Encoding
3424   header field.
3428<section title="Upgrade" anchor="header.upgrade">
3429  <iref primary="true" item="Upgrade header field" x:for-anchor=""/>
3430  <iref primary="true" item="Header Fields" subitem="Upgrade" x:for-anchor=""/>
3431  <x:anchor-alias value="Upgrade"/>
3433   The "Upgrade" header field allows the client to specify what
3434   additional communication protocols it would like to use, if the server
3435   chooses to switch protocols. Servers can use it to indicate what protocols
3436   they are willing to switch to.
3438<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Upgrade"/>
3439  <x:ref>Upgrade</x:ref> = 1#<x:ref>product</x:ref>
3442   For example,
3444<figure><artwork type="example">
3445  Upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11
3448   The Upgrade header field is intended to provide a simple mechanism
3449   for transition from HTTP/1.1 to some other, incompatible protocol. It
3450   does so by allowing the client to advertise its desire to use another
3451   protocol, such as a later version of HTTP with a higher major version
3452   number, even though the current request has been made using HTTP/1.1.
3453   This eases the difficult transition between incompatible protocols by
3454   allowing the client to initiate a request in the more commonly
3455   supported protocol while indicating to the server that it would like
3456   to use a "better" protocol if available (where "better" is determined
3457   by the server, possibly according to the nature of the request method
3458   or target resource).
3461   The Upgrade header field only applies to switching application-layer
3462   protocols upon the existing transport-layer connection. Upgrade
3463   cannot be used to insist on a protocol change; its acceptance and use
3464   by the server is optional. The capabilities and nature of the
3465   application-layer communication after the protocol change is entirely
3466   dependent upon the new protocol chosen, although the first action
3467   after changing the protocol &MUST; be a response to the initial HTTP
3468   request containing the Upgrade header field.
3471   The Upgrade header field only applies to the immediate connection.
3472   Therefore, the upgrade keyword &MUST; be supplied within a Connection
3473   header field (<xref target="header.connection"/>) whenever Upgrade is present in an
3474   HTTP/1.1 message.
3477   The Upgrade header field cannot be used to indicate a switch to a
3478   protocol on a different connection. For that purpose, it is more
3479   appropriate to use a 3xx redirection response (&status-3xx;).
3482   Servers &MUST; include the "Upgrade" header field in 101 (Switching
3483   Protocols) responses to indicate which protocol(s) are being switched to,
3484   and &MUST; include it in 426 (Upgrade Required) responses to indicate
3485   acceptable protocols to upgrade to. Servers &MAY; include it in any other
3486   response to indicate that they are willing to upgrade to one of the
3487   specified protocols.
3490   This specification only defines the protocol name "HTTP" for use by
3491   the family of Hypertext Transfer Protocols, as defined by the HTTP
3492   version rules of <xref target="http.version"/> and future updates to this
3493   specification. Additional tokens can be registered with IANA using the
3494   registration procedure defined below. 
3497<section title="Upgrade Token Registry" anchor="upgrade.token.registry">
3499   The HTTP Upgrade Token Registry defines the name space for product
3500   tokens used to identify protocols in the Upgrade header field.
3501   Each registered token is associated with contact information and
3502   an optional set of specifications that details how the connection
3503   will be processed after it has been upgraded.
3506   Registrations are allowed on a First Come First Served basis as
3507   described in <xref target="RFC5226" x:sec="4.1" x:fmt="of"/>. The
3508   specifications need not be IETF documents or be subject to IESG review.
3509   Registrations are subject to the following rules:
3510  <list style="numbers">
3511    <t>A token, once registered, stays registered forever.</t>
3512    <t>The registration &MUST; name a responsible party for the
3513       registration.</t>
3514    <t>The registration &MUST; name a point of contact.</t>
3515    <t>The registration &MAY; name a set of specifications associated with that
3516       token. Such specifications need not be publicly available.</t>
3517    <t>The responsible party &MAY; change the registration at any time.
3518       The IANA will keep a record of all such changes, and make them
3519       available upon request.</t>
3520    <t>The responsible party for the first registration of a "product"
3521       token &MUST; approve later registrations of a "version" token
3522       together with that "product" token before they can be registered.</t>
3523    <t>If absolutely required, the IESG &MAY; reassign the responsibility
3524       for a token. This will normally only be used in the case when a
3525       responsible party cannot be contacted.</t>
3526  </list>
3533<section title="Via" anchor="header.via">
3534  <iref primary="true" item="Via header field" x:for-anchor=""/>
3535  <iref primary="true" item="Header Fields" subitem="Via" x:for-anchor=""/>
3536  <x:anchor-alias value="protocol-name"/>
3537  <x:anchor-alias value="protocol-version"/>
3538  <x:anchor-alias value="pseudonym"/>
3539  <x:anchor-alias value="received-by"/>
3540  <x:anchor-alias value="received-protocol"/>
3541  <x:anchor-alias value="Via"/>
3543   The "Via" header field &MUST; be sent by a proxy or gateway to
3544   indicate the intermediate protocols and recipients between the user
3545   agent and the server on requests, and between the origin server and
3546   the client on responses. It is analogous to the "Received" field
3547   used by email systems (<xref target="RFC5322" x:fmt="of" x:sec="3.6.7"/>)
3548   and is intended to be used for tracking message forwards,
3549   avoiding request loops, and identifying the protocol capabilities of
3550   all senders along the request/response chain.
3552<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"/>
3553  <x:ref>Via</x:ref>               = 1#( <x:ref>received-protocol</x:ref> <x:ref>RWS</x:ref> <x:ref>received-by</x:ref>
3554                          [ <x:ref>RWS</x:ref> <x:ref>comment</x:ref> ] )
3555  <x:ref>received-protocol</x:ref> = [ <x:ref>protocol-name</x:ref> "/" ] <x:ref>protocol-version</x:ref>
3556  <x:ref>protocol-name</x:ref>     = <x:ref>token</x:ref>
3557  <x:ref>protocol-version</x:ref>  = <x:ref>token</x:ref>
3558  <x:ref>received-by</x:ref>       = ( <x:ref>uri-host</x:ref> [ ":" <x:ref>port</x:ref> ] ) / <x:ref>pseudonym</x:ref>
3559  <x:ref>pseudonym</x:ref>         = <x:ref>token</x:ref>
3562   The received-protocol indicates the protocol version of the message
3563   received by the server or client along each segment of the
3564   request/response chain. The received-protocol version is appended to
3565   the Via field value when the message is forwarded so that information
3566   about the protocol capabilities of upstream applications remains
3567   visible to all recipients.
3570   The protocol-name is excluded if and only if it would be "HTTP". The
3571   received-by field is normally the host and optional port number of a
3572   recipient server or client that subsequently forwarded the message.
3573   However, if the real host is considered to be sensitive information,
3574   it &MAY; be replaced by a pseudonym. If the port is not given, it &MAY;
3575   be assumed to be the default port of the received-protocol.
3578   Multiple Via field values represent each proxy or gateway that has
3579   forwarded the message. Each recipient &MUST; append its information
3580   such that the end result is ordered according to the sequence of
3581   forwarding applications.
3584   Comments &MAY; be used in the Via header field to identify the software
3585   of each recipient, analogous to the User-Agent and Server header fields.
3586   However, all comments in the Via field are optional and &MAY; be removed
3587   by any recipient prior to forwarding the message.
3590   For example, a request message could be sent from an HTTP/1.0 user
3591   agent to an internal proxy code-named "fred", which uses HTTP/1.1 to
3592   forward the request to a public proxy at, which completes
3593   the request by forwarding it to the origin server at
3594   The request received by would then have the following
3595   Via header field:
3597<figure><artwork type="example">
3598  Via: 1.0 fred, 1.1 (Apache/1.1)
3601   A proxy or gateway used as a portal through a network firewall
3602   &SHOULD-NOT; forward the names and ports of hosts within the firewall
3603   region unless it is explicitly enabled to do so. If not enabled, the
3604   received-by host of any host behind the firewall &SHOULD; be replaced
3605   by an appropriate pseudonym for that host.
3608   For organizations that have strong privacy requirements for hiding
3609   internal structures, a proxy or gateway &MAY; combine an ordered
3610   subsequence of Via header field entries with identical received-protocol
3611   values into a single such entry. For example,
3613<figure><artwork type="example">
3614  Via: 1.0 ricky, 1.1 ethel, 1.1 fred, 1.0 lucy
3617  could be collapsed to
3619<figure><artwork type="example">
3620  Via: 1.0 ricky, 1.1 mertz, 1.0 lucy
3623   Senders &SHOULD-NOT; combine multiple entries unless they are all
3624   under the same organizational control and the hosts have already been
3625   replaced by pseudonyms. Senders &MUST-NOT; combine entries which
3626   have different received-protocol values.
3632<section title="IANA Considerations" anchor="IANA.considerations">
3634<section title="Header Field Registration" anchor="header.field.registration">
3636   The Message Header Field Registry located at <eref target=""/> shall be updated
3637   with the permanent registrations below (see <xref target="RFC3864"/>):
3639<?BEGININC p1-messaging.iana-headers ?>
3640<!--AUTOGENERATED FROM extract-header-defs.xslt, do not edit manually-->
3641<texttable align="left" suppress-title="true" anchor="iana.header.registration.table">
3642   <ttcol>Header Field Name</ttcol>
3643   <ttcol>Protocol</ttcol>
3644   <ttcol>Status</ttcol>
3645   <ttcol>Reference</ttcol>
3647   <c>Connection</c>
3648   <c>http</c>
3649   <c>standard</c>
3650   <c>
3651      <xref target="header.connection"/>
3652   </c>
3653   <c>Content-Length</c>
3654   <c>http</c>
3655   <c>standard</c>
3656   <c>
3657      <xref target="header.content-length"/>
3658   </c>
3659   <c>Date</c>
3660   <c>http</c>
3661   <c>standard</c>
3662   <c>
3663      <xref target=""/>
3664   </c>
3665   <c>Host</c>
3666   <c>http</c>
3667   <c>standard</c>
3668   <c>
3669      <xref target=""/>
3670   </c>
3671   <c>TE</c>
3672   <c>http</c>
3673   <c>standard</c>
3674   <c>
3675      <xref target="header.te"/>
3676   </c>
3677   <c>Trailer</c>
3678   <c>http</c>
3679   <c>standard</c>
3680   <c>
3681      <xref target="header.trailer"/>
3682   </c>
3683   <c>Transfer-Encoding</c>
3684   <c>http</c>
3685   <c>standard</c>
3686   <c>
3687      <xref target="header.transfer-encoding"/>
3688   </c>
3689   <c>Upgrade</c>
3690   <c>http</c>
3691   <c>standard</c>
3692   <c>
3693      <xref target="header.upgrade"/>
3694   </c>
3695   <c>Via</c>
3696   <c>http</c>
3697   <c>standard</c>
3698   <c>
3699      <xref target="header.via"/>
3700   </c>
3703<?ENDINC p1-messaging.iana-headers ?>
3705   The change controller is: "IETF ( - Internet Engineering Task Force".
3709<section title="URI Scheme Registration" anchor="uri.scheme.registration">
3711   The entries for the "http" and "https" URI Schemes in the registry located at
3712   <eref target=""/>
3713   shall be updated to point to Sections <xref target="http.uri" format="counter"/>
3714   and <xref target="https.uri" format="counter"/> of this document
3715   (see <xref target="RFC4395"/>).
3719<section title="Internet Media Type Registrations" anchor="">
3721   This document serves as the specification for the Internet media types
3722   "message/http" and "application/http". The following is to be registered with
3723   IANA (see <xref target="RFC4288"/>).
3725<section title="Internet Media Type message/http" anchor="">
3726<iref item="Media Type" subitem="message/http" primary="true"/>
3727<iref item="message/http Media Type" primary="true"/>
3729   The message/http type can be used to enclose a single HTTP request or
3730   response message, provided that it obeys the MIME restrictions for all
3731   "message" types regarding line length and encodings.
3734  <list style="hanging" x:indent="12em">
3735    <t hangText="Type name:">
3736      message
3737    </t>
3738    <t hangText="Subtype name:">
3739      http
3740    </t>
3741    <t hangText="Required parameters:">
3742      none
3743    </t>
3744    <t hangText="Optional parameters:">
3745      version, msgtype
3746      <list style="hanging">
3747        <t hangText="version:">
3748          The HTTP-Version number of the enclosed message
3749          (e.g., "1.1"). If not present, the version can be
3750          determined from the first line of the body.
3751        </t>
3752        <t hangText="msgtype:">
3753          The message type &mdash; "request" or "response". If not
3754          present, the type can be determined from the first
3755          line of the body.
3756        </t>
3757      </list>
3758    </t>
3759    <t hangText="Encoding considerations:">
3760      only "7bit", "8bit", or "binary" are permitted
3761    </t>
3762    <t hangText="Security considerations:">
3763      none
3764    </t>
3765    <t hangText="Interoperability considerations:">
3766      none
3767    </t>
3768    <t hangText="Published specification:">
3769      This specification (see <xref target=""/>).
3770    </t>
3771    <t hangText="Applications that use this media type:">
3772    </t>
3773    <t hangText="Additional information:">
3774      <list style="hanging">
3775        <t hangText="Magic number(s):">none</t>
3776        <t hangText="File extension(s):">none</t>
3777        <t hangText="Macintosh file type code(s):">none</t>
3778      </list>
3779    </t>
3780    <t hangText="Person and email address to contact for further information:">
3781      See Authors Section.
3782    </t>
3783    <t hangText="Intended usage:">
3784      COMMON
3785    </t>
3786    <t hangText="Restrictions on usage:">
3787      none
3788    </t>
3789    <t hangText="Author/Change controller:">
3790      IESG
3791    </t>
3792  </list>
3795<section title="Internet Media Type application/http" anchor="">
3796<iref item="Media Type" subitem="application/http" primary="true"/>
3797<iref item="application/http Media Type" primary="true"/>
3799   The application/http type can be used to enclose a pipeline of one or more
3800   HTTP request or response messages (not intermixed).
3803  <list style="hanging" x:indent="12em">
3804    <t hangText="Type name:">
3805      application
3806    </t>
3807    <t hangText="Subtype name:">
3808      http
3809    </t>
3810    <t hangText="Required parameters:">
3811      none
3812    </t>
3813    <t hangText="Optional parameters:">
3814      version, msgtype
3815      <list style="hanging">
3816        <t hangText="version:">
3817          The HTTP-Version number of the enclosed messages
3818          (e.g., "1.1"). If not present, the version can be
3819          determined from the first line of the body.
3820        </t>
3821        <t hangText="msgtype:">
3822          The message type &mdash; "request" or "response". If not
3823          present, the type can be determined from the first
3824          line of the body.
3825        </t>
3826      </list>
3827    </t>
3828    <t hangText="Encoding considerations:">
3829      HTTP messages enclosed by this type
3830      are in "binary" format; use of an appropriate
3831      Content-Transfer-Encoding is required when
3832      transmitted via E-mail.
3833    </t>
3834    <t hangText="Security considerations:">
3835      none
3836    </t>
3837    <t hangText="Interoperability considerations:">
3838      none
3839    </t>
3840    <t hangText="Published specification:">
3841      This specification (see <xref target=""/>).
3842    </t>
3843    <t hangText="Applications that use this media type:">
3844    </t>
3845    <t hangText="Additional information:">
3846      <list style="hanging">
3847        <t hangText="Magic number(s):">none</t>
3848        <t hangText="File extension(s):">none</t>
3849        <t hangText="Macintosh file type code(s):">none</t>
3850      </list>
3851    </t>
3852    <t hangText="Person and email address to contact for further information:">
3853      See Authors Section.
3854    </t>
3855    <t hangText="Intended usage:">
3856      COMMON
3857    </t>
3858    <t hangText="Restrictions on usage:">
3859      none
3860    </t>
3861    <t hangText="Author/Change controller:">
3862      IESG
3863    </t>
3864  </list>
3869<section title="Transfer Coding Registry" anchor="transfer.coding.registration">
3871   The registration procedure for HTTP Transfer Codings is now defined by
3872   <xref target="transfer.coding.registry"/> of this document.
3875   The HTTP Transfer Codings Registry located at <eref target=""/>
3876   shall be updated with the registrations below:
3878<texttable align="left" suppress-title="true" anchor="iana.transfer.coding.registration.table">
3879   <ttcol>Name</ttcol>
3880   <ttcol>Description</ttcol>
3881   <ttcol>Reference</ttcol>
3882   <c>chunked</c>
3883   <c>Transfer in a series of chunks</c>
3884   <c>
3885      <xref target="chunked.encoding"/>
3886   </c>
3887   <c>compress</c>
3888   <c>UNIX "compress" program method</c>
3889   <c>
3890      <xref target="compress.coding"/>
3891   </c>
3892   <c>deflate</c>
3893   <c>"deflate" compression mechanism (<xref target="RFC1951"/>) used inside
3894   the "zlib" data format (<xref target="RFC1950"/>)
3895   </c>
3896   <c>
3897      <xref target="deflate.coding"/>
3898   </c>
3899   <c>gzip</c>
3900   <c>Same as GNU zip <xref target="RFC1952"/></c>
3901   <c>
3902      <xref target="gzip.coding"/>
3903   </c>
3907<section title="Upgrade Token Registration" anchor="upgrade.token.registration">
3909   The registration procedure for HTTP Upgrade Tokens &mdash; previously defined
3910   in <xref target="RFC2817" x:fmt="of" x:sec="7.2"/> &mdash; is now defined
3911   by <xref target="upgrade.token.registry"/> of this document.
3914   The HTTP Status Code Registry located at <eref target=""/>
3915   shall be updated with the registration below:
3917<texttable align="left" suppress-title="true">
3918   <ttcol>Value</ttcol>
3919   <ttcol>Description</ttcol>
3920   <ttcol>Reference</ttcol>
3922   <c>HTTP</c>
3923   <c>Hypertext Transfer Protocol</c>
3924   <c><xref target="http.version"/> of this specification</c>
3925<!-- IANA should add this without our instructions; emailed on June 05, 2009
3926   <c>TLS/1.0</c>
3927   <c>Transport Layer Security</c>
3928   <c><xref target="RFC2817"/></c> -->
3935<section title="Security Considerations" anchor="security.considerations">
3937   This section is meant to inform application developers, information
3938   providers, and users of the security limitations in HTTP/1.1 as
3939   described by this document. The discussion does not include
3940   definitive solutions to the problems revealed, though it does make
3941   some suggestions for reducing security risks.
3944<section title="Personal Information" anchor="personal.information">
3946   HTTP clients are often privy to large amounts of personal information
3947   (e.g., the user's name, location, mail address, passwords, encryption
3948   keys, etc.), and &SHOULD; be very careful to prevent unintentional
3949   leakage of this information.
3950   We very strongly recommend that a convenient interface be provided
3951   for the user to control dissemination of such information, and that
3952   designers and implementors be particularly careful in this area.
3953   History shows that errors in this area often create serious security
3954   and/or privacy problems and generate highly adverse publicity for the
3955   implementor's company.
3959<section title="Abuse of Server Log Information" anchor="abuse.of.server.log.information">
3961   A server is in the position to save personal data about a user's
3962   requests which might identify their reading patterns or subjects of
3963   interest. This information is clearly confidential in nature and its
3964   handling can be constrained by law in certain countries. People using
3965   HTTP to provide data are responsible for ensuring that
3966   such material is not distributed without the permission of any
3967   individuals that are identifiable by the published results.
3971<section title="Attacks Based On File and Path Names" anchor="attack.pathname">
3973   Implementations of HTTP origin servers &SHOULD; be careful to restrict
3974   the documents returned by HTTP requests to be only those that were
3975   intended by the server administrators. If an HTTP server translates
3976   HTTP URIs directly into file system calls, the server &MUST; take
3977   special care not to serve files that were not intended to be
3978   delivered to HTTP clients. For example, UNIX, Microsoft Windows, and
3979   other operating systems use ".." as a path component to indicate a
3980   directory level above the current one. On such a system, an HTTP
3981   server &MUST; disallow any such construct in the request-target if it
3982   would otherwise allow access to a resource outside those intended to
3983   be accessible via the HTTP server. Similarly, files intended for
3984   reference only internally to the server (such as access control
3985   files, configuration files, and script code) &MUST; be protected from
3986   inappropriate retrieval, since they might contain sensitive
3987   information. Experience has shown that minor bugs in such HTTP server
3988   implementations have turned into security risks.
3992<section title="DNS Spoofing" anchor="dns.spoofing">
3994   Clients using HTTP rely heavily on the Domain Name Service, and are
3995   thus generally prone to security attacks based on the deliberate
3996   mis-association of IP addresses and DNS names. Clients need to be
3997   cautious in assuming the continuing validity of an IP number/DNS name
3998   association.
4001   In particular, HTTP clients &SHOULD; rely on their name resolver for
4002   confirmation of an IP number/DNS name association, rather than
4003   caching the result of previous host name lookups. Many platforms
4004   already can cache host name lookups locally when appropriate, and
4005   they &SHOULD; be configured to do so. It is proper for these lookups to
4006   be cached, however, only when the TTL (Time To Live) information
4007   reported by the name server makes it likely that the cached
4008   information will remain useful.
4011   If HTTP clients cache the results of host name lookups in order to
4012   achieve a performance improvement, they &MUST; observe the TTL
4013   information reported by DNS.
4016   If HTTP clients do not observe this rule, they could be spoofed when
4017   a previously-accessed server's IP address changes. As network
4018   renumbering is expected to become increasingly common <xref target="RFC1900"/>, the
4019   possibility of this form of attack will grow. Observing this
4020   requirement thus reduces this potential security vulnerability.
4023   This requirement also improves the load-balancing behavior of clients
4024   for replicated servers using the same DNS name and reduces the
4025   likelihood of a user's experiencing failure in accessing sites which
4026   use that strategy.
4030<section title="Proxies and Caching" anchor="attack.proxies">
4032   By their very nature, HTTP proxies are men-in-the-middle, and
4033   represent an opportunity for man-in-the-middle attacks. Compromise of
4034   the systems on which the proxies run can result in serious security
4035   and privacy problems. Proxies have access to security-related
4036   information, personal information about individual users and
4037   organizations, and proprietary information belonging to users and
4038   content providers. A compromised proxy, or a proxy implemented or
4039   configured without regard to security and privacy considerations,
4040   might be used in the commission of a wide range of potential attacks.
4043   Proxy operators need to protect the systems on which proxies run as
4044   they would protect any system that contains or transports sensitive
4045   information. In particular, log information gathered at proxies often
4046   contains highly sensitive personal information, and/or information
4047   about organizations. Log information needs to be carefully guarded, and
4048   appropriate guidelines for use need to be developed and followed.
4049   (<xref target="abuse.of.server.log.information"/>).
4052   Proxy implementors need to consider the privacy and security
4053   implications of their design and coding decisions, and of the
4054   configuration options they provide to proxy operators (especially the
4055   default configuration).
4058   Users of a proxy need to be aware that proxies are no trustworthier than
4059   the people who run them; HTTP itself cannot solve this problem.
4062   The judicious use of cryptography, when appropriate, might suffice to
4063   protect against a broad range of security and privacy attacks. Such
4064   cryptography is beyond the scope of the HTTP/1.1 specification.
4068<section title="Protocol Element Size Overflows" anchor="attack.protocol.element.size.overflows">
4070   Because HTTP uses mostly textual, character-delimited fields, attackers can
4071   overflow buffers in implementations, and/or perform a Denial of Service
4072   against implementations that accept fields with unlimited lengths.
4075   To promote interoperability, this specification makes specific
4076   recommendations for size limits on request-targets (<xref target="request-target"/>)
4077   and blocks of header fields (<xref target="header.fields"/>). These are
4078   minimum recommendations, chosen to be supportable even by implementations
4079   with limited resources; it is expected that most implementations will choose
4080   substantially higher limits.
4083   This specification also provides a way for servers to reject messages that
4084   have request-targets that are too long (&status-414;) or request entities
4085   that are too large (&status-4xx;).
4088   Other fields (including but not limited to request methods, response status
4089   phrases, header field-names, and body chunks) &SHOULD; be limited by
4090   implementations carefully, so as to not impede interoperability.
4094<section title="Denial of Service Attacks on Proxies" anchor="attack.DoS">
4096   They exist. They are hard to defend against. Research continues.
4097   Beware.
4102<section title="Acknowledgments" anchor="ack">
4104   HTTP has evolved considerably over the years. It has
4105   benefited from a large and active developer community &mdash; the many
4106   people who have participated on the www-talk mailing list &mdash; and it is
4107   that community which has been most responsible for the success of
4108   HTTP and of the World-Wide Web in general. Marc Andreessen, Robert
4109   Cailliau, Daniel W. Connolly, Bob Denny, John Franks, Jean-Francois
4110   Groff, Phillip M. Hallam-Baker, Hakon W. Lie, Ari Luotonen, Rob
4111   McCool, Lou Montulli, Dave Raggett, Tony Sanders, and Marc
4112   VanHeyningen deserve special recognition for their efforts in
4113   defining early aspects of the protocol.
4116   This document has benefited greatly from the comments of all those
4117   participating in the HTTP-WG. In addition to those already mentioned,
4118   the following individuals have contributed to this specification:
4121   Gary Adams, Harald Tveit Alvestrand, Keith Ball, Brian Behlendorf,
4122   Paul Burchard, Maurizio Codogno, Josh Cohen, Mike Cowlishaw, Roman Czyborra,
4123   Michael A. Dolan, Daniel DuBois, David J. Fiander, Alan Freier, Marc Hedlund, Greg Herlihy,
4124   Koen Holtman, Alex Hopmann, Bob Jernigan, Shel Kaphan, Rohit Khare,
4125   John Klensin, Martijn Koster, Alexei Kosut, David M. Kristol,
4126   Daniel LaLiberte, Ben Laurie, Paul J. Leach, Albert Lunde,
4127   John C. Mallery, Jean-Philippe Martin-Flatin, Mitra, David Morris,
4128   Gavin Nicol, Ross Patterson, Bill Perry, Jeffrey Perry, Scott Powers, Owen Rees,
4129   Luigi Rizzo, David Robinson, Marc Salomon, Rich Salz,
4130   Allan M. Schiffman, Jim Seidman, Chuck Shotton, Eric W. Sink,
4131   Simon E. Spero, Richard N. Taylor, Robert S. Thau,
4132   Bill (BearHeart) Weinman, Francois Yergeau, Mary Ellen Zurko.
4135   Thanks to the "cave men" of Palo Alto. You know who you are.
4138   Jim Gettys (the editor of <xref target="RFC2616"/>) wishes particularly
4139   to thank Roy Fielding, the editor of <xref target="RFC2068"/>, along
4140   with John Klensin, Jeff Mogul, Paul Leach, Dave Kristol, Koen
4141   Holtman, John Franks, Josh Cohen, Alex Hopmann, Scott Lawrence, and
4142   Larry Masinter for their help. And thanks go particularly to Jeff
4143   Mogul and Scott Lawrence for performing the "MUST/MAY/SHOULD" audit.
4146   The Apache Group, Anselm Baird-Smith, author of Jigsaw, and Henrik
4147   Frystyk implemented RFC 2068 early, and we wish to thank them for the
4148   discovery of many of the problems that this document attempts to
4149   rectify.
4152   This specification makes heavy use of the augmented BNF and generic
4153   constructs defined by David H. Crocker for <xref target="RFC5234"/>. Similarly, it
4154   reuses many of the definitions provided by Nathaniel Borenstein and
4155   Ned Freed for MIME <xref target="RFC2045"/>. We hope that their inclusion in this
4156   specification will help reduce past confusion over the relationship
4157   between HTTP and Internet mail message formats.
4161Acknowledgements TODO list
4163- Jeff Hodges ("effective request URI")
4171<references title="Normative References">
4173<reference anchor="ISO-8859-1">
4174  <front>
4175    <title>
4176     Information technology -- 8-bit single-byte coded graphic character sets -- Part 1: Latin alphabet No. 1
4177    </title>
4178    <author>
4179      <organization>International Organization for Standardization</organization>
4180    </author>
4181    <date year="1998"/>
4182  </front>
4183  <seriesInfo name="ISO/IEC" value="8859-1:1998"/>
4186<reference anchor="Part2">
4187  <front>
4188    <title abbrev="HTTP/1.1">HTTP/1.1, part 2: Message Semantics</title>
4189    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
4190      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
4191      <address><email></email></address>
4192    </author>
4193    <author initials="J." surname="Gettys" fullname="Jim Gettys">
4194      <organization abbrev="Alcatel-Lucent">Alcatel-Lucent Bell Labs</organization>
4195      <address><email></email></address>
4196    </author>
4197    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
4198      <organization abbrev="HP">Hewlett-Packard Company</organization>
4199      <address><email></email></address>
4200    </author>
4201    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
4202      <organization abbrev="Microsoft">Microsoft Corporation</organization>
4203      <address><email></email></address>
4204    </author>
4205    <author initials="L." surname="Masinter" fullname="Larry Masinter">
4206      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
4207      <address><email></email></address>
4208    </author>
4209    <author initials="P." surname="Leach" fullname="Paul J. Leach">
4210      <organization abbrev="Microsoft">Microsoft Corporation</organization>
4211      <address><email></email></address>
4212    </author>
4213    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
4214      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
4215      <address><email></email></address>
4216    </author>
4217    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
4218      <organization abbrev="W3C">World Wide Web Consortium</organization>
4219      <address><email></email></address>
4220    </author>
4221    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
4222      <organization abbrev="greenbytes">greenbytes GmbH</organization>
4223      <address><email></email></address>
4224    </author>
4225    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
4226  </front>
4227  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p2-semantics-&ID-VERSION;"/>
4228  <x:source href="p2-semantics.xml" basename="p2-semantics"/>
4231<reference anchor="Part3">
4232  <front>
4233    <title abbrev="HTTP/1.1">HTTP/1.1, part 3: Message Payload and Content Negotiation</title>
4234    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
4235      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
4236      <address><email></email></address>
4237    </author>
4238    <author initials="J." surname="Gettys" fullname="Jim Gettys">
4239      <organization abbrev="Alcatel-Lucent">Alcatel-Lucent Bell Labs</organization>
4240      <address><email></email></address>
4241    </author>
4242    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
4243      <organization abbrev="HP">Hewlett-Packard Company</organization>
4244      <address><email></email></address>
4245    </author>
4246    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
4247      <organization abbrev="Microsoft">Microsoft Corporation</organization>
4248      <address><email></email></address>
4249    </author>
4250    <author initials="L." surname="Masinter" fullname="Larry Masinter">
4251      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
4252      <address><email></email></address>
4253    </author>
4254    <author initials="P." surname="Leach" fullname="Paul J. Leach">
4255      <organization abbrev="Microsoft">Microsoft Corporation</organization>
4256      <address><email></email></address>
4257    </author>
4258    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
4259      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
4260      <address><email></email></address>
4261    </author>
4262    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
4263      <organization abbrev="W3C">World Wide Web Consortium</organization>
4264      <address><email></email></address>
4265    </author>
4266    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
4267      <organization abbrev="greenbytes">greenbytes GmbH</organization>
4268      <address><email></email></address>
4269    </author>
4270    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
4271  </front>
4272  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p3-payload-&ID-VERSION;"/>
4273  <x:source href="p3-payload.xml" basename="p3-payload"/>
4276<reference anchor="Part6">
4277  <front>
4278    <title abbrev="HTTP/1.1">HTTP/1.1, part 6: Caching</title>
4279    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
4280      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
4281      <address><email></email></address>
4282    </author>
4283    <author initials="J." surname="Gettys" fullname="Jim Gettys">
4284      <organization abbrev="Alcatel-Lucent">Alcatel-Lucent Bell Labs</organization>
4285      <address><email></email></address>
4286    </author>
4287    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
4288      <organization abbrev="HP">Hewlett-Packard Company</organization>
4289      <address><email></email></address>
4290    </author>
4291    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
4292      <organization abbrev="Microsoft">Microsoft Corporation</organization>
4293      <address><email></email></address>
4294    </author>
4295    <author initials="L." surname="Masinter" fullname="Larry Masinter">
4296      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
4297      <address><email></email></address>
4298    </author>
4299    <author initials="P." surname="Leach" fullname="Paul J. Leach">
4300      <organization abbrev="Microsoft">Microsoft Corporation</organization>
4301      <address><email></email></address>
4302    </author>
4303    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
4304      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
4305      <address><email></email></address>
4306    </author>
4307    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
4308      <organization abbrev="W3C">World Wide Web Consortium</organization>
4309      <address><email></email></address>
4310    </author>
4311    <author initials="M." surname="Nottingham" fullname="Mark Nottingham" role="editor">
4312      <address><email></email></address>
4313    </author>
4314    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
4315      <organization abbrev="greenbytes">greenbytes GmbH</organization>
4316      <address><email></email></address>
4317    </author>
4318    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
4319  </front>
4320  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p6-cache-&ID-VERSION;"/>
4321  <x:source href="p6-cache.xml" basename="p6-cache"/>
4324<reference anchor="RFC5234">
4325  <front>
4326    <title abbrev="ABNF for Syntax Specifications">Augmented BNF for Syntax Specifications: ABNF</title>
4327    <author initials="D." surname="Crocker" fullname="Dave Crocker" role="editor">
4328      <organization>Brandenburg InternetWorking</organization>
4329      <address>
4330        <email></email>
4331      </address> 
4332    </author>
4333    <author initials="P." surname="Overell" fullname="Paul Overell">
4334      <organization>THUS plc.</organization>
4335      <address>
4336        <email></email>
4337      </address>
4338    </author>
4339    <date month="January" year="2008"/>
4340  </front>
4341  <seriesInfo name="STD" value="68"/>
4342  <seriesInfo name="RFC" value="5234"/>
4345<reference anchor="RFC2119">
4346  <front>
4347    <title>Key words for use in RFCs to Indicate Requirement Levels</title>
4348    <author initials="S." surname="Bradner" fullname="Scott Bradner">
4349      <organization>Harvard University</organization>
4350      <address><email></email></address>
4351    </author>
4352    <date month="March" year="1997"/>
4353  </front>
4354  <seriesInfo name="BCP" value="14"/>
4355  <seriesInfo name="RFC" value="2119"/>
4358<reference anchor="RFC3986">
4359 <front>
4360  <title abbrev='URI Generic Syntax'>Uniform Resource Identifier (URI): Generic Syntax</title>
4361  <author initials='T.' surname='Berners-Lee' fullname='Tim Berners-Lee'>
4362    <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
4363    <address>
4364       <email></email>
4365       <uri></uri>
4366    </address>
4367  </author>
4368  <author initials='R.' surname='Fielding' fullname='Roy T. Fielding'>
4369    <organization abbrev="Day Software">Day Software</organization>
4370    <address>
4371      <email></email>
4372      <uri></uri>
4373    </address>
4374  </author>
4375  <author initials='L.' surname='Masinter' fullname='Larry Masinter'>
4376    <organization abbrev="Adobe Systems">Adobe Systems Incorporated</organization>
4377    <address>
4378      <email></email>
4379      <uri></uri>
4380    </address>
4381  </author>
4382  <date month='January' year='2005'></date>
4383 </front>
4384 <seriesInfo name="STD" value="66"/>
4385 <seriesInfo name="RFC" value="3986"/>
4388<reference anchor="USASCII">
4389  <front>
4390    <title>Coded Character Set -- 7-bit American Standard Code for Information Interchange</title>
4391    <author>
4392      <organization>American National Standards Institute</organization>
4393    </author>
4394    <date year="1986"/>
4395  </front>
4396  <seriesInfo name="ANSI" value="X3.4"/>
4399<reference anchor="RFC1950">
4400  <front>
4401    <title>ZLIB Compressed Data Format Specification version 3.3</title>
4402    <author initials="L.P." surname="Deutsch" fullname="L. Peter Deutsch">
4403      <organization>Aladdin Enterprises</organization>
4404      <address><email></email></address>
4405    </author>
4406    <author initials="J-L." surname="Gailly" fullname="Jean-Loup Gailly"/>
4407    <date month="May" year="1996"/>
4408  </front>
4409  <seriesInfo name="RFC" value="1950"/>
4410  <annotation>
4411    RFC 1950 is an Informational RFC, thus it might be less stable than
4412    this specification. On the other hand, this downward reference was
4413    present since the publication of RFC 2068 in 1997 (<xref target="RFC2068"/>),
4414    therefore it is unlikely to cause problems in practice. See also
4415    <xref target="BCP97"/>.
4416  </annotation>
4419<reference anchor="RFC1951">
4420  <front>
4421    <title>DEFLATE Compressed Data Format Specification version 1.3</title>
4422    <author initials="P." surname="Deutsch" fullname="L. Peter Deutsch">
4423      <organization>Aladdin Enterprises</organization>
4424      <address><email></email></address>
4425    </author>
4426    <date month="May" year="1996"/>
4427  </front>
4428  <seriesInfo name="RFC" value="1951"/>
4429  <annotation>
4430    RFC 1951 is an Informational RFC, thus it might be less stable than
4431    this specification. On the other hand, this downward reference was
4432    present since the publication of RFC 2068 in 1997 (<xref target="RFC2068"/>),
4433    therefore it is unlikely to cause problems in practice. See also
4434    <xref target="BCP97"/>.
4435  </annotation>
4438<reference anchor="RFC1952">
4439  <front>
4440    <title>GZIP file format specification version 4.3</title>
4441    <author initials="P." surname="Deutsch" fullname="L. Peter Deutsch">
4442      <organization>Aladdin Enterprises</organization>
4443      <address><email></email></address>
4444    </author>
4445    <author initials="J-L." surname="Gailly" fullname="Jean-Loup Gailly">
4446      <address><email></email></address>
4447    </author>
4448    <author initials="M." surname="Adler" fullname="Mark Adler">
4449      <address><email></email></address>
4450    </author>
4451    <author initials="L.P." surname="Deutsch" fullname="L. Peter Deutsch">
4452      <address><email></email></address>
4453    </author>
4454    <author initials="G." surname="Randers-Pehrson" fullname="Glenn Randers-Pehrson">
4455      <address><email></email></address>
4456    </author>
4457    <date month="May" year="1996"/>
4458  </front>
4459  <seriesInfo name="RFC" value="1952"/>
4460  <annotation>
4461    RFC 1952 is an Informational RFC, thus it might be less stable than
4462    this specification. On the other hand, this downward reference was
4463    present since the publication of RFC 2068 in 1997 (<xref target="RFC2068"/>),
4464    therefore it is unlikely to cause problems in practice. See also
4465    <xref target="BCP97"/>.
4466  </annotation>
4471<references title="Informative References">
4473<reference anchor="Nie1997" target="">
4474  <front>
4475    <title>Network Performance Effects of HTTP/1.1, CSS1, and PNG</title>
4476    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen"/>
4477    <author initials="J." surname="Gettys" fullname="J. Gettys"/>
4478    <author initials="E." surname="Prud'hommeaux" fullname="E. Prud'hommeaux"/>
4479    <author initials="H." surname="Lie" fullname="H. Lie"/>
4480    <author initials="C." surname="Lilley" fullname="C. Lilley"/>
4481    <date year="1997" month="September"/>
4482  </front>
4483  <seriesInfo name="ACM" value="Proceedings of the ACM SIGCOMM '97 conference on Applications, technologies, architectures, and protocols for computer communication SIGCOMM '97"/>
4486<reference anchor="Pad1995" target="">
4487  <front>
4488    <title>Improving HTTP Latency</title>
4489    <author initials="V.N." surname="Padmanabhan" fullname="Venkata N. Padmanabhan"/>
4490    <author initials="J.C." surname="Mogul" fullname="Jeffrey C. Mogul"/>
4491    <date year="1995" month="December"/>
4492  </front>
4493  <seriesInfo name="Computer Networks and ISDN Systems" value="v. 28, pp. 25-35"/>
4496<reference anchor="RFC1123">
4497  <front>
4498    <title>Requirements for Internet Hosts - Application and Support</title>
4499    <author initials="R." surname="Braden" fullname="Robert Braden">
4500      <organization>University of Southern California (USC), Information Sciences Institute</organization>
4501      <address><email>Braden@ISI.EDU</email></address>
4502    </author>
4503    <date month="October" year="1989"/>
4504  </front>
4505  <seriesInfo name="STD" value="3"/>
4506  <seriesInfo name="RFC" value="1123"/>
4509<reference anchor="RFC1900">
4510  <front>
4511    <title>Renumbering Needs Work</title>
4512    <author initials="B." surname="Carpenter" fullname="Brian E. Carpenter">
4513      <organization>CERN, Computing and Networks Division</organization>
4514      <address><email></email></address>
4515    </author>
4516    <author initials="Y." surname="Rekhter" fullname="Yakov Rekhter">
4517      <organization>cisco Systems</organization>
4518      <address><email></email></address>
4519    </author>
4520    <date month="February" year="1996"/>
4521  </front>
4522  <seriesInfo name="RFC" value="1900"/>
4525<reference anchor='RFC1919'>
4526  <front>
4527    <title>Classical versus Transparent IP Proxies</title>
4528    <author initials='M.' surname='Chatel' fullname='Marc Chatel'>
4529      <address><email></email></address>
4530    </author>
4531    <date year='1996' month='March' />
4532  </front>
4533  <seriesInfo name='RFC' value='1919' />
4536<reference anchor="RFC1945">
4537  <front>
4538    <title abbrev="HTTP/1.0">Hypertext Transfer Protocol -- HTTP/1.0</title>
4539    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
4540      <organization>MIT, Laboratory for Computer Science</organization>
4541      <address><email></email></address>
4542    </author>
4543    <author initials="R.T." surname="Fielding" fullname="Roy T. Fielding">
4544      <organization>University of California, Irvine, Department of Information and Computer Science</organization>
4545      <address><email></email></address>
4546    </author>
4547    <author initials="H.F." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
4548      <organization>W3 Consortium, MIT Laboratory for Computer Science</organization>
4549      <address><email></email></address>
4550    </author>
4551    <date month="May" year="1996"/>
4552  </front>
4553  <seriesInfo name="RFC" value="1945"/>
4556<reference anchor="RFC2045">
4557  <front>
4558    <title abbrev="Internet Message Bodies">Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies</title>
4559    <author initials="N." surname="Freed" fullname="Ned Freed">
4560      <organization>Innosoft International, Inc.</organization>
4561      <address><email></email></address>
4562    </author>
4563    <author initials="N.S." surname="Borenstein" fullname="Nathaniel S. Borenstein">
4564      <organization>First Virtual Holdings</organization>
4565      <address><email></email></address>
4566    </author>
4567    <date month="November" year="1996"/>
4568  </front>
4569  <seriesInfo name="RFC" value="2045"/>
4572<reference anchor="RFC2047">
4573  <front>
4574    <title abbrev="Message Header Extensions">MIME (Multipurpose Internet Mail Extensions) Part Three: Message Header Extensions for Non-ASCII Text</title>
4575    <author initials="K." surname="Moore" fullname="Keith Moore">
4576      <organization>University of Tennessee</organization>
4577      <address><email></email></address>
4578    </author>
4579    <date month="November" year="1996"/>
4580  </front>
4581  <seriesInfo name="RFC" value="2047"/>
4584<reference anchor="RFC2068">
4585  <front>
4586    <title abbrev="HTTP/1.1">Hypertext Transfer Protocol -- HTTP/1.1</title>
4587    <author initials="R." surname="Fielding" fullname="Roy T. Fielding">
4588      <organization>University of California, Irvine, Department of Information and Computer Science</organization>
4589      <address><email></email></address>
4590    </author>
4591    <author initials="J." surname="Gettys" fullname="Jim Gettys">
4592      <organization>MIT Laboratory for Computer Science</organization>
4593      <address><email></email></address>
4594    </author>
4595    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
4596      <organization>Digital Equipment Corporation, Western Research Laboratory</organization>
4597      <address><email></email></address>
4598    </author>
4599    <author initials="H." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
4600      <organization>MIT Laboratory for Computer Science</organization>
4601      <address><email></email></address>
4602    </author>
4603    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
4604      <organization>MIT Laboratory for Computer Science</organization>
4605      <address><email></email></address>
4606    </author>
4607    <date month="January" year="1997"/>
4608  </front>
4609  <seriesInfo name="RFC" value="2068"/>
4612<reference anchor="RFC2145">
4613  <front>
4614    <title abbrev="HTTP Version Numbers">Use and Interpretation of HTTP Version Numbers</title>
4615    <author initials="J.C." surname="Mogul" fullname="Jeffrey C. Mogul">
4616      <organization>Western Research Laboratory</organization>
4617      <address><email></email></address>
4618    </author>
4619    <author initials="R.T." surname="Fielding" fullname="Roy T. Fielding">
4620      <organization>Department of Information and Computer Science</organization>
4621      <address><email></email></address>
4622    </author>
4623    <author initials="J." surname="Gettys" fullname="Jim Gettys">
4624      <organization>MIT Laboratory for Computer Science</organization>
4625      <address><email></email></address>
4626    </author>
4627    <author initials="H.F." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
4628      <organization>W3 Consortium</organization>
4629      <address><email></email></address>
4630    </author>
4631    <date month="May" year="1997"/>
4632  </front>
4633  <seriesInfo name="RFC" value="2145"/>
4636<reference anchor="RFC2616">
4637  <front>
4638    <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
4639    <author initials="R." surname="Fielding" fullname="R. Fielding">
4640      <organization>University of California, Irvine</organization>
4641      <address><email></email></address>
4642    </author>
4643    <author initials="J." surname="Gettys" fullname="J. Gettys">
4644      <organization>W3C</organization>
4645      <address><email></email></address>
4646    </author>
4647    <author initials="J." surname="Mogul" fullname="J. Mogul">
4648      <organization>Compaq Computer Corporation</organization>
4649      <address><email></email></address>
4650    </author>
4651    <author initials="H." surname="Frystyk" fullname="H. Frystyk">
4652      <organization>MIT Laboratory for Computer Science</organization>
4653      <address><email></email></address>
4654    </author>
4655    <author initials="L." surname="Masinter" fullname="L. Masinter">
4656      <organization>Xerox Corporation</organization>
4657      <address><email></email></address>
4658    </author>
4659    <author initials="P." surname="Leach" fullname="P. Leach">
4660      <organization>Microsoft Corporation</organization>
4661      <address><email></email></address>
4662    </author>
4663    <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
4664      <organization>W3C</organization>
4665      <address><email></email></address>
4666    </author>
4667    <date month="June" year="1999"/>
4668  </front>
4669  <seriesInfo name="RFC" value="2616"/>
4672<reference anchor='RFC2817'>
4673  <front>
4674    <title>Upgrading to TLS Within HTTP/1.1</title>
4675    <author initials='R.' surname='Khare' fullname='R. Khare'>
4676      <organization>4K Associates / UC Irvine</organization>
4677      <address><email></email></address>
4678    </author>
4679    <author initials='S.' surname='Lawrence' fullname='S. Lawrence'>
4680      <organization>Agranat Systems, Inc.</organization>
4681      <address><email></email></address>
4682    </author>
4683    <date year='2000' month='May' />
4684  </front>
4685  <seriesInfo name='RFC' value='2817' />
4688<reference anchor='RFC2818'>
4689  <front>
4690    <title>HTTP Over TLS</title>
4691    <author initials='E.' surname='Rescorla' fullname='Eric Rescorla'>
4692      <organization>RTFM, Inc.</organization>
4693      <address><email></email></address>
4694    </author>
4695    <date year='2000' month='May' />
4696  </front>
4697  <seriesInfo name='RFC' value='2818' />
4700<reference anchor='RFC2965'>
4701  <front>
4702    <title>HTTP State Management Mechanism</title>
4703    <author initials='D. M.' surname='Kristol' fullname='David M. Kristol'>
4704      <organization>Bell Laboratories, Lucent Technologies</organization>
4705      <address><email></email></address>
4706    </author>
4707    <author initials='L.' surname='Montulli' fullname='Lou Montulli'>
4708      <organization>, Inc.</organization>
4709      <address><email></email></address>
4710    </author>
4711    <date year='2000' month='October' />
4712  </front>
4713  <seriesInfo name='RFC' value='2965' />
4716<reference anchor='RFC3040'>
4717  <front>
4718    <title>Internet Web Replication and Caching Taxonomy</title>
4719    <author initials='I.' surname='Cooper' fullname='I. Cooper'>
4720      <organization>Equinix, Inc.</organization>
4721    </author>
4722    <author initials='I.' surname='Melve' fullname='I. Melve'>
4723      <organization>UNINETT</organization>
4724    </author>
4725    <author initials='G.' surname='Tomlinson' fullname='G. Tomlinson'>
4726      <organization>CacheFlow Inc.</organization>
4727    </author>
4728    <date year='2001' month='January' />
4729  </front>
4730  <seriesInfo name='RFC' value='3040' />
4733<reference anchor='RFC3864'>
4734  <front>
4735    <title>Registration Procedures for Message Header Fields</title>
4736    <author initials='G.' surname='Klyne' fullname='G. Klyne'>
4737      <organization>Nine by Nine</organization>
4738      <address><email></email></address>
4739    </author>
4740    <author initials='M.' surname='Nottingham' fullname='M. Nottingham'>
4741      <organization>BEA Systems</organization>
4742      <address><email></email></address>
4743    </author>
4744    <author initials='J.' surname='Mogul' fullname='J. Mogul'>
4745      <organization>HP Labs</organization>
4746      <address><email></email></address>
4747    </author>
4748    <date year='2004' month='September' />
4749  </front>
4750  <seriesInfo name='BCP' value='90' />
4751  <seriesInfo name='RFC' value='3864' />
4754<reference anchor="RFC4288">
4755  <front>
4756    <title>Media Type Specifications and Registration Procedures</title>
4757    <author initials="N." surname="Freed" fullname="N. Freed">
4758      <organization>Sun Microsystems</organization>
4759      <address>
4760        <email></email>
4761      </address>
4762    </author>
4763    <author initials="J." surname="Klensin" fullname="J. Klensin">
4764      <address>
4765        <email></email>
4766      </address>
4767    </author>
4768    <date year="2005" month="December"/>
4769  </front>
4770  <seriesInfo name="BCP" value="13"/>
4771  <seriesInfo name="RFC" value="4288"/>
4774<reference anchor='RFC4395'>
4775  <front>
4776    <title>Guidelines and Registration Procedures for New URI Schemes</title>
4777    <author initials='T.' surname='Hansen' fullname='T. Hansen'>
4778      <organization>AT&amp;T Laboratories</organization>
4779      <address>
4780        <email></email>
4781      </address>
4782    </author>
4783    <author initials='T.' surname='Hardie' fullname='T. Hardie'>
4784      <organization>Qualcomm, Inc.</organization>
4785      <address>
4786        <email></email>
4787      </address>
4788    </author>
4789    <author initials='L.' surname='Masinter' fullname='L. Masinter'>
4790      <organization>Adobe Systems</organization>
4791      <address>
4792        <email></email>
4793      </address>
4794    </author>
4795    <date year='2006' month='February' />
4796  </front>
4797  <seriesInfo name='BCP' value='115' />
4798  <seriesInfo name='RFC' value='4395' />
4801<reference anchor='RFC5226'>
4802  <front>
4803    <title>Guidelines for Writing an IANA Considerations Section in RFCs</title>
4804    <author initials='T.' surname='Narten' fullname='T. Narten'>
4805      <organization>IBM</organization>
4806      <address><email></email></address>
4807    </author>
4808    <author initials='H.' surname='Alvestrand' fullname='H. Alvestrand'>
4809      <organization>Google</organization>
4810      <address><email></email></address>
4811    </author>
4812    <date year='2008' month='May' />
4813  </front>
4814  <seriesInfo name='BCP' value='26' />
4815  <seriesInfo name='RFC' value='5226' />
4818<reference anchor="RFC5322">
4819  <front>
4820    <title>Internet Message Format</title>
4821    <author initials="P." surname="Resnick" fullname="P. Resnick">
4822      <organization>Qualcomm Incorporated</organization>
4823    </author>
4824    <date year="2008" month="October"/>
4825  </front>
4826  <seriesInfo name="RFC" value="5322"/>
4829<reference anchor="RFC6265">
4830  <front>
4831    <title>HTTP State Management Mechanism</title>
4832    <author initials="A." surname="Barth" fullname="Adam Barth">
4833      <organization abbrev="U.C. Berkeley">
4834        University of California, Berkeley
4835      </organization>
4836      <address><email></email></address>
4837    </author>
4838    <date year="2011" month="April" />
4839  </front>
4840  <seriesInfo name="RFC" value="6265"/>
4843<reference anchor='BCP97'>
4844  <front>
4845    <title>Handling Normative References to Standards-Track Documents</title>
4846    <author initials='J.' surname='Klensin' fullname='J. Klensin'>
4847      <address>
4848        <email></email>
4849      </address>
4850    </author>
4851    <author initials='S.' surname='Hartman' fullname='S. Hartman'>
4852      <organization>MIT</organization>
4853      <address>
4854        <email></email>
4855      </address>
4856    </author>
4857    <date year='2007' month='June' />
4858  </front>
4859  <seriesInfo name='BCP' value='97' />
4860  <seriesInfo name='RFC' value='4897' />
4863<reference anchor="Kri2001" target="">
4864  <front>
4865    <title>HTTP Cookies: Standards, Privacy, and Politics</title>
4866    <author initials="D." surname="Kristol" fullname="David M. Kristol"/>
4867    <date year="2001" month="November"/>
4868  </front>
4869  <seriesInfo name="ACM Transactions on Internet Technology" value="Vol. 1, #2"/>
4872<reference anchor="Spe" target="">
4873  <front>
4874    <title>Analysis of HTTP Performance Problems</title>
4875    <author initials="S." surname="Spero" fullname="Simon E. Spero"/>
4876    <date/>
4877  </front>
4880<reference anchor="Tou1998" target="">
4881  <front>
4882  <title>Analysis of HTTP Performance</title>
4883  <author initials="J." surname="Touch" fullname="Joe Touch">
4884    <organization>USC/Information Sciences Institute</organization>
4885    <address><email></email></address>
4886  </author>
4887  <author initials="J." surname="Heidemann" fullname="John Heidemann">
4888    <organization>USC/Information Sciences Institute</organization>
4889    <address><email></email></address>
4890  </author>
4891  <author initials="K." surname="Obraczka" fullname="Katia Obraczka">
4892    <organization>USC/Information Sciences Institute</organization>
4893    <address><email></email></address>
4894  </author>
4895  <date year="1998" month="Aug"/>
4896  </front>
4897  <seriesInfo name="ISI Research Report" value="ISI/RR-98-463"/>
4898  <annotation>(original report dated Aug. 1996)</annotation>
4904<section title="Tolerant Applications" anchor="tolerant.applications">
4906   Although this document specifies the requirements for the generation
4907   of HTTP/1.1 messages, not all applications will be correct in their
4908   implementation. We therefore recommend that operational applications
4909   be tolerant of deviations whenever those deviations can be
4910   interpreted unambiguously.
4913   The line terminator for header fields is the sequence CRLF.
4914   However, we recommend that applications, when parsing such headers fields,
4915   recognize a single LF as a line terminator and ignore the leading CR.
4918   The character encoding of a representation &SHOULD; be labeled as the lowest
4919   common denominator of the character codes used within that representation, with
4920   the exception that not labeling the representation is preferred over labeling
4921   the representation with the labels US-ASCII or ISO-8859-1. See &payload;.
4924   Additional rules for requirements on parsing and encoding of dates
4925   and other potential problems with date encodings include:
4928  <list style="symbols">
4929     <t>HTTP/1.1 clients and caches &SHOULD; assume that an RFC-850 date
4930        which appears to be more than 50 years in the future is in fact
4931        in the past (this helps solve the "year 2000" problem).</t>
4933     <t>Although all date formats are specified to be case-sensitive,
4934        recipients &SHOULD; match day, week and timezone names
4935        case-insensitively.</t>
4937     <t>An HTTP/1.1 implementation &MAY; internally represent a parsed
4938        Expires date as earlier than the proper value, but &MUST-NOT;
4939        internally represent a parsed Expires date as later than the
4940        proper value.</t>
4942     <t>All expiration-related calculations &MUST; be done in GMT. The
4943        local time zone &MUST-NOT; influence the calculation or comparison
4944        of an age or expiration time.</t>
4946     <t>If an HTTP header field incorrectly carries a date value with a time
4947        zone other than GMT, it &MUST; be converted into GMT using the
4948        most conservative possible conversion.</t>
4949  </list>
4953<section title="HTTP Version History" anchor="compatibility">
4955   HTTP has been in use by the World-Wide Web global information initiative
4956   since 1990. The first version of HTTP, later referred to as HTTP/0.9,
4957   was a simple protocol for hypertext data transfer across the Internet
4958   with only a single request method (GET) and no metadata.
4959   HTTP/1.0, as defined by <xref target="RFC1945"/>, added a range of request
4960   methods and MIME-like messaging that could include metadata about the data
4961   transferred and modifiers on the request/response semantics. However,
4962   HTTP/1.0 did not sufficiently take into consideration the effects of
4963   hierarchical proxies, caching, the need for persistent connections, or
4964   name-based virtual hosts. The proliferation of incompletely-implemented
4965   applications calling themselves "HTTP/1.0" further necessitated a
4966   protocol version change in order for two communicating applications
4967   to determine each other's true capabilities.
4970   HTTP/1.1 remains compatible with HTTP/1.0 by including more stringent
4971   requirements that enable reliable implementations, adding only
4972   those new features that will either be safely ignored by an HTTP/1.0
4973   recipient or only sent when communicating with a party advertising
4974   compliance with HTTP/1.1.
4977   It is beyond the scope of a protocol specification to mandate
4978   compliance with previous versions. HTTP/1.1 was deliberately
4979   designed, however, to make supporting previous versions easy.
4980   We would expect a general-purpose HTTP/1.1 server to understand
4981   any valid request in the format of HTTP/1.0 and respond appropriately
4982   with an HTTP/1.1 message that only uses features understood (or
4983   safely ignored) by HTTP/1.0 clients.  Likewise, would expect
4984   an HTTP/1.1 client to understand any valid HTTP/1.0 response.
4987   Since HTTP/0.9 did not support header fields in a request,
4988   there is no mechanism for it to support name-based virtual
4989   hosts (selection of resource by inspection of the Host header
4990   field).  Any server that implements name-based virtual hosts
4991   ought to disable support for HTTP/0.9.  Most requests that
4992   appear to be HTTP/0.9 are, in fact, badly constructed HTTP/1.x
4993   requests wherein a buggy client failed to properly encode
4994   linear whitespace found in a URI reference and placed in
4995   the request-target.
4998<section title="Changes from HTTP/1.0" anchor="changes.from.1.0">
5000   This section summarizes major differences between versions HTTP/1.0
5001   and HTTP/1.1.
5004<section title="Multi-homed Web Servers" anchor="">
5006   The requirements that clients and servers support the Host header
5007   field (<xref target=""/>), report an error if it is
5008   missing from an HTTP/1.1 request, and accept absolute URIs (<xref target="request-target"/>)
5009   are among the most important changes defined by HTTP/1.1.
5012   Older HTTP/1.0 clients assumed a one-to-one relationship of IP
5013   addresses and servers; there was no other established mechanism for
5014   distinguishing the intended server of a request than the IP address
5015   to which that request was directed. The Host header field was
5016   introduced during the development of HTTP/1.1 and, though it was
5017   quickly implemented by most HTTP/1.0 browsers, additional requirements
5018   were placed on all HTTP/1.1 requests in order to ensure complete
5019   adoption.  At the time of this writing, most HTTP-based services
5020   are dependent upon the Host header field for targeting requests.
5024<section title="Keep-Alive Connections" anchor="compatibility.with.http.1.0.persistent.connections">
5026   For most implementations of HTTP/1.0, each connection is established
5027   by the client prior to the request and closed by the server after
5028   sending the response. However, some implementations implement the
5029   Keep-Alive version of persistent connections described in
5030   <xref x:sec="19.7.1" x:fmt="of" target="RFC2068"/>.
5033   Some clients and servers might wish to be compatible with some
5034   previous implementations of persistent connections in HTTP/1.0
5035   clients and servers. Persistent connections in HTTP/1.0 are
5036   explicitly negotiated as they are not the default behavior. HTTP/1.0
5037   experimental implementations of persistent connections are faulty,
5038   and the new facilities in HTTP/1.1 are designed to rectify these
5039   problems. The problem was that some existing HTTP/1.0 clients might
5040   send Keep-Alive to a proxy server that doesn't understand
5041   Connection, which would then erroneously forward it to the next
5042   inbound server, which would establish the Keep-Alive connection and
5043   result in a hung HTTP/1.0 proxy waiting for the close on the
5044   response. The result is that HTTP/1.0 clients must be prevented from
5045   using Keep-Alive when talking to proxies.
5048   However, talking to proxies is the most important use of persistent
5049   connections, so that prohibition is clearly unacceptable. Therefore,
5050   we need some other mechanism for indicating a persistent connection
5051   is desired, which is safe to use even when talking to an old proxy
5052   that ignores Connection. Persistent connections are the default for
5053   HTTP/1.1 messages; we introduce a new keyword (Connection: close) for
5054   declaring non-persistence. See <xref target="header.connection"/>.
5059<section title="Changes from RFC 2616" anchor="changes.from.rfc.2616">
5061  Empty list elements in list productions have been deprecated.
5062  (<xref target="notation.abnf"/>)
5065  Rules about implicit linear whitespace between certain grammar productions
5066  have been removed; now it's only allowed when specifically pointed out
5067  in the ABNF. The NUL octet is no longer allowed in comment and quoted-string
5068  text. The quoted-pair rule no longer allows escaping control characters other than HTAB.
5069  Non-ASCII content in header fields and reason phrase has been obsoleted and
5070  made opaque (the TEXT rule was removed)
5071  (<xref target="basic.rules"/>)
5074  Clarify that the string "HTTP" in the HTTP-Version ABFN production is case
5075  sensitive. Restrict the version numbers to be single digits due to the fact
5076  that implementations are known to handle multi-digit version numbers
5077  incorrectly.
5078  (<xref target="http.version"/>)
5081  Require that invalid whitespace around field-names be rejected.
5082  (<xref target="header.fields"/>)
5085  Require recipients to handle bogus Content-Length header fields as errors.
5086  (<xref target="message.body"/>)
5089  Remove reference to non-existent identity transfer-coding value tokens.
5090  (Sections <xref format="counter" target="message.body"/> and
5091  <xref format="counter" target="transfer.codings"/>)
5094  Update use of abs_path production from RFC 1808 to the path-absolute + query
5095  components of RFC 3986. State that the asterisk form is allowed for the OPTIONS
5096  request method only.
5097  (<xref target="request-target"/>)
5100  Clarification that the chunk length does not include the count of the octets
5101  in the chunk header and trailer. Furthermore disallowed line folding
5102  in chunk extensions.
5103  (<xref target="chunked.encoding"/>)
5106  Remove hard limit of two connections per server.
5107  (<xref target="persistent.practical"/>)
5110  Change ABNF productions for header fields to only define the field value.
5111  (<xref target="header.field.definitions"/>)
5114  Clarify exactly when close connection options must be sent.
5115  (<xref target="header.connection"/>)
5118  Define the semantics of the "Upgrade" header field in responses other than
5119  101 (this was incorporated from <xref target="RFC2817"/>).
5120  (<xref target="header.upgrade"/>)
5125<?BEGININC p1-messaging.abnf-appendix ?>
5126<section xmlns:x="" title="Collected ABNF" anchor="collected.abnf">
5128<artwork type="abnf" name="p1-messaging.parsed-abnf">
5129<x:ref>BWS</x:ref> = OWS
5131<x:ref>Chunked-Body</x:ref> = *chunk last-chunk trailer-part CRLF
5132<x:ref>Connection</x:ref> = *( "," OWS ) connection-token *( OWS "," [ OWS
5133 connection-token ] )
5134<x:ref>Content-Length</x:ref> = 1*DIGIT
5136<x:ref>Date</x:ref> = HTTP-date
5138<x:ref>GMT</x:ref> = %x47.4D.54 ; GMT
5140<x:ref>HTTP-Prot-Name</x:ref> = %x48.54.54.50 ; HTTP
5141<x:ref>HTTP-Version</x:ref> = HTTP-Prot-Name "/" DIGIT "." DIGIT
5142<x:ref>HTTP-date</x:ref> = rfc1123-date / obs-date
5143<x:ref>HTTP-message</x:ref> = start-line *( header-field CRLF ) CRLF [ message-body
5144 ]
5145<x:ref>Host</x:ref> = uri-host [ ":" port ]
5147<x:ref>Method</x:ref> = token
5149<x:ref>OWS</x:ref> = *( [ obs-fold ] WSP )
5151<x:ref>RWS</x:ref> = 1*( [ obs-fold ] WSP )
5152<x:ref>Reason-Phrase</x:ref> = *( WSP / VCHAR / obs-text )
5153<x:ref>Request</x:ref> = Request-Line *( header-field CRLF ) CRLF [ message-body ]
5154<x:ref>Request-Line</x:ref> = Method SP request-target SP HTTP-Version CRLF
5155<x:ref>Response</x:ref> = Status-Line *( header-field CRLF ) CRLF [ message-body ]
5157<x:ref>Status-Code</x:ref> = 3DIGIT
5158<x:ref>Status-Line</x:ref> = HTTP-Version SP Status-Code SP Reason-Phrase CRLF
5160<x:ref>TE</x:ref> = [ ( "," / t-codings ) *( OWS "," [ OWS t-codings ] ) ]
5161<x:ref>Trailer</x:ref> = *( "," OWS ) field-name *( OWS "," [ OWS field-name ] )
5162<x:ref>Transfer-Encoding</x:ref> = *( "," OWS ) transfer-coding *( OWS "," [ OWS
5163 transfer-coding ] )
5165<x:ref>URI-reference</x:ref> = &lt;URI-reference, defined in [RFC3986], Section 4.1&gt;
5166<x:ref>Upgrade</x:ref> = *( "," OWS ) product *( OWS "," [ OWS product ] )
5168<x:ref>Via</x:ref> = *( "," OWS ) received-protocol RWS received-by [ RWS comment ]
5169 *( OWS "," [ OWS received-protocol RWS received-by [ RWS comment ] ]
5170 )
5172<x:ref>absolute-URI</x:ref> = &lt;absolute-URI, defined in [RFC3986], Section 4.3&gt;
5173<x:ref>asctime-date</x:ref> = day-name SP date3 SP time-of-day SP year
5174<x:ref>attribute</x:ref> = token
5175<x:ref>authority</x:ref> = &lt;authority, defined in [RFC3986], Section 3.2&gt;
5177<x:ref>chunk</x:ref> = chunk-size *WSP [ chunk-ext ] CRLF chunk-data CRLF
5178<x:ref>chunk-data</x:ref> = 1*OCTET
5179<x:ref>chunk-ext</x:ref> = *( ";" *WSP chunk-ext-name [ "=" chunk-ext-val ] *WSP )
5180<x:ref>chunk-ext-name</x:ref> = token
5181<x:ref>chunk-ext-val</x:ref> = token / quoted-str-nf
5182<x:ref>chunk-size</x:ref> = 1*HEXDIG
5183<x:ref>comment</x:ref> = "(" *( ctext / quoted-cpair / comment ) ")"
5184<x:ref>connection-token</x:ref> = token
5185<x:ref>ctext</x:ref> = OWS / %x21-27 ; '!'-'''
5186 / %x2A-5B ; '*'-'['
5187 / %x5D-7E ; ']'-'~'
5188 / obs-text
5190<x:ref>date1</x:ref> = day SP month SP year
5191<x:ref>date2</x:ref> = day "-" month "-" 2DIGIT
5192<x:ref>date3</x:ref> = month SP ( 2DIGIT / ( SP DIGIT ) )
5193<x:ref>day</x:ref> = 2DIGIT
5194<x:ref>day-name</x:ref> = %x4D.6F.6E ; Mon
5195 / %x54.75.65 ; Tue
5196 / %x57.65.64 ; Wed
5197 / %x54.68.75 ; Thu
5198 / %x46.72.69 ; Fri
5199 / %x53.61.74 ; Sat
5200 / %x53.75.6E ; Sun
5201<x:ref>day-name-l</x:ref> = %x4D.6F.6E.64.61.79 ; Monday
5202 / %x54. ; Tuesday
5203 / %x57.65.64.6E. ; Wednesday
5204 / %x54. ; Thursday
5205 / %x46. ; Friday
5206 / %x53. ; Saturday
5207 / %x53.75.6E.64.61.79 ; Sunday
5209<x:ref>field-content</x:ref> = *( WSP / VCHAR / obs-text )
5210<x:ref>field-name</x:ref> = token
5211<x:ref>field-value</x:ref> = *( field-content / OWS )
5213<x:ref>header-field</x:ref> = field-name ":" OWS [ field-value ] OWS
5214<x:ref>hour</x:ref> = 2DIGIT
5215<x:ref>http-URI</x:ref> = "http://" authority path-abempty [ "?" query ]
5216<x:ref>https-URI</x:ref> = "https://" authority path-abempty [ "?" query ]
5218<x:ref>last-chunk</x:ref> = 1*"0" *WSP [ chunk-ext ] CRLF
5220<x:ref>message-body</x:ref> = *OCTET
5221<x:ref>minute</x:ref> = 2DIGIT
5222<x:ref>month</x:ref> = %x4A.61.6E ; Jan
5223 / %x46.65.62 ; Feb
5224 / %x4D.61.72 ; Mar
5225 / %x41.70.72 ; Apr
5226 / %x4D.61.79 ; May
5227 / %x4A.75.6E ; Jun
5228 / %x4A.75.6C ; Jul
5229 / %x41.75.67 ; Aug
5230 / %x53.65.70 ; Sep
5231 / %x4F.63.74 ; Oct
5232 / %x4E.6F.76 ; Nov
5233 / %x44.65.63 ; Dec
5235<x:ref>obs-date</x:ref> = rfc850-date / asctime-date
5236<x:ref>obs-fold</x:ref> = CRLF
5237<x:ref>obs-text</x:ref> = %x80-FF
5239<x:ref>partial-URI</x:ref> = relative-part [ "?" query ]
5240<x:ref>path-abempty</x:ref> = &lt;path-abempty, defined in [RFC3986], Section 3.3&gt;
5241<x:ref>path-absolute</x:ref> = &lt;path-absolute, defined in [RFC3986], Section 3.3&gt;
5242<x:ref>port</x:ref> = &lt;port, defined in [RFC3986], Section 3.2.3&gt;
5243<x:ref>product</x:ref> = token [ "/" product-version ]
5244<x:ref>product-version</x:ref> = token
5245<x:ref>protocol-name</x:ref> = token
5246<x:ref>protocol-version</x:ref> = token
5247<x:ref>pseudonym</x:ref> = token
5249<x:ref>qdtext</x:ref> = OWS / "!" / %x23-5B ; '#'-'['
5250 / %x5D-7E ; ']'-'~'
5251 / obs-text
5252<x:ref>qdtext-nf</x:ref> = WSP / "!" / %x23-5B ; '#'-'['
5253 / %x5D-7E ; ']'-'~'
5254 / obs-text
5255<x:ref>query</x:ref> = &lt;query, defined in [RFC3986], Section 3.4&gt;
5256<x:ref>quoted-cpair</x:ref> = "\" ( WSP / VCHAR / obs-text )
5257<x:ref>quoted-pair</x:ref> = "\" ( WSP / VCHAR / obs-text )
5258<x:ref>quoted-str-nf</x:ref> = DQUOTE *( qdtext-nf / quoted-pair ) DQUOTE
5259<x:ref>quoted-string</x:ref> = DQUOTE *( qdtext / quoted-pair ) DQUOTE
5260<x:ref>qvalue</x:ref> = ( "0" [ "." *3DIGIT ] ) / ( "1" [ "." *3"0" ] )
5262<x:ref>received-by</x:ref> = ( uri-host [ ":" port ] ) / pseudonym
5263<x:ref>received-protocol</x:ref> = [ protocol-name "/" ] protocol-version
5264<x:ref>relative-part</x:ref> = &lt;relative-part, defined in [RFC3986], Section 4.2&gt;
5265<x:ref>request-target</x:ref> = "*" / absolute-URI / ( path-absolute [ "?" query ] )
5266 / authority
5267<x:ref>rfc1123-date</x:ref> = day-name "," SP date1 SP time-of-day SP GMT
5268<x:ref>rfc850-date</x:ref> = day-name-l "," SP date2 SP time-of-day SP GMT
5270<x:ref>second</x:ref> = 2DIGIT
5271<x:ref>special</x:ref> = "(" / ")" / "&lt;" / "&gt;" / "@" / "," / ";" / ":" / "\" /
5272 DQUOTE / "/" / "[" / "]" / "?" / "=" / "{" / "}"
5273<x:ref>start-line</x:ref> = Request-Line / Status-Line
5275<x:ref>t-codings</x:ref> = "trailers" / ( transfer-extension [ te-params ] )
5276<x:ref>tchar</x:ref> = "!" / "#" / "$" / "%" / "&amp;" / "'" / "*" / "+" / "-" / "." /
5277 "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA
5278<x:ref>te-ext</x:ref> = OWS ";" OWS token [ "=" word ]
5279<x:ref>te-params</x:ref> = OWS ";" OWS "q=" qvalue *te-ext
5280<x:ref>time-of-day</x:ref> = hour ":" minute ":" second
5281<x:ref>token</x:ref> = 1*tchar
5282<x:ref>trailer-part</x:ref> = *( header-field CRLF )
5283<x:ref>transfer-coding</x:ref> = "chunked" / "compress" / "deflate" / "gzip" /
5284 transfer-extension
5285<x:ref>transfer-extension</x:ref> = token *( OWS ";" OWS transfer-parameter )
5286<x:ref>transfer-parameter</x:ref> = attribute BWS "=" BWS value
5288<x:ref>uri-host</x:ref> = &lt;host, defined in [RFC3986], Section 3.2.2&gt;
5290<x:ref>value</x:ref> = word
5292<x:ref>word</x:ref> = token / quoted-string
5294<x:ref>year</x:ref> = 4DIGIT
5297<figure><preamble>ABNF diagnostics:</preamble><artwork type="inline">
5298; Chunked-Body defined but not used
5299; Connection defined but not used
5300; Content-Length defined but not used
5301; Date defined but not used
5302; HTTP-message defined but not used
5303; Host defined but not used
5304; Request defined but not used
5305; Response defined but not used
5306; TE defined but not used
5307; Trailer defined but not used
5308; Transfer-Encoding defined but not used
5309; URI-reference defined but not used
5310; Upgrade defined but not used
5311; Via defined but not used
5312; http-URI defined but not used
5313; https-URI defined but not used
5314; partial-URI defined but not used
5315; special defined but not used
5317<?ENDINC p1-messaging.abnf-appendix ?>
5319<section title="Change Log (to be removed by RFC Editor before publication)" anchor="change.log">
5321<section title="Since RFC 2616">
5323  Extracted relevant partitions from <xref target="RFC2616"/>.
5327<section title="Since draft-ietf-httpbis-p1-messaging-00">
5329  Closed issues:
5330  <list style="symbols">
5331    <t>
5332      <eref target=""/>:
5333      "HTTP Version should be case sensitive"
5334      (<eref target=""/>)
5335    </t>
5336    <t>
5337      <eref target=""/>:
5338      "'unsafe' characters"
5339      (<eref target=""/>)
5340    </t>
5341    <t>
5342      <eref target=""/>:
5343      "Chunk Size Definition"
5344      (<eref target=""/>)
5345    </t>
5346    <t>
5347      <eref target=""/>:
5348      "Message Length"
5349      (<eref target=""/>)
5350    </t>
5351    <t>
5352      <eref target=""/>:
5353      "Media Type Registrations"
5354      (<eref target=""/>)
5355    </t>
5356    <t>
5357      <eref target=""/>:
5358      "URI includes query"
5359      (<eref target=""/>)
5360    </t>
5361    <t>
5362      <eref target=""/>:
5363      "No close on 1xx responses"
5364      (<eref target=""/>)
5365    </t>
5366    <t>
5367      <eref target=""/>:
5368      "Remove 'identity' token references"
5369      (<eref target=""/>)
5370    </t>
5371    <t>
5372      <eref target=""/>:
5373      "Import query BNF"
5374    </t>
5375    <t>
5376      <eref target=""/>:
5377      "qdtext BNF"
5378    </t>
5379    <t>
5380      <eref target=""/>:
5381      "Normative and Informative references"
5382    </t>
5383    <t>
5384      <eref target=""/>:
5385      "RFC2606 Compliance"
5386    </t>
5387    <t>
5388      <eref target=""/>:
5389      "RFC977 reference"
5390    </t>
5391    <t>
5392      <eref target=""/>:
5393      "RFC1700 references"
5394    </t>
5395    <t>
5396      <eref target=""/>:
5397      "inconsistency in date format explanation"
5398    </t>
5399    <t>
5400      <eref target=""/>:
5401      "Date reference typo"
5402    </t>
5403    <t>
5404      <eref target=""/>:
5405      "Informative references"
5406    </t>
5407    <t>
5408      <eref target=""/>:
5409      "ISO-8859-1 Reference"
5410    </t>
5411    <t>
5412      <eref target=""/>:
5413      "Normative up-to-date references"
5414    </t>
5415  </list>
5418  Other changes:
5419  <list style="symbols">
5420    <t>
5421      Update media type registrations to use RFC4288 template.
5422    </t>
5423    <t>
5424      Use names of RFC4234 core rules DQUOTE and WSP,
5425      fix broken ABNF for chunk-data
5426      (work in progress on <eref target=""/>)
5427    </t>
5428  </list>
5432<section title="Since draft-ietf-httpbis-p1-messaging-01">
5434  Closed issues:
5435  <list style="symbols">
5436    <t>
5437      <eref target=""/>:
5438      "Bodies on GET (and other) requests"
5439    </t>
5440    <t>
5441      <eref target=""/>:
5442      "Updating to RFC4288"
5443    </t>
5444    <t>
5445      <eref target=""/>:
5446      "Status Code and Reason Phrase"
5447    </t>
5448    <t>
5449      <eref target=""/>:
5450      "rel_path not used"
5451    </t>
5452  </list>
5455  Ongoing work on ABNF conversion (<eref target=""/>):
5456  <list style="symbols">
5457    <t>
5458      Get rid of duplicate BNF rule names ("host" -> "uri-host", "trailer" ->
5459      "trailer-part").
5460    </t>
5461    <t>
5462      Avoid underscore character in rule names ("http_URL" ->
5463      "http-URL", "abs_path" -> "path-absolute").
5464    </t>
5465    <t>
5466      Add rules for terms imported from URI spec ("absoluteURI", "authority",
5467      "path-absolute", "port", "query", "relativeURI", "host) &mdash; these will
5468      have to be updated when switching over to RFC3986.
5469    </t>
5470    <t>
5471      Synchronize core rules with RFC5234.
5472    </t>
5473    <t>
5474      Get rid of prose rules that span multiple lines.
5475    </t>
5476    <t>
5477      Get rid of unused rules LOALPHA and UPALPHA.
5478    </t>
5479    <t>
5480      Move "Product Tokens" section (back) into Part 1, as "token" is used
5481      in the definition of the Upgrade header field.
5482    </t>
5483    <t>
5484      Add explicit references to BNF syntax and rules imported from other parts of the specification.
5485    </t>
5486    <t>
5487      Rewrite prose rule "token" in terms of "tchar", rewrite prose rule "TEXT".
5488    </t>
5489  </list>
5493<section title="Since draft-ietf-httpbis-p1-messaging-02" anchor="changes.since.02">
5495  Closed issues:
5496  <list style="symbols">
5497    <t>
5498      <eref target=""/>:
5499      "HTTP-date vs. rfc1123-date"
5500    </t>
5501    <t>
5502      <eref target=""/>:
5503      "WS in quoted-pair"
5504    </t>
5505  </list>
5508  Ongoing work on IANA Message Header Field Registration (<eref target=""/>):
5509  <list style="symbols">
5510    <t>
5511      Reference RFC 3984, and update header field registrations for headers defined
5512      in this document.
5513    </t>
5514  </list>
5517  Ongoing work on ABNF conversion (<eref target=""/>):
5518  <list style="symbols">
5519    <t>
5520      Replace string literals when the string really is case-sensitive (HTTP-Version).
5521    </t>
5522  </list>
5526<section title="Since draft-ietf-httpbis-p1-messaging-03" anchor="changes.since.03">
5528  Closed issues:
5529  <list style="symbols">
5530    <t>
5531      <eref target=""/>:
5532      "Connection closing"
5533    </t>
5534    <t>
5535      <eref target=""/>:
5536      "Move registrations and registry information to IANA Considerations"
5537    </t>
5538    <t>
5539      <eref target=""/>:
5540      "need new URL for PAD1995 reference"
5541    </t>
5542    <t>
5543      <eref target=""/>:
5544      "IANA Considerations: update HTTP URI scheme registration"
5545    </t>
5546    <t>
5547      <eref target=""/>:
5548      "Cite HTTPS URI scheme definition"
5549    </t>
5550    <t>
5551      <eref target=""/>:
5552      "List-type headers vs Set-Cookie"
5553    </t>
5554  </list>
5557  Ongoing work on ABNF conversion (<eref target=""/>):
5558  <list style="symbols">
5559    <t>
5560      Replace string literals when the string really is case-sensitive (HTTP-Date).
5561    </t>
5562    <t>
5563      Replace HEX by HEXDIG for future consistence with RFC 5234's core rules.
5564    </t>
5565  </list>
5569<section title="Since draft-ietf-httpbis-p1-messaging-04" anchor="changes.since.04">
5571  Closed issues:
5572  <list style="symbols">
5573    <t>
5574      <eref target=""/>:
5575      "Out-of-date reference for URIs"
5576    </t>
5577    <t>
5578      <eref target=""/>:
5579      "RFC 2822 is updated by RFC 5322"
5580    </t>
5581  </list>
5584  Ongoing work on ABNF conversion (<eref target=""/>):
5585  <list style="symbols">
5586    <t>
5587      Use "/" instead of "|" for alternatives.
5588    </t>
5589    <t>
5590      Get rid of RFC822 dependency; use RFC5234 plus extensions instead.
5591    </t>
5592    <t>
5593      Only reference RFC 5234's core rules.
5594    </t>
5595    <t>
5596      Introduce new ABNF rules for "bad" whitespace ("BWS"), optional
5597      whitespace ("OWS") and required whitespace ("RWS").
5598    </t>
5599    <t>
5600      Rewrite ABNFs to spell out whitespace rules, factor out
5601      header field value format definitions.
5602    </t>
5603  </list>
5607<section title="Since draft-ietf-httpbis-p1-messaging-05" anchor="changes.since.05">
5609  Closed issues:
5610  <list style="symbols">
5611    <t>
5612      <eref target=""/>:
5613      "Header LWS"
5614    </t>
5615    <t>
5616      <eref target=""/>:
5617      "Sort 1.3 Terminology"
5618    </t>
5619    <t>
5620      <eref target=""/>:
5621      "RFC2047 encoded words"
5622    </t>
5623    <t>
5624      <eref target=""/>:
5625      "Character Encodings in TEXT"
5626    </t>
5627    <t>
5628      <eref target=""/>:
5629      "Line Folding"
5630    </t>
5631    <t>
5632      <eref target=""/>:
5633      "OPTIONS * and proxies"
5634    </t>
5635    <t>
5636      <eref target=""/>:
5637      "Reason-Phrase BNF"
5638    </t>
5639    <t>
5640      <eref target=""/>:
5641      "Use of TEXT"
5642    </t>
5643    <t>
5644      <eref target=""/>:
5645      "Join "Differences Between HTTP Entities and RFC 2045 Entities"?"
5646    </t>
5647    <t>
5648      <eref target=""/>:
5649      "RFC822 reference left in discussion of date formats"
5650    </t>
5651  </list>
5654  Final work on ABNF conversion (<eref target=""/>):
5655  <list style="symbols">
5656    <t>
5657      Rewrite definition of list rules, deprecate empty list elements.
5658    </t>
5659    <t>
5660      Add appendix containing collected and expanded ABNF.
5661    </t>
5662  </list>
5665  Other changes:
5666  <list style="symbols">
5667    <t>
5668      Rewrite introduction; add mostly new Architecture Section.
5669    </t>
5670    <t>
5671      Move definition of quality values from Part 3 into Part 1;
5672      make TE request header field grammar independent of accept-params (defined in Part 3).
5673    </t>
5674  </list>
5678<section title="Since draft-ietf-httpbis-p1-messaging-06" anchor="changes.since.06">
5680  Closed issues:
5681  <list style="symbols">
5682    <t>
5683      <eref target=""/>:
5684      "base for numeric protocol elements"
5685    </t>
5686    <t>
5687      <eref target=""/>:
5688      "comment ABNF"
5689    </t>
5690  </list>
5693  Partly resolved issues:
5694  <list style="symbols">
5695    <t>
5696      <eref target=""/>:
5697      "205 Bodies" (took out language that implied that there might be
5698      methods for which a request body MUST NOT be included)
5699    </t>
5700    <t>
5701      <eref target=""/>:
5702      "editorial improvements around HTTP-date"
5703    </t>
5704  </list>
5708<section title="Since draft-ietf-httpbis-p1-messaging-07" anchor="changes.since.07">
5710  Closed issues:
5711  <list style="symbols">
5712    <t>
5713      <eref target=""/>:
5714      "Repeating single-value headers"
5715    </t>
5716    <t>
5717      <eref target=""/>:
5718      "increase connection limit"
5719    </t>
5720    <t>
5721      <eref target=""/>:
5722      "IP addresses in URLs"
5723    </t>
5724    <t>
5725      <eref target=""/>:
5726      "take over HTTP Upgrade Token Registry"
5727    </t>
5728    <t>
5729      <eref target=""/>:
5730      "CR and LF in chunk extension values"
5731    </t>
5732    <t>
5733      <eref target=""/>:
5734      "HTTP/0.9 support"
5735    </t>
5736    <t>
5737      <eref target=""/>:
5738      "pick IANA policy (RFC5226) for Transfer Coding / Content Coding"
5739    </t>
5740    <t>
5741      <eref target=""/>:
5742      "move definitions of gzip/deflate/compress to part 1"
5743    </t>
5744    <t>
5745      <eref target=""/>:
5746      "disallow control characters in quoted-pair"
5747    </t>
5748  </list>
5751  Partly resolved issues:
5752  <list style="symbols">
5753    <t>
5754      <eref target=""/>:
5755      "update IANA requirements wrt Transfer-Coding values" (add the
5756      IANA Considerations subsection)
5757    </t>
5758  </list>
5762<section title="Since draft-ietf-httpbis-p1-messaging-08" anchor="changes.since.08">
5764  Closed issues:
5765  <list style="symbols">
5766    <t>
5767      <eref target=""/>:
5768      "header parsing, treatment of leading and trailing OWS"
5769    </t>
5770  </list>
5773  Partly resolved issues:
5774  <list style="symbols">
5775    <t>
5776      <eref target=""/>:
5777      "Placement of 13.5.1 and 13.5.2"
5778    </t>
5779    <t>
5780      <eref target=""/>:
5781      "use of term "word" when talking about header structure"
5782    </t>
5783  </list>
5787<section title="Since draft-ietf-httpbis-p1-messaging-09" anchor="changes.since.09">
5789  Closed issues:
5790  <list style="symbols">
5791    <t>
5792      <eref target=""/>:
5793      "Clarification of the term 'deflate'"
5794    </t>
5795    <t>
5796      <eref target=""/>:
5797      "OPTIONS * and proxies"
5798    </t>
5799    <t>
5800      <eref target=""/>:
5801      "MIME-Version not listed in P1, general header fields"
5802    </t>
5803    <t>
5804      <eref target=""/>:
5805      "IANA registry for content/transfer encodings"
5806    </t>
5807    <t>
5808      <eref target=""/>:
5809      "Case-sensitivity of HTTP-date"
5810    </t>
5811    <t>
5812      <eref target=""/>:
5813      "use of term "word" when talking about header structure"
5814    </t>
5815  </list>
5818  Partly resolved issues:
5819  <list style="symbols">
5820    <t>
5821      <eref target=""/>:
5822      "Term for the requested resource's URI"
5823    </t>
5824  </list>
5828<section title="Since draft-ietf-httpbis-p1-messaging-10" anchor="changes.since.10">
5830  Closed issues:
5831  <list style="symbols">
5832    <t>
5833      <eref target=""/>:
5834      "Connection Closing"
5835    </t>
5836    <t>
5837      <eref target=""/>:
5838      "Delimiting messages with multipart/byteranges"
5839    </t>
5840    <t>
5841      <eref target=""/>:
5842      "Handling multiple Content-Length headers"
5843    </t>
5844    <t>
5845      <eref target=""/>:
5846      "Clarify entity / representation / variant terminology"
5847    </t>
5848    <t>
5849      <eref target=""/>:
5850      "consider removing the 'changes from 2068' sections"
5851    </t>
5852  </list>
5855  Partly resolved issues:
5856  <list style="symbols">
5857    <t>
5858      <eref target=""/>:
5859      "HTTP(s) URI scheme definitions"
5860    </t>
5861  </list>
5865<section title="Since draft-ietf-httpbis-p1-messaging-11" anchor="changes.since.11">
5867  Closed issues:
5868  <list style="symbols">
5869    <t>
5870      <eref target=""/>:
5871      "Trailer requirements"
5872    </t>
5873    <t>
5874      <eref target=""/>:
5875      "Text about clock requirement for caches belongs in p6"
5876    </t>
5877    <t>
5878      <eref target=""/>:
5879      "effective request URI: handling of missing host in HTTP/1.0"
5880    </t>
5881    <t>
5882      <eref target=""/>:
5883      "confusing Date requirements for clients"
5884    </t>
5885  </list>
5888  Partly resolved issues:
5889  <list style="symbols">
5890    <t>
5891      <eref target=""/>:
5892      "Handling multiple Content-Length headers"
5893    </t>
5894  </list>
5898<section title="Since draft-ietf-httpbis-p1-messaging-12" anchor="changes.since.12">
5900  Closed issues:
5901  <list style="symbols">
5902    <t>
5903      <eref target=""/>:
5904      "RFC2145 Normative"
5905    </t>
5906    <t>
5907      <eref target=""/>:
5908      "HTTP(s) URI scheme definitions" (tune the requirements on userinfo)
5909    </t>
5910    <t>
5911      <eref target=""/>:
5912      "define 'transparent' proxy"
5913    </t>
5914    <t>
5915      <eref target=""/>:
5916      "Header Classification"
5917    </t>
5918    <t>
5919      <eref target=""/>:
5920      "Is * usable as a request-uri for new methods?"
5921    </t>
5922    <t>
5923      <eref target=""/>:
5924      "Migrate Upgrade details from RFC2817"
5925    </t>
5926    <t>
5927      <eref target=""/>:
5928      "untangle ABNFs for header fields"
5929    </t>
5930    <t>
5931      <eref target=""/>:
5932      "update RFC 2109 reference"
5933    </t>
5934  </list>
5938<section title="Since draft-ietf-httpbis-p1-messaging-13" anchor="changes.since.13">
5940  Closed issues:
5941  <list style="symbols">
5942    <t>
5943      <eref target=""/>:
5944      "Allow is not in 13.5.2"
5945    </t>
5946    <t>
5947      <eref target=""/>:
5948      "untangle ABNFs for header fields"
5949    </t>
5950    <t>
5951      <eref target=""/>:
5952      "Content-Length ABNF broken"
5953    </t>
5954  </list>
5958<section title="Since draft-ietf-httpbis-p1-messaging-14" anchor="changes.since.14">
5960  Closed issues:
5961  <list style="symbols">
5962    <t>
5963      <eref target=""/>:
5964      "HTTP-Version should be redefined as fixed length pair of DIGIT . DIGIT"
5965    </t>
5966    <t>
5967      <eref target=""/>:
5968      "Recommend minimum sizes for protocol elements"
5969    </t>
5970    <t>
5971      <eref target=""/>:
5972      "Set expectations around buffering"
5973    </t>
5974    <t>
5975      <eref target=""/>:
5976      "Considering messages in isolation"
5977    </t>
5978  </list>
Note: See TracBrowser for help on using the repository browser.