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

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

s/HEX/HEXDIG/, also add section targets for some RFC2396 references related to percent escaping (related to #36)

  • Property svn:eol-style set to native
File size: 199.1 KB
Line 
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='http://purl.org/net/xml2rfc/ext'>MAY</bcp14>">
5  <!ENTITY MUST "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MUST</bcp14>">
6  <!ENTITY MUST-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MUST NOT</bcp14>">
7  <!ENTITY OPTIONAL "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>OPTIONAL</bcp14>">
8  <!ENTITY RECOMMENDED "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>RECOMMENDED</bcp14>">
9  <!ENTITY REQUIRED "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>REQUIRED</bcp14>">
10  <!ENTITY SHALL "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHALL</bcp14>">
11  <!ENTITY SHALL-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHALL NOT</bcp14>">
12  <!ENTITY SHOULD "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHOULD</bcp14>">
13  <!ENTITY SHOULD-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHOULD NOT</bcp14>">
14  <!ENTITY ID-VERSION "latest">
15  <!ENTITY ID-MONTH "August">
16  <!ENTITY ID-YEAR "2008">
17  <!ENTITY caching                "<xref target='Part6' x:rel='#caching' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
18  <!ENTITY payload                "<xref target='Part3' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
19  <!ENTITY media-types            "<xref target='Part3' x:rel='#media.types' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
20  <!ENTITY content-codings        "<xref target='Part3' x:rel='#content.codings' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
21  <!ENTITY CONNECT                "<xref target='Part2' x:rel='#CONNECT' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
22  <!ENTITY content.negotiation    "<xref target='Part3' x:rel='#content.negotiation' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
23  <!ENTITY diff2045entity         "<xref target='Part3' x:rel='#differences.between.http.entities.and.rfc.2045.entities' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
24  <!ENTITY entity                 "<xref target='Part3' x:rel='#entity' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
25  <!ENTITY entity-body            "<xref target='Part3' x:rel='#entity.body' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
26  <!ENTITY entity-header-fields   "<xref target='Part3' x:rel='#entity.header.fields' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
27  <!ENTITY header-accept          "<xref target='Part3' x:rel='#header.accept' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
28  <!ENTITY header-cache-control   "<xref target='Part6' x:rel='#header.cache-control' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
29  <!ENTITY header-expect          "<xref target='Part2' x:rel='#header.expect' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
30  <!ENTITY header-pragma          "<xref target='Part6' x:rel='#header.pragma' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
31  <!ENTITY header-warning         "<xref target='Part6' x:rel='#header.warning' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
32  <!ENTITY idempotent-methods     "<xref target='Part2' x:rel='#idempotent.methods' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
33  <!ENTITY qvalue                 "<xref target='Part3' x:rel='#quality.values' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
34  <!ENTITY request-header-fields  "<xref target='Part2' x:rel='#request.header.fields' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
35  <!ENTITY response-header-fields "<xref target='Part2' x:rel='#response.header.fields' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
36  <!ENTITY method                 "<xref target='Part2' x:rel='#method' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
37  <!ENTITY status-codes           "<xref target='Part2' x:rel='#status.codes' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
38  <!ENTITY status-100             "<xref target='Part2' x:rel='#status.100' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
39  <!ENTITY status-1xx             "<xref target='Part2' x:rel='#status.1xx' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
40  <!ENTITY status-414             "<xref target='Part2' x:rel='#status.414' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
41]>
42<?rfc toc="yes" ?>
43<?rfc symrefs="yes" ?>
44<?rfc sortrefs="yes" ?>
45<?rfc compact="yes"?>
46<?rfc subcompact="no" ?>
47<?rfc linkmailto="no" ?>
48<?rfc editing="no" ?>
49<?rfc comments="yes"?>
50<?rfc inline="yes"?>
51<?rfc-ext allow-markup-in-artwork="yes" ?>
52<?rfc-ext include-references-in-index="yes" ?>
53<rfc obsoletes="2616" category="std" x:maturity-level="draft"
54     ipr="full3978" docName="draft-ietf-httpbis-p1-messaging-&ID-VERSION;"
55     xmlns:x='http://purl.org/net/xml2rfc/ext'>
56<front>
57
58  <title abbrev="HTTP/1.1, Part 1">HTTP/1.1, part 1: URIs, Connections, and Message Parsing</title>
59
60  <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
61    <organization abbrev="Day Software">Day Software</organization>
62    <address>
63      <postal>
64        <street>23 Corporate Plaza DR, Suite 280</street>
65        <city>Newport Beach</city>
66        <region>CA</region>
67        <code>92660</code>
68        <country>USA</country>
69      </postal>
70      <phone>+1-949-706-5300</phone>
71      <facsimile>+1-949-706-5305</facsimile>
72      <email>fielding@gbiv.com</email>
73      <uri>http://roy.gbiv.com/</uri>
74    </address>
75  </author>
76
77  <author initials="J." surname="Gettys" fullname="Jim Gettys">
78    <organization>One Laptop per Child</organization>
79    <address>
80      <postal>
81        <street>21 Oak Knoll Road</street>
82        <city>Carlisle</city>
83        <region>MA</region>
84        <code>01741</code>
85        <country>USA</country>
86      </postal>
87      <email>jg@laptop.org</email>
88      <uri>http://www.laptop.org/</uri>
89    </address>
90  </author>
91 
92  <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
93    <organization abbrev="HP">Hewlett-Packard Company</organization>
94    <address>
95      <postal>
96        <street>HP Labs, Large Scale Systems Group</street>
97        <street>1501 Page Mill Road, MS 1177</street>
98        <city>Palo Alto</city>
99        <region>CA</region>
100        <code>94304</code>
101        <country>USA</country>
102      </postal>
103      <email>JeffMogul@acm.org</email>
104    </address>
105  </author>
106
107  <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
108    <organization abbrev="Microsoft">Microsoft Corporation</organization>
109    <address>
110      <postal>
111        <street>1 Microsoft Way</street>
112        <city>Redmond</city>
113        <region>WA</region>
114        <code>98052</code>
115        <country>USA</country>
116      </postal>
117      <email>henrikn@microsoft.com</email>
118    </address>
119  </author>
120
121  <author initials="L." surname="Masinter" fullname="Larry Masinter">
122    <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
123    <address>
124      <postal>
125        <street>345 Park Ave</street>
126        <city>San Jose</city>
127        <region>CA</region>
128        <code>95110</code>
129        <country>USA</country>
130      </postal>
131      <email>LMM@acm.org</email>
132      <uri>http://larry.masinter.net/</uri>
133    </address>
134  </author>
135 
136  <author initials="P." surname="Leach" fullname="Paul J. Leach">
137    <organization abbrev="Microsoft">Microsoft Corporation</organization>
138    <address>
139      <postal>
140        <street>1 Microsoft Way</street>
141        <city>Redmond</city>
142        <region>WA</region>
143        <code>98052</code>
144      </postal>
145      <email>paulle@microsoft.com</email>
146    </address>
147  </author>
148   
149  <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
150    <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
151    <address>
152      <postal>
153        <street>MIT Computer Science and Artificial Intelligence Laboratory</street>
154        <street>The Stata Center, Building 32</street>
155        <street>32 Vassar Street</street>
156        <city>Cambridge</city>
157        <region>MA</region>
158        <code>02139</code>
159        <country>USA</country>
160      </postal>
161      <email>timbl@w3.org</email>
162      <uri>http://www.w3.org/People/Berners-Lee/</uri>
163    </address>
164  </author>
165
166  <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
167    <organization abbrev="W3C">World Wide Web Consortium</organization>
168    <address>
169      <postal>
170        <street>W3C / ERCIM</street>
171        <street>2004, rte des Lucioles</street>
172        <city>Sophia-Antipolis</city>
173        <region>AM</region>
174        <code>06902</code>
175        <country>France</country>
176      </postal>
177      <email>ylafon@w3.org</email>
178      <uri>http://www.raubacapeu.net/people/yves/</uri>
179    </address>
180  </author>
181
182  <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
183    <organization abbrev="greenbytes">greenbytes GmbH</organization>
184    <address>
185      <postal>
186        <street>Hafenweg 16</street>
187        <city>Muenster</city><region>NW</region><code>48155</code>
188        <country>Germany</country>
189      </postal>
190      <phone>+49 251 2807760</phone>   
191      <facsimile>+49 251 2807761</facsimile>   
192      <email>julian.reschke@greenbytes.de</email>       
193      <uri>http://greenbytes.de/tech/webdav/</uri>     
194    </address>
195  </author>
196
197  <date month="&ID-MONTH;" year="&ID-YEAR;"/>
198
199<abstract>
200<t>
201   The Hypertext Transfer Protocol (HTTP) is an application-level
202   protocol for distributed, collaborative, hypermedia information
203   systems. HTTP has been in use by the World Wide Web global information
204   initiative since 1990. This document is Part 1 of the seven-part specification
205   that defines the protocol referred to as "HTTP/1.1" and, taken together,
206   obsoletes RFC 2616.  Part 1 provides an overview of HTTP and
207   its associated terminology, defines the "http" and "https" Uniform
208   Resource Identifier (URI) schemes, defines the generic message syntax
209   and parsing requirements for HTTP message frames, and describes
210   general security concerns for implementations.
211</t>
212</abstract>
213
214<note title="Editorial Note (To be removed by RFC Editor)">
215  <t>
216    Discussion of this draft should take place on the HTTPBIS working group
217    mailing list (ietf-http-wg@w3.org). The current issues list is
218    at <eref target="http://www.tools.ietf.org/wg/httpbis/trac/report/11"/>
219    and related documents (including fancy diffs) can be found at
220    <eref target="http://www.tools.ietf.org/wg/httpbis/"/>.
221  </t>
222  <t>
223    The changes in this draft are summarized in <xref target="changes.since.02"/>.
224  </t>
225</note>
226</front>
227<middle>
228<section title="Introduction" anchor="introduction">
229<t>
230   The Hypertext Transfer Protocol (HTTP) is an application-level
231   protocol for distributed, collaborative, hypermedia information
232   systems. HTTP has been in use by the World-Wide Web global
233   information initiative since 1990. The first version of HTTP, commonly
234   referred to as HTTP/0.9, was a simple protocol for raw data transfer
235   across the Internet with only a single method and no metadata.
236   HTTP/1.0, as defined by <xref target="RFC1945"/>, improved
237   the protocol by allowing messages to be in the format of MIME-like
238   messages, containing metadata about the data transferred and
239   modifiers on the request/response semantics. However, HTTP/1.0 did
240   not sufficiently take into consideration the effects of hierarchical
241   proxies, caching, the need for persistent connections, or name-based
242   virtual hosts. In addition, the proliferation of incompletely-implemented
243   applications calling themselves "HTTP/1.0" necessitated a
244   protocol version change in order for two communicating applications
245   to determine each other's true capabilities.
246</t>
247<t>
248   This document is Part 1 of the seven-part specification that defines
249   the protocol referred to as "HTTP/1.1", obsoleting <xref target="RFC2616"/>.
250   HTTP/1.1 remains compatible with HTTP/1.0 by including more stringent
251   requirements that enable reliable implementations and adding only
252   those new features that will either be safely ignored by an HTTP/1.0
253   recipient or only sent when communicating with a party advertising
254   compliance with HTTP/1.1.
255   Part 1 defines those aspects of HTTP/1.1 related to overall network
256   operation, message framing, interaction with transport protocols, and
257   URI schemes.
258</t>
259<t>
260   This document is currently disorganized in order to minimize the changes
261   between drafts and enable reviewers to see the smaller errata changes.
262   The next draft will reorganize the sections to better reflect the content.
263   In particular, the sections will be organized according to the typical
264   process of deciding when to use HTTP (URI schemes), overall network operation,
265   connection management, message framing, and generic message parsing.
266   The current mess reflects how widely dispersed these topics and associated
267   requirements had become in <xref target="RFC2616"/>.
268</t>
269
270<section title="Purpose" anchor="intro.purpose">
271<t>
272   Practical information systems require more functionality than simple
273   retrieval, including search, front-end update, and annotation. HTTP
274   allows an open-ended set of methods and headers that indicate the
275   purpose of a request <xref target="RFC2324"/>. It builds on the discipline of reference
276   provided by the Uniform Resource Identifier (URI) <xref target="RFC1630"/>, as a location
277   (URL) <xref target="RFC1738"/> or name (URN) <xref target="RFC1737"/>, for indicating the resource to which a
278   method is to be applied. Messages are passed in a format similar to
279   that used by Internet mail <xref target="RFC2822"/> as defined by the Multipurpose
280   Internet Mail Extensions (MIME) <xref target="RFC2045"/>.
281</t>
282<t>
283   HTTP is also used as a generic protocol for communication between
284   user agents and proxies/gateways to other Internet systems, including
285   those supported by the SMTP <xref target="RFC2821"/>, NNTP <xref target="RFC3977"/>, FTP <xref target="RFC959"/>, Gopher <xref target="RFC1436"/>,
286   and WAIS <xref target="WAIS"/> protocols. In this way, HTTP allows basic hypermedia
287   access to resources available from diverse applications.
288</t>
289</section>
290
291<section title="Requirements" anchor="intro.requirements">
292<t>
293   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
294   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
295   document are to be interpreted as described in <xref target="RFC2119"/>.
296</t>
297<t>
298   An implementation is not compliant if it fails to satisfy one or more
299   of the &MUST; or &REQUIRED; level requirements for the protocols it
300   implements. An implementation that satisfies all the &MUST; or &REQUIRED;
301   level and all the &SHOULD; level requirements for its protocols is said
302   to be "unconditionally compliant"; one that satisfies all the &MUST;
303   level requirements but not all the &SHOULD; level requirements for its
304   protocols is said to be "conditionally compliant."
305</t>
306</section>
307
308<section title="Terminology" anchor="intro.terminology">
309<t>
310   This specification uses a number of terms to refer to the roles
311   played by participants in, and objects of, the HTTP communication.
312</t>
313<t>
314  <iref item="connection"/>
315  <x:dfn>connection</x:dfn>
316  <list>
317    <t>
318      A transport layer virtual circuit established between two programs
319      for the purpose of communication.
320    </t>
321  </list>
322</t>
323<t>
324  <iref item="message"/>
325  <x:dfn>message</x:dfn>
326  <list>
327    <t>
328      The basic unit of HTTP communication, consisting of a structured
329      sequence of octets matching the syntax defined in <xref target="http.message"/> and
330      transmitted via the connection.
331    </t>
332  </list>
333</t>
334<t>
335  <iref item="request"/>
336  <x:dfn>request</x:dfn>
337  <list>
338    <t>
339      An HTTP request message, as defined in <xref target="request"/>.
340    </t>
341  </list>
342</t>
343<t>
344  <iref item="response"/>
345  <x:dfn>response</x:dfn>
346  <list>
347    <t>
348      An HTTP response message, as defined in <xref target="response"/>.
349    </t>
350  </list>
351</t>
352<t>
353  <iref item="resource"/>
354  <x:dfn>resource</x:dfn>
355  <list>
356    <t>
357      A network data object or service that can be identified by a URI,
358      as defined in <xref target="uri"/>. Resources may be available in multiple
359      representations (e.g. multiple languages, data formats, size, and
360      resolutions) or vary in other ways.
361    </t>
362  </list>
363</t>
364<t>
365  <iref item="entity"/>
366  <x:dfn>entity</x:dfn>
367  <list>
368    <t>
369      The information transferred as the payload of a request or
370      response. An entity consists of metainformation in the form of
371      entity-header fields and content in the form of an entity-body, as
372      described in &entity;.
373    </t>
374  </list>
375</t>
376<t>
377  <iref item="representation"/>
378  <x:dfn>representation</x:dfn>
379  <list>
380    <t>
381      An entity included with a response that is subject to content
382      negotiation, as described in &content.negotiation;. There may exist multiple
383      representations associated with a particular response status.
384    </t>
385  </list>
386</t>
387<t>
388  <iref item="content negotiation"/>
389  <x:dfn>content negotiation</x:dfn>
390  <list>
391    <t>
392      The mechanism for selecting the appropriate representation when
393      servicing a request, as described in &content.negotiation;. The
394      representation of entities in any response can be negotiated
395      (including error responses).
396    </t>
397  </list>
398</t>
399<t>
400  <iref item="variant"/>
401  <x:dfn>variant</x:dfn>
402  <list>
403    <t>
404      A resource may have one, or more than one, representation(s)
405      associated with it at any given instant. Each of these
406      representations is termed a `variant'.  Use of the term `variant'
407      does not necessarily imply that the resource is subject to content
408      negotiation.
409    </t>
410  </list>
411</t>
412<t>
413  <iref item="client"/>
414  <x:dfn>client</x:dfn>
415  <list>
416    <t>
417      A program that establishes connections for the purpose of sending
418      requests.
419    </t>
420  </list>
421</t>
422<t>
423  <iref item="user agent"/>
424  <x:dfn>user agent</x:dfn>
425  <list>
426    <t>
427      The client which initiates a request. These are often browsers,
428      editors, spiders (web-traversing robots), or other end user tools.
429    </t>
430  </list>
431</t>
432<t>
433  <iref item="server"/>
434  <x:dfn>server</x:dfn>
435  <list>
436    <t>
437      An application program that accepts connections in order to
438      service requests by sending back responses. Any given program may
439      be capable of being both a client and a server; our use of these
440      terms refers only to the role being performed by the program for a
441      particular connection, rather than to the program's capabilities
442      in general. Likewise, any server may act as an origin server,
443      proxy, gateway, or tunnel, switching behavior based on the nature
444      of each request.
445    </t>
446  </list>
447</t>
448<t>
449  <iref item="origin server"/>
450  <x:dfn>origin server</x:dfn>
451  <list>
452    <t>
453      The server on which a given resource resides or is to be created.
454    </t>
455  </list>
456</t>
457<t>
458  <iref item="proxy"/>
459  <x:dfn>proxy</x:dfn>
460  <list>
461    <t>
462      An intermediary program which acts as both a server and a client
463      for the purpose of making requests on behalf of other clients.
464      Requests are serviced internally or by passing them on, with
465      possible translation, to other servers. A proxy &MUST; implement
466      both the client and server requirements of this specification. A
467      "transparent proxy" is a proxy that does not modify the request or
468      response beyond what is required for proxy authentication and
469      identification. A "non-transparent proxy" is a proxy that modifies
470      the request or response in order to provide some added service to
471      the user agent, such as group annotation services, media type
472      transformation, protocol reduction, or anonymity filtering. Except
473      where either transparent or non-transparent behavior is explicitly
474      stated, the HTTP proxy requirements apply to both types of
475      proxies.
476    </t>
477  </list>
478</t>
479<t>
480  <iref item="gateway"/>
481  <x:dfn>gateway</x:dfn>
482  <list>
483    <t>
484      A server which acts as an intermediary for some other server.
485      Unlike a proxy, a gateway receives requests as if it were the
486      origin server for the requested resource; the requesting client
487      may not be aware that it is communicating with a gateway.
488    </t>
489  </list>
490</t>
491<t>
492  <iref item="tunnel"/>
493  <x:dfn>tunnel</x:dfn>
494  <list>
495    <t>
496      An intermediary program which is acting as a blind relay between
497      two connections. Once active, a tunnel is not considered a party
498      to the HTTP communication, though the tunnel may have been
499      initiated by an HTTP request. The tunnel ceases to exist when both
500      ends of the relayed connections are closed.
501    </t>
502  </list>
503</t>
504<t>
505  <iref item="cache"/>
506  <x:dfn>cache</x:dfn>
507  <list>
508    <t>
509      A program's local store of response messages and the subsystem
510      that controls its message storage, retrieval, and deletion. A
511      cache stores cacheable responses in order to reduce the response
512      time and network bandwidth consumption on future, equivalent
513      requests. Any client or server may include a cache, though a cache
514      cannot be used by a server that is acting as a tunnel.
515    </t>
516  </list>
517</t>
518<t>
519  <iref item="cacheable"/>
520  <x:dfn>cacheable</x:dfn>
521  <list>
522    <t>
523      A response is cacheable if a cache is allowed to store a copy of
524      the response message for use in answering subsequent requests. The
525      rules for determining the cacheability of HTTP responses are
526      defined in &caching;. Even if a resource is cacheable, there may
527      be additional constraints on whether a cache can use the cached
528      copy for a particular request.
529    </t>
530  </list>
531</t>
532<t>
533  <iref item="upstream"/>
534  <iref item="downstream"/>
535  <x:dfn>upstream</x:dfn>/<x:dfn>downstream</x:dfn>
536  <list>
537    <t>
538      Upstream and downstream describe the flow of a message: all
539      messages flow from upstream to downstream.
540    </t>
541  </list>
542</t>
543<t>
544  <iref item="inbound"/>
545  <iref item="outbound"/>
546  <x:dfn>inbound</x:dfn>/<x:dfn>outbound</x:dfn>
547  <list>
548    <t>
549      Inbound and outbound refer to the request and response paths for
550      messages: "inbound" means "traveling toward the origin server",
551      and "outbound" means "traveling toward the user agent"
552    </t>
553  </list>
554</t>
555</section>
556
557<section title="Overall Operation" anchor="intro.overall.operation">
558<t>
559   HTTP is a request/response protocol. A client sends a
560   request to the server in the form of a request method, URI, and
561   protocol version, followed by a MIME-like message containing request
562   modifiers, client information, and possible body content over a
563   connection with a server. The server responds with a status line,
564   including the message's protocol version and a success or error code,
565   followed by a MIME-like message containing server information, entity
566   metainformation, and possible entity-body content. The relationship
567   between HTTP and MIME is described in &diff2045entity;.
568</t>
569<t>
570   Most HTTP communication is initiated by a user agent and consists of
571   a request to be applied to a resource on some origin server. In the
572   simplest case, this may be accomplished via a single connection (v)
573   between the user agent (UA) and the origin server (O).
574</t>
575<figure><artwork type="drawing">
576       request chain ------------------------&gt;
577    UA -------------------v------------------- O
578       &lt;----------------------- response chain
579</artwork></figure>
580<t>
581   A more complicated situation occurs when one or more intermediaries
582   are present in the request/response chain. There are three common
583   forms of intermediary: proxy, gateway, and tunnel. A proxy is a
584   forwarding agent, receiving requests for a URI in its absolute form,
585   rewriting all or part of the message, and forwarding the reformatted
586   request toward the server identified by the URI. A gateway is a
587   receiving agent, acting as a layer above some other server(s) and, if
588   necessary, translating the requests to the underlying server's
589   protocol. A tunnel acts as a relay point between two connections
590   without changing the messages; tunnels are used when the
591   communication needs to pass through an intermediary (such as a
592   firewall) even when the intermediary cannot understand the contents
593   of the messages.
594</t>
595<figure><artwork type="drawing">
596       request chain --------------------------------------&gt;
597    UA -----v----- A -----v----- B -----v----- C -----v----- O
598       &lt;------------------------------------- response chain
599</artwork></figure>
600<t>
601   The figure above shows three intermediaries (A, B, and C) between the
602   user agent and origin server. A request or response message that
603   travels the whole chain will pass through four separate connections.
604   This distinction is important because some HTTP communication options
605   may apply only to the connection with the nearest, non-tunnel
606   neighbor, only to the end-points of the chain, or to all connections
607   along the chain. Although the diagram is linear, each participant may
608   be engaged in multiple, simultaneous communications. For example, B
609   may be receiving requests from many clients other than A, and/or
610   forwarding requests to servers other than C, at the same time that it
611   is handling A's request.
612</t>
613<t>
614   Any party to the communication which is not acting as a tunnel may
615   employ an internal cache for handling requests. The effect of a cache
616   is that the request/response chain is shortened if one of the
617   participants along the chain has a cached response applicable to that
618   request. The following illustrates the resulting chain if B has a
619   cached copy of an earlier response from O (via C) for a request which
620   has not been cached by UA or A.
621</t>
622<figure><artwork type="drawing">
623          request chain ----------&gt;
624       UA -----v----- A -----v----- B - - - - - - C - - - - - - O
625          &lt;--------- response chain
626</artwork></figure>
627<t>
628   Not all responses are usefully cacheable, and some requests may
629   contain modifiers which place special requirements on cache behavior.
630   HTTP requirements for cache behavior and cacheable responses are
631   defined in &caching;.
632</t>
633<t>
634   In fact, there are a wide variety of architectures and configurations
635   of caches and proxies currently being experimented with or deployed
636   across the World Wide Web. These systems include national hierarchies
637   of proxy caches to save transoceanic bandwidth, systems that
638   broadcast or multicast cache entries, organizations that distribute
639   subsets of cached data via CD-ROM, and so on. HTTP systems are used
640   in corporate intranets over high-bandwidth links, and for access via
641   PDAs with low-power radio links and intermittent connectivity. The
642   goal of HTTP/1.1 is to support the wide diversity of configurations
643   already deployed while introducing protocol constructs that meet the
644   needs of those who build web applications that require high
645   reliability and, failing that, at least reliable indications of
646   failure.
647</t>
648<t>
649   HTTP communication usually takes place over TCP/IP connections. The
650   default port is TCP 80 (<eref target="http://www.iana.org/assignments/port-numbers"/>), but other ports can be used. This does
651   not preclude HTTP from being implemented on top of any other protocol
652   on the Internet, or on other networks. HTTP only presumes a reliable
653   transport; any protocol that provides such guarantees can be used;
654   the mapping of the HTTP/1.1 request and response structures onto the
655   transport data units of the protocol in question is outside the scope
656   of this specification.
657</t>
658<t>
659   In HTTP/1.0, most implementations used a new connection for each
660   request/response exchange. In HTTP/1.1, a connection may be used for
661   one or more request/response exchanges, although connections may be
662   closed for a variety of reasons (see <xref target="persistent.connections"/>).
663</t>
664</section>
665</section>
666
667<section title="Notational Conventions and Generic Grammar" anchor="notation">
668
669<section title="Augmented BNF" anchor="notation.abnf">
670<t>
671   All of the mechanisms specified in this document are described in
672   both prose and an augmented Backus-Naur Form (BNF) similar to that
673   used by <xref target="RFC822ABNF"/>. Implementors will need to be familiar with the
674   notation in order to understand this specification. The augmented BNF
675   includes the following constructs:
676</t>
677<t>
678   name = definition
679  <list>
680    <t>
681      The name of a rule is simply the name itself (without any
682      enclosing "&lt;" and "&gt;") and is separated from its definition by the
683      equal "=" character. White space is only significant in that
684      indentation of continuation lines is used to indicate a rule
685      definition that spans more than one line. Certain basic rules are
686      in uppercase, such as SP, LWS, HTAB, CRLF, DIGIT, ALPHA, etc. Angle
687      brackets are used within definitions whenever their presence will
688      facilitate discerning the use of rule names.
689    </t>
690  </list>
691</t>
692<t>
693   "literal"
694  <list>
695    <t>
696      Quotation marks surround literal text. Unless stated otherwise,
697      the text is case-insensitive.
698    </t>
699  </list>
700</t>
701<t>
702   rule1 | rule2
703  <list>
704    <t>
705      Elements separated by a bar ("|") are alternatives, e.g., "yes |
706      no" will accept yes or no.
707    </t>
708  </list>
709</t>
710<t>
711   (rule1 rule2)
712  <list>
713    <t>
714      Elements enclosed in parentheses are treated as a single element.
715      Thus, "(elem (foo | bar) elem)" allows the token sequences "elem
716      foo elem" and "elem bar elem".
717    </t>
718  </list>
719</t>
720<t>
721   *rule
722  <list>
723    <t>
724      The character "*" preceding an element indicates repetition. The
725      full form is "&lt;n&gt;*&lt;m&gt;element" indicating at least &lt;n&gt; and at most
726      &lt;m&gt; occurrences of element. Default values are 0 and infinity so
727      that "*(element)" allows any number, including zero; "1*element"
728      requires at least one; and "1*2element" allows one or two.
729    </t>
730  </list>
731</t>
732<t>
733   [rule]
734  <list>
735    <t>
736      Square brackets enclose optional elements; "[foo bar]" is
737      equivalent to "*1(foo bar)".
738    </t>
739  </list>
740</t>
741<t>
742   N rule
743  <list>
744    <t>
745      Specific repetition: "&lt;n&gt;(element)" is equivalent to
746      "&lt;n&gt;*&lt;n&gt;(element)"; that is, exactly &lt;n&gt; occurrences of (element).
747      Thus 2DIGIT is a 2-digit number, and 3ALPHA is a string of three
748      alphabetic characters.
749    </t>
750  </list>
751</t>
752<t>
753   #rule
754  <list>
755    <t>
756      A construct "#" is defined, similar to "*", for defining lists of
757      elements. The full form is "&lt;n&gt;#&lt;m&gt;element" indicating at least
758      &lt;n&gt; and at most &lt;m&gt; elements, each separated by one or more commas
759      (",") and &OPTIONAL; linear white space (LWS). This makes the usual
760      form of lists very easy; a rule such as
761      <figure><artwork type="example">
762   ( *<x:ref>LWS</x:ref> element *( *<x:ref>LWS</x:ref> "," *<x:ref>LWS</x:ref> element ))</artwork></figure>
763    </t>
764    <t>
765      can be shown as
766      <figure><artwork type="example">
767   1#element</artwork></figure>
768    </t>
769    <t>
770      Wherever this construct is used, null elements are allowed, but do
771      not contribute to the count of elements present. That is,
772      "(element), , (element) " is permitted, but counts as only two
773      elements. Therefore, where at least one element is required, at
774      least one non-null element &MUST; be present. Default values are 0
775      and infinity so that "#element" allows any number, including zero;
776      "1#element" requires at least one; and "1#2element" allows one or
777      two.
778    </t>
779  </list>
780</t>
781<t>
782   ; comment
783  <list>
784    <t>
785      A semi-colon, set off some distance to the right of rule text,
786      starts a comment that continues to the end of line. This is a
787      simple way of including useful notes in parallel with the
788      specifications.
789    </t>
790  </list>
791</t>
792<t anchor="implied.LWS">
793  <iref item="implied *LWS" primary="true"/>
794   implied *LWS
795  <list>
796    <t>
797      The grammar described by this specification is word-based. Except
798      where noted otherwise, linear white space (LWS) can be included
799      between any two adjacent words (token or quoted-string), and
800      between adjacent words and separators, without changing the
801      interpretation of a field. At least one delimiter (LWS and/or
802      separators) &MUST; exist between any two tokens (for the definition
803      of "token" below), since they would otherwise be interpreted as a
804      single token.
805    </t>
806  </list>
807</t>
808</section>
809
810<section title="Basic Rules" anchor="basic.rules">
811<t anchor="core.rules">
812  <x:anchor-alias value="OCTET"/>
813  <x:anchor-alias value="CHAR"/>
814  <x:anchor-alias value="ALPHA"/>
815  <x:anchor-alias value="DIGIT"/>
816  <x:anchor-alias value="CTL"/>
817  <x:anchor-alias value="CR"/>
818  <x:anchor-alias value="LF"/>
819  <x:anchor-alias value="SP"/>
820  <x:anchor-alias value="HTAB"/>
821  <x:anchor-alias value="DQUOTE"/>
822   The following rules are used throughout this specification to
823   describe basic parsing constructs. The US-ASCII coded character set
824   is defined by ANSI X3.4-1986 <xref target="USASCII"/>.
825</t>
826<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="OCTET"/><iref primary="true" item="Grammar" subitem="CHAR"/><iref primary="true" item="Grammar" subitem="ALPHA"/><iref primary="true" item="Grammar" subitem="DIGIT"/><iref primary="true" item="Grammar" subitem="CTL"/><iref primary="true" item="Grammar" subitem="CR"/><iref primary="true" item="Grammar" subitem="LF"/><iref primary="true" item="Grammar" subitem="SP"/><iref primary="true" item="Grammar" subitem="HTAB"/><iref primary="true" item="Grammar" subitem="DQUOTE"/>
827  <x:ref>OCTET</x:ref>          = %x00-FF
828                   ; any 8-bit sequence of data
829  <x:ref>CHAR</x:ref>           = %x01-7F
830                   ; any US-ASCII character, excluding NUL
831  <x:ref>ALPHA</x:ref>          = %x41-5A | %x61-7A
832                   ; A-Z | a-z
833  <x:ref>DIGIT</x:ref>          = %x30-39
834                   ; any US-ASCII digit "0".."9"
835  <x:ref>CTL</x:ref>            = %x00-1F | %x7F
836                   ; (octets 0 - 31) and DEL (127)
837  <x:ref>CR</x:ref>             = %x0D
838                   ; US-ASCII CR, carriage return (13)
839  <x:ref>LF</x:ref>             = %x0A
840                   ; US-ASCII LF, linefeed (10)
841  <x:ref>SP</x:ref>             = %x20
842                   ; US-ASCII SP, space (32)
843  <x:ref>HTAB</x:ref>           = %x09
844                   ; US-ASCII HT, horizontal-tab (9)
845  <x:ref>DQUOTE</x:ref>         = %x22
846                   ; US-ASCII double-quote mark (34)
847</artwork></figure>
848<t anchor="rule.CRLF">
849  <x:anchor-alias value="CRLF"/>
850   HTTP/1.1 defines the sequence CR LF as the end-of-line marker for all
851   protocol elements except the entity-body (see <xref target="tolerant.applications"/> for
852   tolerant applications). The end-of-line marker within an entity-body
853   is defined by its associated media type, as described in &media-types;.
854</t>
855<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="CRLF"/>
856  <x:ref>CRLF</x:ref>           = <x:ref>CR</x:ref> LF
857</artwork></figure>
858<t anchor="rule.LWS">
859  <x:anchor-alias value="LWS"/>
860   HTTP/1.1 header field values can be folded onto multiple lines if the
861   continuation line begins with a space or horizontal tab. All linear
862   white space, including folding, has the same semantics as SP. A
863   recipient &MAY; replace any linear white space with a single SP before
864   interpreting the field value or forwarding the message downstream.
865</t>
866<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="LWS"/>
867  <x:ref>LWS</x:ref>            = [<x:ref>CRLF</x:ref>] 1*( <x:ref>SP</x:ref> | <x:ref>HTAB</x:ref> )
868</artwork></figure>
869<t anchor="rule.TEXT">
870  <x:anchor-alias value="TEXT"/>
871   The TEXT rule is only used for descriptive field contents and values
872   that are not intended to be interpreted by the message parser. Words
873   of *TEXT &MAY; contain characters from character sets other than ISO-8859-1
874   <xref target="ISO-8859-1"/> only when encoded according to the rules of
875   <xref target="RFC2047"/>.
876</t>
877<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="TEXT"/>
878  <x:ref>TEXT</x:ref>           = %x20-7E | %x80-FF | <x:ref>LWS</x:ref>
879                 ; any <x:ref>OCTET</x:ref> except <x:ref>CTL</x:ref>s, but including <x:ref>LWS</x:ref>
880</artwork></figure>
881<t>
882   A CRLF is allowed in the definition of TEXT only as part of a header
883   field continuation. It is expected that the folding LWS will be
884   replaced with a single SP before interpretation of the TEXT value.
885</t>
886<t anchor="rule.HEXDIG">
887  <x:anchor-alias value="HEXDIG"/>
888   Hexadecimal numeric characters are used in several protocol elements.
889</t>
890<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="HEXDIG"/>
891  <x:ref>HEXDIG</x:ref>         = "A" | "B" | "C" | "D" | "E" | "F"
892                 | "a" | "b" | "c" | "d" | "e" | "f" | <x:ref>DIGIT</x:ref>
893</artwork></figure>
894<t anchor="rule.token.separators">
895  <x:anchor-alias value="tchar"/>
896  <x:anchor-alias value="token"/>
897  <x:anchor-alias value="separators"/>
898   Many HTTP/1.1 header field values consist of words separated by LWS
899   or special characters. These special characters &MUST; be in a quoted
900   string to be used within a parameter value (as defined in
901   <xref target="transfer.codings"/>).
902</t>
903<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="token"/><iref primary="true" item="Grammar" subitem="tchar"/><iref primary="true" item="Grammar" subitem="separators"/>
904  <x:ref>separators</x:ref>     = "(" | ")" | "&lt;" | "&gt;" | "@"
905                 | "," | ";" | ":" | "\" | <x:ref>DQUOTE</x:ref>
906                 | "/" | "[" | "]" | "?" | "="
907                 | "{" | "}" | <x:ref>SP</x:ref> | <x:ref>HTAB</x:ref>
908                 
909  <x:ref>tchar</x:ref>          = "!" | "#" | "$" | "%" | "&amp;" | "'" | "*"
910                 | "+" | "-" | "." | "^" | "_" | "`" | "|" | "~"
911                 | <x:ref>DIGIT</x:ref> | <x:ref>ALPHA</x:ref>
912                 ; any <x:ref>CHAR</x:ref> except <x:ref>CTL</x:ref>s or <x:ref>separators</x:ref>
913                 
914  <x:ref>token</x:ref>          = 1*<x:ref>tchar</x:ref>
915</artwork></figure>
916<t anchor="rule.comment">
917  <x:anchor-alias value="comment"/>
918  <x:anchor-alias value="ctext"/>
919   Comments can be included in some HTTP header fields by surrounding
920   the comment text with parentheses. Comments are only allowed in
921   fields containing "comment" as part of their field value definition.
922   In all other fields, parentheses are considered part of the field
923   value.
924</t>
925<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="comment"/><iref primary="true" item="Grammar" subitem="ctext"/>
926  <x:ref>comment</x:ref>        = "(" *( <x:ref>ctext</x:ref> | <x:ref>quoted-pair</x:ref> | <x:ref>comment</x:ref> ) ")"
927  <x:ref>ctext</x:ref>          = &lt;any <x:ref>TEXT</x:ref> excluding "(" and ")"&gt;
928</artwork></figure>
929<t anchor="rule.quoted-string">
930  <x:anchor-alias value="quoted-string"/>
931  <x:anchor-alias value="qdtext"/>
932   A string of text is parsed as a single word if it is quoted using
933   double-quote marks.
934</t>
935<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="quoted-string"/><iref primary="true" item="Grammar" subitem="qdtext"/>
936  <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> )
937  <x:ref>qdtext</x:ref>         = &lt;any <x:ref>TEXT</x:ref> excluding <x:ref>DQUOTE</x:ref> and "\">
938</artwork></figure>
939<t anchor="rule.quoted-pair">
940  <x:anchor-alias value="quoted-pair"/>
941  <x:anchor-alias value="quoted-text"/>
942   The backslash character ("\") &MAY; be used as a single-character
943   quoting mechanism only within quoted-string and comment constructs.
944</t>
945<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="quoted-text"/><iref primary="true" item="Grammar" subitem="quoted-pair"/>
946  <x:ref>quoted-text</x:ref>    = %x01-09 |
947                   %x0B-0C |
948                   %x0E-FF ; Characters excluding NUL, <x:ref>CR</x:ref> and <x:ref>LF</x:ref>
949  <x:ref>quoted-pair</x:ref>    = "\" <x:ref>quoted-text</x:ref>
950</artwork></figure>
951</section>
952
953<section title="ABNF Rules defined in other Parts of the Specification" anchor="abnf.dependencies">
954  <x:anchor-alias value="request-header"/>
955  <x:anchor-alias value="response-header"/>
956  <x:anchor-alias value="accept-params"/>
957  <x:anchor-alias value="entity-body"/>
958  <x:anchor-alias value="entity-header"/>
959  <x:anchor-alias value="Cache-Control"/>
960  <x:anchor-alias value="Pragma"/>
961  <x:anchor-alias value="Warning"/>
962<t>
963  The ABNF rules below are defined in other parts:
964</t>
965<figure><!-- Part2--><artwork type="abnf2616">
966  <x:ref>request-header</x:ref>  = &lt;request-header, defined in &request-header-fields;&gt;
967  <x:ref>response-header</x:ref> = &lt;response-header, defined in &response-header-fields;&gt;
968</artwork></figure>
969<figure><!-- Part3--><artwork type="abnf2616">
970  <x:ref>accept-params</x:ref>   = &lt;accept-params, defined in &header-accept;&gt;
971  <x:ref>entity-body</x:ref>     = &lt;entity-body, defined in &entity-body;&gt;
972  <x:ref>entity-header</x:ref>   = &lt;entity-header, defined in &entity-header-fields;&gt;
973</artwork></figure>
974<figure><!-- Part6--><artwork type="abnf2616">
975  <x:ref>Cache-Control</x:ref>   = &lt;Cache-Control, defined in &header-pragma;&gt;
976  <x:ref>Pragma</x:ref>          = &lt;Pragma, defined in &header-pragma;&gt;
977  <x:ref>Warning</x:ref>         = &lt;Warning, defined in &header-warning;&gt;
978</artwork></figure>
979</section>
980
981</section>
982
983<section title="Protocol Parameters" anchor="protocol.parameters">
984
985<section title="HTTP Version" anchor="http.version">
986  <x:anchor-alias value="HTTP-Version"/>
987  <x:anchor-alias value="HTTP-Prot-Name"/>
988<t>
989   HTTP uses a "&lt;major&gt;.&lt;minor&gt;" numbering scheme to indicate versions
990   of the protocol. The protocol versioning policy is intended to allow
991   the sender to indicate the format of a message and its capacity for
992   understanding further HTTP communication, rather than the features
993   obtained via that communication. No change is made to the version
994   number for the addition of message components which do not affect
995   communication behavior or which only add to extensible field values.
996   The &lt;minor&gt; number is incremented when the changes made to the
997   protocol add features which do not change the general message parsing
998   algorithm, but which may add to the message semantics and imply
999   additional capabilities of the sender. The &lt;major&gt; number is
1000   incremented when the format of a message within the protocol is
1001   changed. See <xref target="RFC2145"/> for a fuller explanation.
1002</t>
1003<t>
1004   The version of an HTTP message is indicated by an HTTP-Version field
1005   in the first line of the message. HTTP-Version is case-sensitive.
1006</t>
1007<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="HTTP-Version"/><iref primary="true" item="Grammar" subitem="HTTP-Prot-Name"/>
1008  <x:ref>HTTP-Version</x:ref>   = <x:ref>HTTP-Prot-Name</x:ref> "/" 1*<x:ref>DIGIT</x:ref> "." 1*<x:ref>DIGIT</x:ref>
1009  <x:ref>HTTP-Prot-Name</x:ref> = <x:abnf-char-sequence>"HTTP"</x:abnf-char-sequence> ; "HTTP", case-sensitive
1010</artwork></figure>
1011<t>
1012   Note that the major and minor numbers &MUST; be treated as separate
1013   integers and that each &MAY; be incremented higher than a single digit.
1014   Thus, HTTP/2.4 is a lower version than HTTP/2.13, which in turn is
1015   lower than HTTP/12.3. Leading zeros &MUST; be ignored by recipients and
1016   &MUST-NOT; be sent.
1017</t>
1018<t>
1019   An application that sends a request or response message that includes
1020   HTTP-Version of "HTTP/1.1" &MUST; be at least conditionally compliant
1021   with this specification. Applications that are at least conditionally
1022   compliant with this specification &SHOULD; use an HTTP-Version of
1023   "HTTP/1.1" in their messages, and &MUST; do so for any message that is
1024   not compatible with HTTP/1.0. For more details on when to send
1025   specific HTTP-Version values, see <xref target="RFC2145"/>.
1026</t>
1027<t>
1028   The HTTP version of an application is the highest HTTP version for
1029   which the application is at least conditionally compliant.
1030</t>
1031<t>
1032   Proxy and gateway applications need to be careful when forwarding
1033   messages in protocol versions different from that of the application.
1034   Since the protocol version indicates the protocol capability of the
1035   sender, a proxy/gateway &MUST-NOT; send a message with a version
1036   indicator which is greater than its actual version. If a higher
1037   version request is received, the proxy/gateway &MUST; either downgrade
1038   the request version, or respond with an error, or switch to tunnel
1039   behavior.
1040</t>
1041<t>
1042   Due to interoperability problems with HTTP/1.0 proxies discovered
1043   since the publication of <xref target="RFC2068"/>, caching proxies &MUST;, gateways
1044   &MAY;, and tunnels &MUST-NOT; upgrade the request to the highest version
1045   they support. The proxy/gateway's response to that request &MUST; be in
1046   the same major version as the request.
1047</t>
1048<t>
1049  <list>
1050    <t>
1051      <x:h>Note:</x:h> Converting between versions of HTTP may involve modification
1052      of header fields required or forbidden by the versions involved.
1053    </t>
1054  </list>
1055</t>
1056</section>
1057
1058<section title="Uniform Resource Identifiers" anchor="uri">
1059<t>
1060   URIs have been known by many names: WWW addresses, Universal Document
1061   Identifiers, Universal Resource Identifiers <xref target="RFC1630"/>, and finally the
1062   combination of Uniform Resource Locators (URL) <xref target="RFC1738"/> and Names (URN)
1063   <xref target="RFC1737"/>. As far as HTTP is concerned, Uniform Resource Identifiers are
1064   simply formatted strings which identify--via name, location, or any
1065   other characteristic--a resource.
1066</t>
1067
1068<section title="General Syntax" anchor="general.syntax">
1069  <x:anchor-alias value="absoluteURI"/>
1070  <x:anchor-alias value="authority"/>
1071  <x:anchor-alias value="fragment"/>
1072  <x:anchor-alias value="path-absolute"/>
1073  <x:anchor-alias value="port"/>
1074  <x:anchor-alias value="query"/>
1075  <x:anchor-alias value="relativeURI"/>
1076  <x:anchor-alias value="uri-host"/>
1077<t>
1078   URIs in HTTP can be represented in absolute form or relative to some
1079   known base URI <xref target="RFC1808"/>, depending upon the context of their use. The two
1080   forms are differentiated by the fact that absolute URIs always begin
1081   with a scheme name followed by a colon. For definitive information on
1082   URL syntax and semantics, see "Uniform Resource Identifiers (URI):
1083   Generic Syntax and Semantics," <xref target="RFC2396"/> (which replaces <xref target="RFC1738"/>
1084   and <xref target="RFC1808"/>). This specification adopts the
1085   definitions of "URI-reference", "absoluteURI", "fragment", "relativeURI", "port",
1086   "host", "abs_path", "query", and "authority" from that specification:
1087</t>
1088<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="absoluteURI"/><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="relativeURI"/><iref primary="true" item="Grammar" subitem="uri-host"/>
1089  <x:ref>absoluteURI</x:ref>   = &lt;absoluteURI, defined in <xref target="RFC2396" x:fmt="," x:sec="3"/>>
1090  <x:ref>authority</x:ref>     = &lt;authority, defined in <xref target="RFC2396" x:fmt="," x:sec="3.2"/>>
1091  <x:ref>fragment</x:ref>      = &lt;fragment, defined in <xref target="RFC2396" x:fmt="," x:sec="4.1"/>>
1092  <x:ref>path-absolute</x:ref> = &lt;abs_path, defined in <xref target="RFC2396" x:fmt="," x:sec="3"/>>
1093  <x:ref>port</x:ref>          = &lt;port, defined in <xref target="RFC2396" x:fmt="," x:sec="3.2.2"/>>
1094  <x:ref>query</x:ref>         = &lt;query, defined in <xref target="RFC2396" x:fmt="," x:sec="3.4"/>>
1095  <x:ref>relativeURI</x:ref>   = &lt;relativeURI, defined in <xref target="RFC2396" x:fmt="," x:sec="5"/>>
1096  <x:ref>uri-host</x:ref>      = &lt;host, defined in <xref target="RFC2396" x:fmt="," x:sec="3.2.2"/>>
1097</artwork></figure>
1098<t>
1099   HTTP does not place any a priori limit on the length of
1100   a URI. Servers &MUST; be able to handle the URI of any resource they
1101   serve, and &SHOULD; be able to handle URIs of unbounded length if they
1102   provide GET-based forms that could generate such URIs. A server
1103   &SHOULD; return 414 (Request-URI Too Long) status if a URI is longer
1104   than the server can handle (see &status-414;).
1105</t>
1106<t>
1107  <list>
1108    <t>
1109      <x:h>Note:</x:h> Servers ought to be cautious about depending on URI lengths
1110      above 255 bytes, because some older client or proxy
1111      implementations might not properly support these lengths.
1112    </t>
1113  </list>
1114</t>
1115</section>
1116
1117<section title="http URL" anchor="http.url">
1118  <x:anchor-alias value="http-URL"/>
1119<t>
1120   The "http" scheme is used to locate network resources via the HTTP
1121   protocol. This section defines the scheme-specific syntax and
1122   semantics for http URLs.
1123</t>
1124<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="http-URL"/>
1125  <x:ref>http-URL</x:ref> = "http:" "//" <x:ref>uri-host</x:ref> [ ":" <x:ref>port</x:ref> ]
1126             [ <x:ref>path-absolute</x:ref> [ "?" <x:ref>query</x:ref> ]]
1127</artwork></figure>
1128<t>
1129   If the port is empty or not given, port 80 is assumed. The semantics
1130   are that the identified resource is located at the server listening
1131   for TCP connections on that port of that host, and the Request-URI
1132   for the resource is path-absolute (<xref target="request-uri"/>). The use of IP addresses
1133   in URLs &SHOULD; be avoided whenever possible (see <xref target="RFC1900"/>). If
1134   the path-absolute is not present in the URL, it &MUST; be given as "/" when
1135   used as a Request-URI for a resource (<xref target="request-uri"/>). If a proxy
1136   receives a host name which is not a fully qualified domain name, it
1137   &MAY; add its domain to the host name it received. If a proxy receives
1138   a fully qualified domain name, the proxy &MUST-NOT; change the host
1139   name.
1140</t>
1141</section>
1142
1143<section title="URI Comparison" anchor="uri.comparison">
1144<t>
1145   When comparing two URIs to decide if they match or not, a client
1146   &SHOULD; use a case-sensitive octet-by-octet comparison of the entire
1147   URIs, with these exceptions:
1148  <list style="symbols">
1149    <t>A port that is empty or not given is equivalent to the default
1150        port for that URI-reference;</t>
1151    <t>Comparisons of host names &MUST; be case-insensitive;</t>
1152    <t>Comparisons of scheme names &MUST; be case-insensitive;</t>
1153    <t>An empty path-absolute is equivalent to an path-absolute of "/".</t>
1154  </list>
1155</t>
1156<t>
1157   Characters other than those in the "reserved" set (see
1158   <xref target="RFC2396" x:fmt="," x:sec="2.2"/>) are equivalent to their
1159   ""%" <x:ref>HEXDIG</x:ref> <x:ref>HEXDIG</x:ref>" encoding.
1160</t>
1161<t>
1162   For example, the following three URIs are equivalent:
1163</t>
1164<figure><artwork type="example">
1165   http://example.com:80/~smith/home.html
1166   http://EXAMPLE.com/%7Esmith/home.html
1167   http://EXAMPLE.com:/%7esmith/home.html
1168</artwork></figure>
1169</section>
1170</section>
1171
1172<section title="Date/Time Formats" anchor="date.time.formats">
1173<section title="Full Date" anchor="full.date">
1174  <x:anchor-alias value="HTTP-date"/>
1175  <x:anchor-alias value="obsolete-date"/>
1176  <x:anchor-alias value="rfc1123-date"/>
1177  <x:anchor-alias value="rfc850-date"/>
1178  <x:anchor-alias value="asctime-date"/>
1179  <x:anchor-alias value="date1"/>
1180  <x:anchor-alias value="date2"/>
1181  <x:anchor-alias value="date3"/>
1182  <x:anchor-alias value="rfc1123-date"/>
1183  <x:anchor-alias value="time"/>
1184  <x:anchor-alias value="wkday"/>
1185  <x:anchor-alias value="weekday"/>
1186  <x:anchor-alias value="month"/>
1187<t>
1188   HTTP applications have historically allowed three different formats
1189   for the representation of date/time stamps:
1190</t>
1191<figure><artwork type="example">
1192   Sun, 06 Nov 1994 08:49:37 GMT  ; RFC 822, updated by RFC 1123
1193   Sunday, 06-Nov-94 08:49:37 GMT ; obsolete RFC 850 format
1194   Sun Nov  6 08:49:37 1994       ; ANSI C's asctime() format
1195</artwork></figure>
1196<t>
1197   The first format is preferred as an Internet standard and represents
1198   a fixed-length subset of that defined by <xref target="RFC1123"/> (an update to
1199   <xref target="RFC822"/>). The other formats are described here only for
1200   compatibility with obsolete implementations.
1201   HTTP/1.1 clients and servers that parse the date value &MUST; accept
1202   all three formats (for compatibility with HTTP/1.0), though they &MUST;
1203   only generate the RFC 1123 format for representing HTTP-date values
1204   in header fields. See <xref target="tolerant.applications"/> for further information.
1205</t>
1206<t><list><t>
1207      <x:h>Note:</x:h> Recipients of date values are encouraged to be robust in
1208      accepting date values that may have been sent by non-HTTP
1209      applications, as is sometimes the case when retrieving or posting
1210      messages via proxies/gateways to SMTP or NNTP.
1211</t></list></t>
1212<t>
1213   All HTTP date/time stamps &MUST; be represented in Greenwich Mean Time
1214   (GMT), without exception. For the purposes of HTTP, GMT is exactly
1215   equal to UTC (Coordinated Universal Time). This is indicated in the
1216   first two formats by the inclusion of "GMT" as the three-letter
1217   abbreviation for time zone, and &MUST; be assumed when reading the
1218   asctime format. HTTP-date is case sensitive and &MUST-NOT; include
1219   additional LWS beyond that specifically included as SP in the
1220   grammar.
1221</t>
1222<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="HTTP-date"/><iref primary="true" item="Grammar" subitem="rfc1123-date"/><iref primary="true" item="Grammar" subitem="obsolete-date"/><iref primary="true" item="Grammar" subitem="rfc850-date"/><iref primary="true" item="Grammar" subitem="asctime-date"/><iref primary="true" item="Grammar" subitem="date1"/><iref primary="true" item="Grammar" subitem="date2"/><iref primary="true" item="Grammar" subitem="date3"/><iref primary="true" item="Grammar" subitem="time"/><iref primary="true" item="Grammar" subitem="wkday"/><iref primary="true" item="Grammar" subitem="weekday"/><iref primary="true" item="Grammar" subitem="month"/>
1223  <x:ref>HTTP-date</x:ref>    = <x:ref>rfc1123-date</x:ref> | <x:ref>obsolete-date</x:ref>
1224  <x:ref>obsolete-date</x:ref> = <x:ref>rfc850-date</x:ref> | <x:ref>asctime-date</x:ref>
1225  <x:ref>rfc1123-date</x:ref> = <x:ref>wkday</x:ref> "," <x:ref>SP</x:ref> date1 <x:ref>SP</x:ref> time <x:ref>SP</x:ref> GMT
1226  <x:ref>rfc850-date</x:ref>  = <x:ref>weekday</x:ref> "," <x:ref>SP</x:ref> date2 <x:ref>SP</x:ref> time <x:ref>SP</x:ref> GMT
1227  <x:ref>asctime-date</x:ref> = <x:ref>wkday</x:ref> <x:ref>SP</x:ref> <x:ref>date3</x:ref> <x:ref>SP</x:ref> <x:ref>time</x:ref> <x:ref>SP</x:ref> 4<x:ref>DIGIT</x:ref>
1228  <x:ref>date1</x:ref>        = 2<x:ref>DIGIT</x:ref> <x:ref>SP</x:ref> <x:ref>month</x:ref> <x:ref>SP</x:ref> 4<x:ref>DIGIT</x:ref>
1229                 ; day month year (e.g., 02 Jun 1982)
1230  <x:ref>date2</x:ref>        = 2<x:ref>DIGIT</x:ref> "-" <x:ref>month</x:ref> "-" 2<x:ref>DIGIT</x:ref>
1231                 ; day-month-year (e.g., 02-Jun-82)
1232  <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> ))
1233                 ; month day (e.g., Jun  2)
1234  <x:ref>time</x:ref>         = 2<x:ref>DIGIT</x:ref> ":" 2<x:ref>DIGIT</x:ref> ":" 2<x:ref>DIGIT</x:ref>
1235                 ; 00:00:00 - 23:59:59
1236  <x:ref>wkday</x:ref>        = s-Mon | s-Tue | s-Wed
1237               | s-Thu | s-Fri | s-Sat | s-Sun
1238  <x:ref>weekday</x:ref>      = l-Mon | l-Tue | l-Wed
1239               | l-Thu | l-Fri | l-Sat | l-Sun
1240  <x:ref>month</x:ref>        = s-Jan | s-Feb | s-Mar | s-Apr
1241               | s-May | s-Jun | s-Jul | s-Aug
1242               | s-Sep | s-Oct | s-Nov | s-Dec
1243               
1244  GMT   = <x:abnf-char-sequence>"GMT"</x:abnf-char-sequence> ; "GMT", case-sensitive
1245
1246  s-Mon = <x:abnf-char-sequence>"Mon"</x:abnf-char-sequence> ; "Mon", case-sensitive
1247  s-Tue = <x:abnf-char-sequence>"Tue"</x:abnf-char-sequence> ; "Tue", case-sensitive
1248  s-Wed = <x:abnf-char-sequence>"Wed"</x:abnf-char-sequence> ; "Wed", case-sensitive
1249  s-Thu = <x:abnf-char-sequence>"Thu"</x:abnf-char-sequence> ; "Thu", case-sensitive
1250  s-Fri = <x:abnf-char-sequence>"Fri"</x:abnf-char-sequence> ; "Fri", case-sensitive
1251  s-Sat = <x:abnf-char-sequence>"Sat"</x:abnf-char-sequence> ; "Sat", case-sensitive
1252  s-Sun = <x:abnf-char-sequence>"Sun"</x:abnf-char-sequence> ; "Sun", case-sensitive
1253
1254  l-Mon = <x:abnf-char-sequence>"Monday"</x:abnf-char-sequence>          ; "Monday", case-sensitive
1255  l-Tue = <x:abnf-char-sequence>"Tuesday"</x:abnf-char-sequence>       ; "Tuesday", case-sensitive
1256  l-Wed = <x:abnf-char-sequence>"Wednesday"</x:abnf-char-sequence> ; "Wednesday", case-sensitive
1257  l-Thu = <x:abnf-char-sequence>"Thursday"</x:abnf-char-sequence>    ; "Thursday", case-sensitive
1258  l-Fri = <x:abnf-char-sequence>"Friday"</x:abnf-char-sequence>          ; "Friday", case-sensitive
1259  l-Sat = <x:abnf-char-sequence>"Saturday"</x:abnf-char-sequence>    ; "Saturday", case-sensitive
1260  l-Sun = <x:abnf-char-sequence>"Sunday"</x:abnf-char-sequence>          ; "Sunday", case-sensitive
1261
1262  s-Jan = <x:abnf-char-sequence>"Jan"</x:abnf-char-sequence> ; "Jan", case-sensitive
1263  s-Feb = <x:abnf-char-sequence>"Feb"</x:abnf-char-sequence> ; "Feb", case-sensitive
1264  s-Mar = <x:abnf-char-sequence>"Mar"</x:abnf-char-sequence> ; "Mar", case-sensitive
1265  s-Apr = <x:abnf-char-sequence>"Apr"</x:abnf-char-sequence> ; "Apr", case-sensitive
1266  s-May = <x:abnf-char-sequence>"May"</x:abnf-char-sequence> ; "May", case-sensitive
1267  s-Jun = <x:abnf-char-sequence>"Jun"</x:abnf-char-sequence> ; "Jun", case-sensitive
1268  s-Jul = <x:abnf-char-sequence>"Jul"</x:abnf-char-sequence> ; "Jul", case-sensitive
1269  s-Aug = <x:abnf-char-sequence>"Aug"</x:abnf-char-sequence> ; "Aug", case-sensitive
1270  s-Sep = <x:abnf-char-sequence>"Sep"</x:abnf-char-sequence> ; "Sep", case-sensitive
1271  s-Oct = <x:abnf-char-sequence>"Oct"</x:abnf-char-sequence> ; "Oct", case-sensitive
1272  s-Nov = <x:abnf-char-sequence>"Nov"</x:abnf-char-sequence> ; "Nov", case-sensitive
1273  s-Dec = <x:abnf-char-sequence>"Dec"</x:abnf-char-sequence> ; "Dec", case-sensitive
1274</artwork></figure>
1275<t>
1276      <x:h>Note:</x:h> HTTP requirements for the date/time stamp format apply only
1277      to their usage within the protocol stream. Clients and servers are
1278      not required to use these formats for user presentation, request
1279      logging, etc.
1280</t>
1281</section>
1282</section>
1283
1284<section title="Transfer Codings" anchor="transfer.codings">
1285  <x:anchor-alias value="parameter"/>
1286  <x:anchor-alias value="transfer-coding"/>
1287  <x:anchor-alias value="transfer-extension"/>
1288<t>
1289   Transfer-coding values are used to indicate an encoding
1290   transformation that has been, can be, or may need to be applied to an
1291   entity-body in order to ensure "safe transport" through the network.
1292   This differs from a content coding in that the transfer-coding is a
1293   property of the message, not of the original entity.
1294</t>
1295<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="transfer-coding"/><iref primary="true" item="Grammar" subitem="transfer-extension"/>
1296  <x:ref>transfer-coding</x:ref>         = "chunked" | <x:ref>transfer-extension</x:ref>
1297  <x:ref>transfer-extension</x:ref>      = <x:ref>token</x:ref> *( ";" <x:ref>parameter</x:ref> )
1298</artwork></figure>
1299<t anchor="rule.parameter">
1300  <x:anchor-alias value="attribute"/>
1301  <x:anchor-alias value="parameter"/>
1302  <x:anchor-alias value="value"/>
1303   Parameters are in  the form of attribute/value pairs.
1304</t>
1305<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="parameter"/><iref primary="true" item="Grammar" subitem="attribute"/><iref primary="true" item="Grammar" subitem="value"/>
1306  <x:ref>parameter</x:ref>               = <x:ref>attribute</x:ref> "=" <x:ref>value</x:ref>
1307  <x:ref>attribute</x:ref>               = <x:ref>token</x:ref>
1308  <x:ref>value</x:ref>                   = <x:ref>token</x:ref> | <x:ref>quoted-string</x:ref>
1309</artwork></figure>
1310<t>
1311   All transfer-coding values are case-insensitive. HTTP/1.1 uses
1312   transfer-coding values in the TE header field (<xref target="header.te"/>) and in
1313   the Transfer-Encoding header field (<xref target="header.transfer-encoding"/>).
1314</t>
1315<t>
1316   Whenever a transfer-coding is applied to a message-body, the set of
1317   transfer-codings &MUST; include "chunked", unless the message indicates it
1318   is terminated by closing the connection. When the "chunked" transfer-coding
1319   is used, it &MUST; be the last transfer-coding applied to the
1320   message-body. The "chunked" transfer-coding &MUST-NOT; be applied more
1321   than once to a message-body. These rules allow the recipient to
1322   determine the transfer-length of the message (<xref target="message.length"/>).
1323</t>
1324<t>
1325   Transfer-codings are analogous to the Content-Transfer-Encoding
1326   values of MIME <xref target="RFC2045"/>, which were designed to enable safe transport of
1327   binary data over a 7-bit transport service. However, safe transport
1328   has a different focus for an 8bit-clean transfer protocol. In HTTP,
1329   the only unsafe characteristic of message-bodies is the difficulty in
1330   determining the exact body length (<xref target="message.length"/>), or the desire to
1331   encrypt data over a shared transport.
1332</t>
1333<t>
1334   The Internet Assigned Numbers Authority (IANA) acts as a registry for
1335   transfer-coding value tokens. Initially, the registry contains the
1336   following tokens: "chunked" (<xref target="chunked.transfer.encoding"/>),
1337   "gzip", "compress", and "deflate" (&content-codings;).
1338</t>
1339<t>
1340   New transfer-coding value tokens &SHOULD; be registered in the same way
1341   as new content-coding value tokens (&content-codings;).
1342</t>
1343<t>
1344   A server which receives an entity-body with a transfer-coding it does
1345   not understand &SHOULD; return 501 (Not Implemented), and close the
1346   connection. A server &MUST-NOT; send transfer-codings to an HTTP/1.0
1347   client.
1348</t>
1349
1350<section title="Chunked Transfer Coding" anchor="chunked.transfer.encoding">
1351  <x:anchor-alias value="chunk"/>
1352  <x:anchor-alias value="Chunked-Body"/>
1353  <x:anchor-alias value="chunk-data"/>
1354  <x:anchor-alias value="chunk-extension"/>
1355  <x:anchor-alias value="chunk-ext-name"/>
1356  <x:anchor-alias value="chunk-ext-val"/>
1357  <x:anchor-alias value="chunk-size"/>
1358  <x:anchor-alias value="last-chunk"/>
1359  <x:anchor-alias value="trailer-part"/>
1360<t>
1361   The chunked encoding modifies the body of a message in order to
1362   transfer it as a series of chunks, each with its own size indicator,
1363   followed by an &OPTIONAL; trailer containing entity-header fields. This
1364   allows dynamically produced content to be transferred along with the
1365   information necessary for the recipient to verify that it has
1366   received the full message.
1367</t>
1368<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-extension"/><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"/>
1369  <x:ref>Chunked-Body</x:ref>   = *<x:ref>chunk</x:ref>
1370                   <x:ref>last-chunk</x:ref>
1371                   <x:ref>trailer-part</x:ref>
1372                   <x:ref>CRLF</x:ref>
1373 
1374  <x:ref>chunk</x:ref>          = <x:ref>chunk-size</x:ref> [ <x:ref>chunk-extension</x:ref> ] <x:ref>CRLF</x:ref>
1375                   <x:ref>chunk-data</x:ref> <x:ref>CRLF</x:ref>
1376  <x:ref>chunk-size</x:ref>     = 1*<x:ref>HEXDIG</x:ref>
1377  <x:ref>last-chunk</x:ref>     = 1*("0") [ <x:ref>chunk-extension</x:ref> ] <x:ref>CRLF</x:ref>
1378 
1379  <x:ref>chunk-extension</x:ref>= *( ";" <x:ref>chunk-ext-name</x:ref> [ "=" <x:ref>chunk-ext-val</x:ref> ] )
1380  <x:ref>chunk-ext-name</x:ref> = <x:ref>token</x:ref>
1381  <x:ref>chunk-ext-val</x:ref>  = <x:ref>token</x:ref> | <x:ref>quoted-string</x:ref>
1382  <x:ref>chunk-data</x:ref>     = 1*<x:ref>OCTET</x:ref> ; a sequence of chunk-size octets
1383  <x:ref>trailer-part</x:ref>   = *(<x:ref>entity-header</x:ref> <x:ref>CRLF</x:ref>)
1384</artwork></figure>
1385<t>
1386   The chunk-size field is a string of hex digits indicating the size of
1387   the chunk-data in octets. The chunked encoding is ended by any chunk whose size is
1388   zero, followed by the trailer, which is terminated by an empty line.
1389</t>
1390<t>
1391   The trailer allows the sender to include additional HTTP header
1392   fields at the end of the message. The Trailer header field can be
1393   used to indicate which header fields are included in a trailer (see
1394   <xref target="header.trailer"/>).
1395</t>
1396<t>
1397   A server using chunked transfer-coding in a response &MUST-NOT; use the
1398   trailer for any header fields unless at least one of the following is
1399   true:
1400  <list style="numbers">
1401    <t>the request included a TE header field that indicates "trailers" is
1402     acceptable in the transfer-coding of the  response, as described in
1403     <xref target="header.te"/>; or,</t>
1404
1405    <t>the server is the origin server for the response, the trailer
1406     fields consist entirely of optional metadata, and the recipient
1407     could use the message (in a manner acceptable to the origin server)
1408     without receiving this metadata.  In other words, the origin server
1409     is willing to accept the possibility that the trailer fields might
1410     be silently discarded along the path to the client.</t>
1411  </list>
1412</t>
1413<t>
1414   This requirement prevents an interoperability failure when the
1415   message is being received by an HTTP/1.1 (or later) proxy and
1416   forwarded to an HTTP/1.0 recipient. It avoids a situation where
1417   compliance with the protocol would have necessitated a possibly
1418   infinite buffer on the proxy.
1419</t>
1420<t>
1421   A process for decoding the "chunked" transfer-coding
1422   can be represented in pseudo-code as:
1423</t>
1424<figure><artwork type="code">
1425    length := 0
1426    read chunk-size, chunk-extension (if any) and CRLF
1427    while (chunk-size &gt; 0) {
1428       read chunk-data and CRLF
1429       append chunk-data to entity-body
1430       length := length + chunk-size
1431       read chunk-size and CRLF
1432    }
1433    read entity-header
1434    while (entity-header not empty) {
1435       append entity-header to existing header fields
1436       read entity-header
1437    }
1438    Content-Length := length
1439    Remove "chunked" from Transfer-Encoding
1440</artwork></figure>
1441<t>
1442   All HTTP/1.1 applications &MUST; be able to receive and decode the
1443   "chunked" transfer-coding, and &MUST; ignore chunk-extension extensions
1444   they do not understand.
1445</t>
1446</section>
1447</section>
1448
1449<section title="Product Tokens" anchor="product.tokens">
1450  <x:anchor-alias value="product"/>
1451  <x:anchor-alias value="product-version"/>
1452<t>
1453   Product tokens are used to allow communicating applications to
1454   identify themselves by software name and version. Most fields using
1455   product tokens also allow sub-products which form a significant part
1456   of the application to be listed, separated by white space. By
1457   convention, the products are listed in order of their significance
1458   for identifying the application.
1459</t>
1460<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="product"/><iref primary="true" item="Grammar" subitem="product-version"/>
1461  <x:ref>product</x:ref>         = <x:ref>token</x:ref> ["/" <x:ref>product-version</x:ref>]
1462  <x:ref>product-version</x:ref> = <x:ref>token</x:ref>
1463</artwork></figure>
1464<t>
1465   Examples:
1466</t>
1467<figure><artwork type="example">
1468    User-Agent: CERN-LineMode/2.15 libwww/2.17b3
1469    Server: Apache/0.8.4
1470</artwork></figure>
1471<t>
1472   Product tokens &SHOULD; be short and to the point. They &MUST-NOT; be
1473   used for advertising or other non-essential information. Although any
1474   token character &MAY; appear in a product-version, this token &SHOULD;
1475   only be used for a version identifier (i.e., successive versions of
1476   the same product &SHOULD; only differ in the product-version portion of
1477   the product value).
1478</t>
1479</section>
1480
1481</section>
1482
1483<section title="HTTP Message" anchor="http.message">
1484
1485<section title="Message Types" anchor="message.types">
1486  <x:anchor-alias value="generic-message"/>
1487  <x:anchor-alias value="HTTP-message"/>
1488  <x:anchor-alias value="start-line"/>
1489<t>
1490   HTTP messages consist of requests from client to server and responses
1491   from server to client.
1492</t>
1493<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="HTTP-message"/>
1494  <x:ref>HTTP-message</x:ref>   = <x:ref>Request</x:ref> | <x:ref>Response</x:ref>     ; HTTP/1.1 messages
1495</artwork></figure>
1496<t>
1497   Request (<xref target="request"/>) and Response (<xref target="response"/>) messages use the generic
1498   message format of <xref target="RFC2822"/> for transferring entities (the payload
1499   of the message). Both types of message consist of a start-line, zero
1500   or more header fields (also known as "headers"), an empty line (i.e.,
1501   a line with nothing preceding the CRLF) indicating the end of the
1502   header fields, and possibly a message-body.
1503</t>
1504<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="generic-message"/><iref primary="true" item="Grammar" subitem="start-line"/>
1505  <x:ref>generic-message</x:ref> = <x:ref>start-line</x:ref>
1506                    *(<x:ref>message-header</x:ref> <x:ref>CRLF</x:ref>)
1507                    <x:ref>CRLF</x:ref>
1508                    [ <x:ref>message-body</x:ref> ]
1509  <x:ref>start-line</x:ref>      = <x:ref>Request-Line</x:ref> | <x:ref>Status-Line</x:ref>
1510</artwork></figure>
1511<t>
1512   In the interest of robustness, servers &SHOULD; ignore any empty
1513   line(s) received where a Request-Line is expected. In other words, if
1514   the server is reading the protocol stream at the beginning of a
1515   message and receives a CRLF first, it should ignore the CRLF.
1516</t>
1517<t>
1518   Certain buggy HTTP/1.0 client implementations generate extra CRLF's
1519   after a POST request. To restate what is explicitly forbidden by the
1520   BNF, an HTTP/1.1 client &MUST-NOT; preface or follow a request with an
1521   extra CRLF.
1522</t>
1523</section>
1524
1525<section title="Message Headers" anchor="message.headers">
1526  <x:anchor-alias value="field-content"/>
1527  <x:anchor-alias value="field-name"/>
1528  <x:anchor-alias value="field-value"/>
1529  <x:anchor-alias value="message-header"/>
1530<t>
1531   HTTP header fields, which include general-header (<xref target="general.header.fields"/>),
1532   request-header (&request-header-fields;), response-header (&response-header-fields;), and
1533   entity-header (&entity-header-fields;) fields, follow the same generic format as
1534   that given in <xref target="RFC2822" x:fmt="of" x:sec="2.1"/>. Each header field consists
1535   of a name followed by a colon (":") and the field value. Field names
1536   are case-insensitive. The field value &MAY; be preceded by any amount
1537   of LWS, though a single SP is preferred. Header fields can be
1538   extended over multiple lines by preceding each extra line with at
1539   least one SP or HTAB. Applications ought to follow "common form", where
1540   one is known or indicated, when generating HTTP constructs, since
1541   there might exist some implementations that fail to accept anything
1542   beyond the common forms.
1543</t>
1544<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="message-header"/><iref primary="true" item="Grammar" subitem="field-name"/><iref primary="true" item="Grammar" subitem="field-value"/><iref primary="true" item="Grammar" subitem="field-content"/>
1545  <x:ref>message-header</x:ref> = <x:ref>field-name</x:ref> ":" [ <x:ref>field-value</x:ref> ]
1546  <x:ref>field-name</x:ref>     = <x:ref>token</x:ref>
1547  <x:ref>field-value</x:ref>    = *( <x:ref>field-content</x:ref> | <x:ref>LWS</x:ref> )
1548  <x:ref>field-content</x:ref>  = &lt;field content&gt;
1549                   ; the <x:ref>OCTET</x:ref>s making up the field-value
1550                   ; and consisting of either *<x:ref>TEXT</x:ref> or combinations
1551                   ; of <x:ref>token</x:ref>, <x:ref>separators</x:ref>, and <x:ref>quoted-string</x:ref>
1552</artwork></figure>
1553<t>
1554   The field-content does not include any leading or trailing LWS:
1555   linear white space occurring before the first non-whitespace
1556   character of the field-value or after the last non-whitespace
1557   character of the field-value. Such leading or trailing LWS &MAY; be
1558   removed without changing the semantics of the field value. Any LWS
1559   that occurs between field-content &MAY; be replaced with a single SP
1560   before interpreting the field value or forwarding the message
1561   downstream.
1562</t>
1563<t>
1564   The order in which header fields with differing field names are
1565   received is not significant. However, it is "good practice" to send
1566   general-header fields first, followed by request-header or response-header
1567   fields, and ending with the entity-header fields.
1568</t>
1569<t>
1570   Multiple message-header fields with the same field-name &MAY; be
1571   present in a message if and only if the entire field-value for that
1572   header field is defined as a comma-separated list [i.e., #(values)].
1573   It &MUST; be possible to combine the multiple header fields into one
1574   "field-name: field-value" pair, without changing the semantics of the
1575   message, by appending each subsequent field-value to the first, each
1576   separated by a comma. The order in which header fields with the same
1577   field-name are received is therefore significant to the
1578   interpretation of the combined field value, and thus a proxy &MUST-NOT;
1579   change the order of these field values when a message is forwarded.
1580</t>
1581</section>
1582
1583<section title="Message Body" anchor="message.body">
1584  <x:anchor-alias value="message-body"/>
1585<t>
1586   The message-body (if any) of an HTTP message is used to carry the
1587   entity-body associated with the request or response. The message-body
1588   differs from the entity-body only when a transfer-coding has been
1589   applied, as indicated by the Transfer-Encoding header field (<xref target="header.transfer-encoding"/>).
1590</t>
1591<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="message-body"/>
1592  <x:ref>message-body</x:ref> = <x:ref>entity-body</x:ref>
1593               | &lt;entity-body encoded as per <x:ref>Transfer-Encoding</x:ref>&gt;
1594</artwork></figure>
1595<t>
1596   Transfer-Encoding &MUST; be used to indicate any transfer-codings
1597   applied by an application to ensure safe and proper transfer of the
1598   message. Transfer-Encoding is a property of the message, not of the
1599   entity, and thus &MAY; be added or removed by any application along the
1600   request/response chain. (However, <xref target="transfer.codings"/> places restrictions on
1601   when certain transfer-codings may be used.)
1602</t>
1603<t>
1604   The rules for when a message-body is allowed in a message differ for
1605   requests and responses.
1606</t>
1607<t>
1608   The presence of a message-body in a request is signaled by the
1609   inclusion of a Content-Length or Transfer-Encoding header field in
1610   the request's message-headers. A message-body &MUST-NOT; be included in
1611   a request if the specification of the request method (&method;)
1612   explicitly disallows an entity-body in requests.
1613   When a request message contains both a message-body of non-zero
1614   length and a method that does not define any semantics for that
1615   request message-body, then an origin server &SHOULD; either ignore
1616   the message-body or respond with an appropriate error message
1617   (e.g., 413).  A proxy or gateway, when presented the same request,
1618   &SHOULD; either forward the request inbound with the message-body or
1619   ignore the message-body when determining a response.
1620</t>
1621<t>
1622   For response messages, whether or not a message-body is included with
1623   a message is dependent on both the request method and the response
1624   status code (<xref target="status.code.and.reason.phrase"/>). All responses to the HEAD request method
1625   &MUST-NOT; include a message-body, even though the presence of entity-header
1626   fields might lead one to believe they do. All 1xx
1627   (informational), 204 (No Content), and 304 (Not Modified) responses
1628   &MUST-NOT; include a message-body. All other responses do include a
1629   message-body, although it &MAY; be of zero length.
1630</t>
1631</section>
1632
1633<section title="Message Length" anchor="message.length">
1634<t>
1635   The transfer-length of a message is the length of the message-body as
1636   it appears in the message; that is, after any transfer-codings have
1637   been applied. When a message-body is included with a message, the
1638   transfer-length of that body is determined by one of the following
1639   (in order of precedence):
1640</t>
1641<t>
1642  <list style="numbers">
1643    <x:lt><t>
1644     Any response message which "&MUST-NOT;" include a message-body (such
1645     as the 1xx, 204, and 304 responses and any response to a HEAD
1646     request) is always terminated by the first empty line after the
1647     header fields, regardless of the entity-header fields present in
1648     the message.
1649    </t></x:lt>
1650    <x:lt><t>
1651     If a Transfer-Encoding header field (<xref target="header.transfer-encoding"/>)
1652     is present and the "chunked" transfer-coding (<xref target="transfer.codings"/>)
1653     is used, the transfer-length is defined by the use of this transfer-coding.
1654     If a Transfer-Encoding header field is present and the "chunked" transfer-coding
1655     is not present, the transfer-length is defined by the sender closing the connection.
1656    </t></x:lt>
1657    <x:lt><t>
1658     If a Content-Length header field (<xref target="header.content-length"/>) is present, its
1659     decimal value in OCTETs represents both the entity-length and the
1660     transfer-length. The Content-Length header field &MUST-NOT; be sent
1661     if these two lengths are different (i.e., if a Transfer-Encoding
1662     header field is present). If a message is received with both a
1663     Transfer-Encoding header field and a Content-Length header field,
1664     the latter &MUST; be ignored.
1665    </t></x:lt>
1666    <x:lt><t>
1667     If the message uses the media type "multipart/byteranges", and the
1668     transfer-length is not otherwise specified, then this self-delimiting
1669     media type defines the transfer-length. This media type
1670     &MUST-NOT; be used unless the sender knows that the recipient can parse
1671     it; the presence in a request of a Range header with multiple byte-range
1672     specifiers from a 1.1 client implies that the client can parse
1673     multipart/byteranges responses.
1674    <list style="empty"><t>
1675       A range header might be forwarded by a 1.0 proxy that does not
1676       understand multipart/byteranges; in this case the server &MUST;
1677       delimit the message using methods defined in items 1, 3 or 5 of
1678       this section.
1679    </t></list>
1680    </t></x:lt>
1681    <x:lt><t>
1682     By the server closing the connection. (Closing the connection
1683     cannot be used to indicate the end of a request body, since that
1684     would leave no possibility for the server to send back a response.)
1685    </t></x:lt>
1686  </list>
1687</t>
1688<t>
1689   For compatibility with HTTP/1.0 applications, HTTP/1.1 requests
1690   containing a message-body &MUST; include a valid Content-Length header
1691   field unless the server is known to be HTTP/1.1 compliant. If a
1692   request contains a message-body and a Content-Length is not given,
1693   the server &SHOULD; respond with 400 (Bad Request) if it cannot
1694   determine the length of the message, or with 411 (Length Required) if
1695   it wishes to insist on receiving a valid Content-Length.
1696</t>
1697<t>
1698   All HTTP/1.1 applications that receive entities &MUST; accept the
1699   "chunked" transfer-coding (<xref target="transfer.codings"/>), thus allowing this mechanism
1700   to be used for messages when the message length cannot be determined
1701   in advance.
1702</t>
1703<t>
1704   Messages &MUST-NOT; include both a Content-Length header field and a
1705   transfer-coding. If the message does include a
1706   transfer-coding, the Content-Length &MUST; be ignored.
1707</t>
1708<t>
1709   When a Content-Length is given in a message where a message-body is
1710   allowed, its field value &MUST; exactly match the number of OCTETs in
1711   the message-body. HTTP/1.1 user agents &MUST; notify the user when an
1712   invalid length is received and detected.
1713</t>
1714</section>
1715
1716<section title="General Header Fields" anchor="general.header.fields">
1717  <x:anchor-alias value="general-header"/>
1718<t>
1719   There are a few header fields which have general applicability for
1720   both request and response messages, but which do not apply to the
1721   entity being transferred. These header fields apply only to the
1722   message being transmitted.
1723</t>
1724<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="general-header"/>
1725  <x:ref>general-header</x:ref> = <x:ref>Cache-Control</x:ref>            ; &header-cache-control;
1726                 | <x:ref>Connection</x:ref>               ; <xref target="header.connection"/>
1727                 | <x:ref>Date</x:ref>                     ; <xref target="header.date"/>
1728                 | <x:ref>Pragma</x:ref>                   ; &header-pragma;
1729                 | <x:ref>Trailer</x:ref>                  ; <xref target="header.trailer"/>
1730                 | <x:ref>Transfer-Encoding</x:ref>        ; <xref target="header.transfer-encoding"/>
1731                 | <x:ref>Upgrade</x:ref>                  ; <xref target="header.upgrade"/>
1732                 | <x:ref>Via</x:ref>                      ; <xref target="header.via"/>
1733                 | <x:ref>Warning</x:ref>                  ; &header-warning;
1734</artwork></figure>
1735<t>
1736   General-header field names can be extended reliably only in
1737   combination with a change in the protocol version. However, new or
1738   experimental header fields may be given the semantics of general
1739   header fields if all parties in the communication recognize them to
1740   be general-header fields. Unrecognized header fields are treated as
1741   entity-header fields.
1742</t>
1743</section>
1744</section>
1745
1746<section title="Request" anchor="request">
1747  <x:anchor-alias value="Request"/>
1748<t>
1749   A request message from a client to a server includes, within the
1750   first line of that message, the method to be applied to the resource,
1751   the identifier of the resource, and the protocol version in use.
1752</t>
1753<!--                 Host                      ; should be moved here eventually -->
1754<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Request"/>
1755  <x:ref>Request</x:ref>       = <x:ref>Request-Line</x:ref>              ; <xref target="request-line"/>
1756                  *(( <x:ref>general-header</x:ref>        ; <xref target="general.header.fields"/>
1757                   | <x:ref>request-header</x:ref>         ; &request-header-fields;
1758                   | <x:ref>entity-header</x:ref> ) <x:ref>CRLF</x:ref>)  ; &entity-header-fields;
1759                  <x:ref>CRLF</x:ref>
1760                  [ <x:ref>message-body</x:ref> ]          ; <xref target="message.body"/>
1761</artwork></figure>
1762
1763<section title="Request-Line" anchor="request-line">
1764  <x:anchor-alias value="Request-Line"/>
1765<t>
1766   The Request-Line begins with a method token, followed by the
1767   Request-URI and the protocol version, and ending with CRLF. The
1768   elements are separated by SP characters. No CR or LF is allowed
1769   except in the final CRLF sequence.
1770</t>
1771<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Request-Line"/>
1772  <x:ref>Request-Line</x:ref>   = <x:ref>Method</x:ref> <x:ref>SP</x:ref> <x:ref>Request-URI</x:ref> <x:ref>SP</x:ref> <x:ref>HTTP-Version</x:ref> <x:ref>CRLF</x:ref>
1773</artwork></figure>
1774
1775<section title="Method" anchor="method">
1776  <x:anchor-alias value="Method"/>
1777<t>
1778   The Method  token indicates the method to be performed on the
1779   resource identified by the Request-URI. The method is case-sensitive.
1780</t>
1781<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Method"/><iref primary="true" item="Grammar" subitem="extension-method"/>
1782  <x:ref>Method</x:ref>         = <x:ref>token</x:ref>
1783</artwork></figure>
1784</section>
1785
1786<section title="Request-URI" anchor="request-uri">
1787  <x:anchor-alias value="Request-URI"/>
1788<t>
1789   The Request-URI is a Uniform Resource Identifier (<xref target="uri"/>) and
1790   identifies the resource upon which to apply the request.
1791</t>
1792<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Request-URI"/>
1793  <x:ref>Request-URI</x:ref>    = "*"
1794                 | <x:ref>absoluteURI</x:ref>
1795                 | ( <x:ref>path-absolute</x:ref> [ "?" <x:ref>query</x:ref> ] )
1796                 | <x:ref>authority</x:ref>
1797</artwork></figure>
1798<t>
1799   The four options for Request-URI are dependent on the nature of the
1800   request. The asterisk "*" means that the request does not apply to a
1801   particular resource, but to the server itself, and is only allowed
1802   when the method used does not necessarily apply to a resource. One
1803   example would be
1804</t>
1805<figure><artwork type="example">
1806    OPTIONS * HTTP/1.1
1807</artwork></figure>
1808<t>
1809   The absoluteURI form is &REQUIRED; when the request is being made to a
1810   proxy. The proxy is requested to forward the request or service it
1811   from a valid cache, and return the response. Note that the proxy &MAY;
1812   forward the request on to another proxy or directly to the server
1813   specified by the absoluteURI. In order to avoid request loops, a
1814   proxy &MUST; be able to recognize all of its server names, including
1815   any aliases, local variations, and the numeric IP address. An example
1816   Request-Line would be:
1817</t>
1818<figure><artwork type="example">
1819    GET http://www.example.org/pub/WWW/TheProject.html HTTP/1.1
1820</artwork></figure>
1821<t>
1822   To allow for transition to absoluteURIs in all requests in future
1823   versions of HTTP, all HTTP/1.1 servers &MUST; accept the absoluteURI
1824   form in requests, even though HTTP/1.1 clients will only generate
1825   them in requests to proxies.
1826</t>
1827<t>
1828   The authority form is only used by the CONNECT method (&CONNECT;).
1829</t>
1830<t>
1831   The most common form of Request-URI is that used to identify a
1832   resource on an origin server or gateway. In this case the absolute
1833   path of the URI &MUST; be transmitted (see <xref target="general.syntax"/>, path-absolute) as
1834   the Request-URI, and the network location of the URI (authority) &MUST;
1835   be transmitted in a Host header field. For example, a client wishing
1836   to retrieve the resource above directly from the origin server would
1837   create a TCP connection to port 80 of the host "www.example.org" and send
1838   the lines:
1839</t>
1840<figure><artwork type="example">
1841    GET /pub/WWW/TheProject.html HTTP/1.1
1842    Host: www.example.org
1843</artwork></figure>
1844<t>
1845   followed by the remainder of the Request. Note that the absolute path
1846   cannot be empty; if none is present in the original URI, it &MUST; be
1847   given as "/" (the server root).
1848</t>
1849<t>
1850   The Request-URI is transmitted in the format specified in
1851   <xref target="general.syntax"/>. If the Request-URI is encoded using the
1852   "% <x:ref>HEXDIG</x:ref> <x:ref>HEXDIG</x:ref>" encoding
1853   (<xref target="RFC2396" x:fmt="," x:sec="2.4.1"/>), the origin server
1854   &MUST; decode the Request-URI in order to
1855   properly interpret the request. Servers &SHOULD; respond to invalid
1856   Request-URIs with an appropriate status code.
1857</t>
1858<t>
1859   A transparent proxy &MUST-NOT; rewrite the "path-absolute" part of the
1860   received Request-URI when forwarding it to the next inbound server,
1861   except as noted above to replace a null path-absolute with "/".
1862</t>
1863<t>
1864  <list><t>
1865      <x:h>Note:</x:h> The "no rewrite" rule prevents the proxy from changing the
1866      meaning of the request when the origin server is improperly using
1867      a non-reserved URI character for a reserved purpose.  Implementors
1868      should be aware that some pre-HTTP/1.1 proxies have been known to
1869      rewrite the Request-URI.
1870  </t></list>
1871</t>
1872</section>
1873</section>
1874
1875<section title="The Resource Identified by a Request" anchor="the.resource.identified.by.a.request">
1876<t>
1877   The exact resource identified by an Internet request is determined by
1878   examining both the Request-URI and the Host header field.
1879</t>
1880<t>
1881   An origin server that does not allow resources to differ by the
1882   requested host &MAY; ignore the Host header field value when
1883   determining the resource identified by an HTTP/1.1 request. (But see
1884   <xref target="changes.to.simplify.multi-homed.web.servers.and.conserve.ip.addresses"/>
1885   for other requirements on Host support in HTTP/1.1.)
1886</t>
1887<t>
1888   An origin server that does differentiate resources based on the host
1889   requested (sometimes referred to as virtual hosts or vanity host
1890   names) &MUST; use the following rules for determining the requested
1891   resource on an HTTP/1.1 request:
1892  <list style="numbers">
1893    <t>If Request-URI is an absoluteURI, the host is part of the
1894     Request-URI. Any Host header field value in the request &MUST; be
1895     ignored.</t>
1896    <t>If the Request-URI is not an absoluteURI, and the request includes
1897     a Host header field, the host is determined by the Host header
1898     field value.</t>
1899    <t>If the host as determined by rule 1 or 2 is not a valid host on
1900     the server, the response &MUST; be a 400 (Bad Request) error message.</t>
1901  </list>
1902</t>
1903<t>
1904   Recipients of an HTTP/1.0 request that lacks a Host header field &MAY;
1905   attempt to use heuristics (e.g., examination of the URI path for
1906   something unique to a particular host) in order to determine what
1907   exact resource is being requested.
1908</t>
1909</section>
1910
1911</section>
1912
1913
1914<section title="Response" anchor="response">
1915  <x:anchor-alias value="Response"/>
1916<t>
1917   After receiving and interpreting a request message, a server responds
1918   with an HTTP response message.
1919</t>
1920<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Response"/>
1921  <x:ref>Response</x:ref>      = <x:ref>Status-Line</x:ref>               ; <xref target="status-line"/>
1922                  *(( <x:ref>general-header</x:ref>        ; <xref target="general.header.fields"/>
1923                   | <x:ref>response-header</x:ref>        ; &response-header-fields;
1924                   | <x:ref>entity-header</x:ref> ) <x:ref>CRLF</x:ref>)  ; &entity-header-fields;
1925                  <x:ref>CRLF</x:ref>
1926                  [ <x:ref>message-body</x:ref> ]          ; <xref target="message.body"/>
1927</artwork></figure>
1928
1929<section title="Status-Line" anchor="status-line">
1930  <x:anchor-alias value="Status-Line"/>
1931<t>
1932   The first line of a Response message is the Status-Line, consisting
1933   of the protocol version followed by a numeric status code and its
1934   associated textual phrase, with each element separated by SP
1935   characters. No CR or LF is allowed except in the final CRLF sequence.
1936</t>
1937<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Status-Line"/>
1938  <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>
1939</artwork></figure>
1940
1941<section title="Status Code and Reason Phrase" anchor="status.code.and.reason.phrase">
1942  <x:anchor-alias value="Reason-Phrase"/>
1943  <x:anchor-alias value="Status-Code"/>
1944<t>
1945   The Status-Code element is a 3-digit integer result code of the
1946   attempt to understand and satisfy the request. These codes are fully
1947   defined in &status-codes;.  The Reason Phrase exists for the sole
1948   purpose of providing a textual description associated with the numeric
1949   status code, out of deference to earlier Internet application protocols
1950   that were more frequently used with interactive text clients.
1951   A client &SHOULD; ignore the content of the Reason Phrase.
1952</t>
1953<t>
1954   The first digit of the Status-Code defines the class of response. The
1955   last two digits do not have any categorization role. There are 5
1956   values for the first digit:
1957  <list style="symbols">
1958    <t>
1959      1xx: Informational - Request received, continuing process
1960    </t>
1961    <t>
1962      2xx: Success - The action was successfully received,
1963        understood, and accepted
1964    </t>
1965    <t>
1966      3xx: Redirection - Further action must be taken in order to
1967        complete the request
1968    </t>
1969    <t>
1970      4xx: Client Error - The request contains bad syntax or cannot
1971        be fulfilled
1972    </t>
1973    <t>
1974      5xx: Server Error - The server failed to fulfill an apparently
1975        valid request
1976    </t>
1977  </list>
1978</t>
1979<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Status-Code"/><iref primary="true" item="Grammar" subitem="extension-code"/><iref primary="true" item="Grammar" subitem="Reason-Phrase"/>
1980  <x:ref>Status-Code</x:ref>    = 3<x:ref>DIGIT</x:ref>
1981  <x:ref>Reason-Phrase</x:ref>  = *&lt;<x:ref>TEXT</x:ref>, excluding <x:ref>CR</x:ref>, <x:ref>LF</x:ref>&gt;
1982</artwork></figure>
1983</section>
1984</section>
1985
1986</section>
1987
1988
1989<section title="Connections" anchor="connections">
1990
1991<section title="Persistent Connections" anchor="persistent.connections">
1992
1993<section title="Purpose" anchor="persistent.purpose">
1994<t>
1995   Prior to persistent connections, a separate TCP connection was
1996   established to fetch each URL, increasing the load on HTTP servers
1997   and causing congestion on the Internet. The use of inline images and
1998   other associated data often require a client to make multiple
1999   requests of the same server in a short amount of time. Analysis of
2000   these performance problems and results from a prototype
2001   implementation are available <xref target="Pad1995"/> <xref target="Spe"/>. Implementation experience and
2002   measurements of actual HTTP/1.1 (<xref target="RFC2068" x:fmt="none">RFC 2068</xref>) implementations show good
2003   results <xref target="Nie1997"/>. Alternatives have also been explored, for example,
2004   T/TCP <xref target="Tou1998"/>.
2005</t>
2006<t>
2007   Persistent HTTP connections have a number of advantages:
2008  <list style="symbols">
2009      <t>
2010        By opening and closing fewer TCP connections, CPU time is saved
2011        in routers and hosts (clients, servers, proxies, gateways,
2012        tunnels, or caches), and memory used for TCP protocol control
2013        blocks can be saved in hosts.
2014      </t>
2015      <t>
2016        HTTP requests and responses can be pipelined on a connection.
2017        Pipelining allows a client to make multiple requests without
2018        waiting for each response, allowing a single TCP connection to
2019        be used much more efficiently, with much lower elapsed time.
2020      </t>
2021      <t>
2022        Network congestion is reduced by reducing the number of packets
2023        caused by TCP opens, and by allowing TCP sufficient time to
2024        determine the congestion state of the network.
2025      </t>
2026      <t>
2027        Latency on subsequent requests is reduced since there is no time
2028        spent in TCP's connection opening handshake.
2029      </t>
2030      <t>
2031        HTTP can evolve more gracefully, since errors can be reported
2032        without the penalty of closing the TCP connection. Clients using
2033        future versions of HTTP might optimistically try a new feature,
2034        but if communicating with an older server, retry with old
2035        semantics after an error is reported.
2036      </t>
2037    </list>
2038</t>
2039<t>
2040   HTTP implementations &SHOULD; implement persistent connections.
2041</t>
2042</section>
2043
2044<section title="Overall Operation" anchor="persistent.overall">
2045<t>
2046   A significant difference between HTTP/1.1 and earlier versions of
2047   HTTP is that persistent connections are the default behavior of any
2048   HTTP connection. That is, unless otherwise indicated, the client
2049   &SHOULD; assume that the server will maintain a persistent connection,
2050   even after error responses from the server.
2051</t>
2052<t>
2053   Persistent connections provide a mechanism by which a client and a
2054   server can signal the close of a TCP connection. This signaling takes
2055   place using the Connection header field (<xref target="header.connection"/>). Once a close
2056   has been signaled, the client &MUST-NOT; send any more requests on that
2057   connection.
2058</t>
2059
2060<section title="Negotiation" anchor="persistent.negotiation">
2061<t>
2062   An HTTP/1.1 server &MAY; assume that a HTTP/1.1 client intends to
2063   maintain a persistent connection unless a Connection header including
2064   the connection-token "close" was sent in the request. If the server
2065   chooses to close the connection immediately after sending the
2066   response, it &SHOULD; send a Connection header including the
2067   connection-token close.
2068</t>
2069<t>
2070   An HTTP/1.1 client &MAY; expect a connection to remain open, but would
2071   decide to keep it open based on whether the response from a server
2072   contains a Connection header with the connection-token close. In case
2073   the client does not want to maintain a connection for more than that
2074   request, it &SHOULD; send a Connection header including the
2075   connection-token close.
2076</t>
2077<t>
2078   If either the client or the server sends the close token in the
2079   Connection header, that request becomes the last one for the
2080   connection.
2081</t>
2082<t>
2083   Clients and servers &SHOULD-NOT;  assume that a persistent connection is
2084   maintained for HTTP versions less than 1.1 unless it is explicitly
2085   signaled. See <xref target="compatibility.with.http.1.0.persistent.connections"/> for more information on backward
2086   compatibility with HTTP/1.0 clients.
2087</t>
2088<t>
2089   In order to remain persistent, all messages on the connection &MUST;
2090   have a self-defined message length (i.e., one not defined by closure
2091   of the connection), as described in <xref target="message.length"/>.
2092</t>
2093</section>
2094
2095<section title="Pipelining" anchor="pipelining">
2096<t>
2097   A client that supports persistent connections &MAY; "pipeline" its
2098   requests (i.e., send multiple requests without waiting for each
2099   response). A server &MUST; send its responses to those requests in the
2100   same order that the requests were received.
2101</t>
2102<t>
2103   Clients which assume persistent connections and pipeline immediately
2104   after connection establishment &SHOULD; be prepared to retry their
2105   connection if the first pipelined attempt fails. If a client does
2106   such a retry, it &MUST-NOT; pipeline before it knows the connection is
2107   persistent. Clients &MUST; also be prepared to resend their requests if
2108   the server closes the connection before sending all of the
2109   corresponding responses.
2110</t>
2111<t>
2112   Clients &SHOULD-NOT;  pipeline requests using non-idempotent methods or
2113   non-idempotent sequences of methods (see &idempotent-methods;). Otherwise, a
2114   premature termination of the transport connection could lead to
2115   indeterminate results. A client wishing to send a non-idempotent
2116   request &SHOULD; wait to send that request until it has received the
2117   response status for the previous request.
2118</t>
2119</section>
2120</section>
2121
2122<section title="Proxy Servers" anchor="persistent.proxy">
2123<t>
2124   It is especially important that proxies correctly implement the
2125   properties of the Connection header field as specified in <xref target="header.connection"/>.
2126</t>
2127<t>
2128   The proxy server &MUST; signal persistent connections separately with
2129   its clients and the origin servers (or other proxy servers) that it
2130   connects to. Each persistent connection applies to only one transport
2131   link.
2132</t>
2133<t>
2134   A proxy server &MUST-NOT; establish a HTTP/1.1 persistent connection
2135   with an HTTP/1.0 client (but see <xref target="RFC2068"/> for information and
2136   discussion of the problems with the Keep-Alive header implemented by
2137   many HTTP/1.0 clients).
2138</t>
2139</section>
2140
2141<section title="Practical Considerations" anchor="persistent.practical">
2142<t>
2143   Servers will usually have some time-out value beyond which they will
2144   no longer maintain an inactive connection. Proxy servers might make
2145   this a higher value since it is likely that the client will be making
2146   more connections through the same server. The use of persistent
2147   connections places no requirements on the length (or existence) of
2148   this time-out for either the client or the server.
2149</t>
2150<t>
2151   When a client or server wishes to time-out it &SHOULD; issue a graceful
2152   close on the transport connection. Clients and servers &SHOULD; both
2153   constantly watch for the other side of the transport close, and
2154   respond to it as appropriate. If a client or server does not detect
2155   the other side's close promptly it could cause unnecessary resource
2156   drain on the network.
2157</t>
2158<t>
2159   A client, server, or proxy &MAY; close the transport connection at any
2160   time. For example, a client might have started to send a new request
2161   at the same time that the server has decided to close the "idle"
2162   connection. From the server's point of view, the connection is being
2163   closed while it was idle, but from the client's point of view, a
2164   request is in progress.
2165</t>
2166<t>
2167   This means that clients, servers, and proxies &MUST; be able to recover
2168   from asynchronous close events. Client software &SHOULD; reopen the
2169   transport connection and retransmit the aborted sequence of requests
2170   without user interaction so long as the request sequence is
2171   idempotent (see &idempotent-methods;). Non-idempotent methods or sequences
2172   &MUST-NOT; be automatically retried, although user agents &MAY; offer a
2173   human operator the choice of retrying the request(s). Confirmation by
2174   user-agent software with semantic understanding of the application
2175   &MAY; substitute for user confirmation. The automatic retry &SHOULD-NOT;
2176   be repeated if the second sequence of requests fails.
2177</t>
2178<t>
2179   Servers &SHOULD; always respond to at least one request per connection,
2180   if at all possible. Servers &SHOULD-NOT;  close a connection in the
2181   middle of transmitting a response, unless a network or client failure
2182   is suspected.
2183</t>
2184<t>
2185   Clients that use persistent connections &SHOULD; limit the number of
2186   simultaneous connections that they maintain to a given server. A
2187   single-user client &SHOULD-NOT; maintain more than 2 connections with
2188   any server or proxy. A proxy &SHOULD; use up to 2*N connections to
2189   another server or proxy, where N is the number of simultaneously
2190   active users. These guidelines are intended to improve HTTP response
2191   times and avoid congestion.
2192</t>
2193</section>
2194</section>
2195
2196<section title="Message Transmission Requirements" anchor="message.transmission.requirements">
2197
2198<section title="Persistent Connections and Flow Control" anchor="persistent.flow">
2199<t>
2200   HTTP/1.1 servers &SHOULD; maintain persistent connections and use TCP's
2201   flow control mechanisms to resolve temporary overloads, rather than
2202   terminating connections with the expectation that clients will retry.
2203   The latter technique can exacerbate network congestion.
2204</t>
2205</section>
2206
2207<section title="Monitoring Connections for Error Status Messages" anchor="persistent.monitor">
2208<t>
2209   An HTTP/1.1 (or later) client sending a message-body &SHOULD; monitor
2210   the network connection for an error status while it is transmitting
2211   the request. If the client sees an error status, it &SHOULD;
2212   immediately cease transmitting the body. If the body is being sent
2213   using a "chunked" encoding (<xref target="transfer.codings"/>), a zero length chunk and
2214   empty trailer &MAY; be used to prematurely mark the end of the message.
2215   If the body was preceded by a Content-Length header, the client &MUST;
2216   close the connection.
2217</t>
2218</section>
2219
2220<section title="Use of the 100 (Continue) Status" anchor="use.of.the.100.status">
2221<t>
2222   The purpose of the 100 (Continue) status (see &status-100;) is to
2223   allow a client that is sending a request message with a request body
2224   to determine if the origin server is willing to accept the request
2225   (based on the request headers) before the client sends the request
2226   body. In some cases, it might either be inappropriate or highly
2227   inefficient for the client to send the body if the server will reject
2228   the message without looking at the body.
2229</t>
2230<t>
2231   Requirements for HTTP/1.1 clients:
2232  <list style="symbols">
2233    <t>
2234        If a client will wait for a 100 (Continue) response before
2235        sending the request body, it &MUST; send an Expect request-header
2236        field (&header-expect;) with the "100-continue" expectation.
2237    </t>
2238    <t>
2239        A client &MUST-NOT; send an Expect request-header field (&header-expect;)
2240        with the "100-continue" expectation if it does not intend
2241        to send a request body.
2242    </t>
2243  </list>
2244</t>
2245<t>
2246   Because of the presence of older implementations, the protocol allows
2247   ambiguous situations in which a client may send "Expect: 100-continue"
2248   without receiving either a 417 (Expectation Failed) status
2249   or a 100 (Continue) status. Therefore, when a client sends this
2250   header field to an origin server (possibly via a proxy) from which it
2251   has never seen a 100 (Continue) status, the client &SHOULD-NOT;  wait
2252   for an indefinite period before sending the request body.
2253</t>
2254<t>
2255   Requirements for HTTP/1.1 origin servers:
2256  <list style="symbols">
2257    <t> Upon receiving a request which includes an Expect request-header
2258        field with the "100-continue" expectation, an origin server &MUST;
2259        either respond with 100 (Continue) status and continue to read
2260        from the input stream, or respond with a final status code. The
2261        origin server &MUST-NOT; wait for the request body before sending
2262        the 100 (Continue) response. If it responds with a final status
2263        code, it &MAY; close the transport connection or it &MAY; continue
2264        to read and discard the rest of the request.  It &MUST-NOT;
2265        perform the requested method if it returns a final status code.
2266    </t>
2267    <t> An origin server &SHOULD-NOT;  send a 100 (Continue) response if
2268        the request message does not include an Expect request-header
2269        field with the "100-continue" expectation, and &MUST-NOT; send a
2270        100 (Continue) response if such a request comes from an HTTP/1.0
2271        (or earlier) client. There is an exception to this rule: for
2272        compatibility with <xref target="RFC2068"/>, a server &MAY; send a 100 (Continue)
2273        status in response to an HTTP/1.1 PUT or POST request that does
2274        not include an Expect request-header field with the "100-continue"
2275        expectation. This exception, the purpose of which is
2276        to minimize any client processing delays associated with an
2277        undeclared wait for 100 (Continue) status, applies only to
2278        HTTP/1.1 requests, and not to requests with any other HTTP-version
2279        value.
2280    </t>
2281    <t> An origin server &MAY; omit a 100 (Continue) response if it has
2282        already received some or all of the request body for the
2283        corresponding request.
2284    </t>
2285    <t> An origin server that sends a 100 (Continue) response &MUST;
2286    ultimately send a final status code, once the request body is
2287        received and processed, unless it terminates the transport
2288        connection prematurely.
2289    </t>
2290    <t> If an origin server receives a request that does not include an
2291        Expect request-header field with the "100-continue" expectation,
2292        the request includes a request body, and the server responds
2293        with a final status code before reading the entire request body
2294        from the transport connection, then the server &SHOULD-NOT;  close
2295        the transport connection until it has read the entire request,
2296        or until the client closes the connection. Otherwise, the client
2297        might not reliably receive the response message. However, this
2298        requirement is not be construed as preventing a server from
2299        defending itself against denial-of-service attacks, or from
2300        badly broken client implementations.
2301      </t>
2302    </list>
2303</t>
2304<t>
2305   Requirements for HTTP/1.1 proxies:
2306  <list style="symbols">
2307    <t> If a proxy receives a request that includes an Expect request-header
2308        field with the "100-continue" expectation, and the proxy
2309        either knows that the next-hop server complies with HTTP/1.1 or
2310        higher, or does not know the HTTP version of the next-hop
2311        server, it &MUST; forward the request, including the Expect header
2312        field.
2313    </t>
2314    <t> If the proxy knows that the version of the next-hop server is
2315        HTTP/1.0 or lower, it &MUST-NOT; forward the request, and it &MUST;
2316        respond with a 417 (Expectation Failed) status.
2317    </t>
2318    <t> Proxies &SHOULD; maintain a cache recording the HTTP version
2319        numbers received from recently-referenced next-hop servers.
2320    </t>
2321    <t> A proxy &MUST-NOT; forward a 100 (Continue) response if the
2322        request message was received from an HTTP/1.0 (or earlier)
2323        client and did not include an Expect request-header field with
2324        the "100-continue" expectation. This requirement overrides the
2325        general rule for forwarding of 1xx responses (see &status-1xx;).
2326    </t>
2327  </list>
2328</t>
2329</section>
2330
2331<section title="Client Behavior if Server Prematurely Closes Connection" anchor="connection.premature">
2332<t>
2333   If an HTTP/1.1 client sends a request which includes a request body,
2334   but which does not include an Expect request-header field with the
2335   "100-continue" expectation, and if the client is not directly
2336   connected to an HTTP/1.1 origin server, and if the client sees the
2337   connection close before receiving any status from the server, the
2338   client &SHOULD; retry the request.  If the client does retry this
2339   request, it &MAY; use the following "binary exponential backoff"
2340   algorithm to be assured of obtaining a reliable response:
2341  <list style="numbers">
2342    <t>
2343      Initiate a new connection to the server
2344    </t>
2345    <t>
2346      Transmit the request-headers
2347    </t>
2348    <t>
2349      Initialize a variable R to the estimated round-trip time to the
2350         server (e.g., based on the time it took to establish the
2351         connection), or to a constant value of 5 seconds if the round-trip
2352         time is not available.
2353    </t>
2354    <t>
2355       Compute T = R * (2**N), where N is the number of previous
2356         retries of this request.
2357    </t>
2358    <t>
2359       Wait either for an error response from the server, or for T
2360         seconds (whichever comes first)
2361    </t>
2362    <t>
2363       If no error response is received, after T seconds transmit the
2364         body of the request.
2365    </t>
2366    <t>
2367       If client sees that the connection is closed prematurely,
2368         repeat from step 1 until the request is accepted, an error
2369         response is received, or the user becomes impatient and
2370         terminates the retry process.
2371    </t>
2372  </list>
2373</t>
2374<t>
2375   If at any point an error status is received, the client
2376  <list style="symbols">
2377      <t>&SHOULD-NOT;  continue and</t>
2378
2379      <t>&SHOULD; close the connection if it has not completed sending the
2380        request message.</t>
2381    </list>
2382</t>
2383</section>
2384</section>
2385</section>
2386
2387
2388<section title="Header Field Definitions" anchor="header.fields">
2389<t>
2390   This section defines the syntax and semantics of HTTP/1.1 header fields
2391   related to message framing and transport protocols.
2392</t>
2393<t>
2394   For entity-header fields, both sender and recipient refer to either the
2395   client or the server, depending on who sends and who receives the entity.
2396</t>
2397
2398<section title="Connection" anchor="header.connection">
2399  <iref primary="true" item="Connection header" x:for-anchor=""/>
2400  <iref primary="true" item="Headers" subitem="Connection" x:for-anchor=""/>
2401  <x:anchor-alias value="Connection"/>
2402  <x:anchor-alias value="connection-token"/>
2403<t>
2404   The Connection general-header field allows the sender to specify
2405   options that are desired for that particular connection and &MUST-NOT;
2406   be communicated by proxies over further connections.
2407</t>
2408<t>
2409   The Connection header has the following grammar:
2410</t>
2411<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Connection"/><iref primary="true" item="Grammar" subitem="connection-token"/>
2412  <x:ref>Connection</x:ref> = "Connection" ":" 1#(<x:ref>connection-token</x:ref>)
2413  <x:ref>connection-token</x:ref>  = <x:ref>token</x:ref>
2414</artwork></figure>
2415<t>
2416   HTTP/1.1 proxies &MUST; parse the Connection header field before a
2417   message is forwarded and, for each connection-token in this field,
2418   remove any header field(s) from the message with the same name as the
2419   connection-token. Connection options are signaled by the presence of
2420   a connection-token in the Connection header field, not by any
2421   corresponding additional header field(s), since the additional header
2422   field may not be sent if there are no parameters associated with that
2423   connection option.
2424</t>
2425<t>
2426   Message headers listed in the Connection header &MUST-NOT; include
2427   end-to-end headers, such as Cache-Control.
2428</t>
2429<t>
2430   HTTP/1.1 defines the "close" connection option for the sender to
2431   signal that the connection will be closed after completion of the
2432   response. For example,
2433</t>
2434<figure><artwork type="example">
2435    Connection: close
2436</artwork></figure>
2437<t>
2438   in either the request or the response header fields indicates that
2439   the connection &SHOULD-NOT;  be considered `persistent' (<xref target="persistent.connections"/>)
2440   after the current request/response is complete.
2441</t>
2442<t>
2443   An HTTP/1.1 client that does not support persistent connections &MUST;
2444   include the "close" connection option in every request message.
2445</t>
2446<t>
2447   An HTTP/1.1 server that does not support persistent connections &MUST;
2448   include the "close" connection option in every response message that
2449   does not have a 1xx (informational) status code.
2450</t>
2451<t>
2452   A system receiving an HTTP/1.0 (or lower-version) message that
2453   includes a Connection header &MUST;, for each connection-token in this
2454   field, remove and ignore any header field(s) from the message with
2455   the same name as the connection-token. This protects against mistaken
2456   forwarding of such header fields by pre-HTTP/1.1 proxies. See <xref target="compatibility.with.http.1.0.persistent.connections"/>.
2457</t>
2458</section>
2459
2460<section title="Content-Length" anchor="header.content-length">
2461  <iref primary="true" item="Content-Length header" x:for-anchor=""/>
2462  <iref primary="true" item="Headers" subitem="Content-Length" x:for-anchor=""/>
2463  <x:anchor-alias value="Content-Length"/>
2464<t>
2465   The Content-Length entity-header field indicates the size of the
2466   entity-body, in decimal number of OCTETs, sent to the recipient or,
2467   in the case of the HEAD method, the size of the entity-body that
2468   would have been sent had the request been a GET.
2469</t>
2470<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Length"/>
2471  <x:ref>Content-Length</x:ref>    = "Content-Length" ":" 1*<x:ref>DIGIT</x:ref>
2472</artwork></figure>
2473<t>
2474   An example is
2475</t>
2476<figure><artwork type="example">
2477    Content-Length: 3495
2478</artwork></figure>
2479<t>
2480   Applications &SHOULD; use this field to indicate the transfer-length of
2481   the message-body, unless this is prohibited by the rules in <xref target="message.length"/>.
2482</t>
2483<t>
2484   Any Content-Length greater than or equal to zero is a valid value.
2485   <xref target="message.length"/> describes how to determine the length of a message-body
2486   if a Content-Length is not given.
2487</t>
2488<t>
2489   Note that the meaning of this field is significantly different from
2490   the corresponding definition in MIME, where it is an optional field
2491   used within the "message/external-body" content-type. In HTTP, it
2492   &SHOULD; be sent whenever the message's length can be determined prior
2493   to being transferred, unless this is prohibited by the rules in
2494   <xref target="message.length"/>.
2495</t>
2496</section>
2497
2498<section title="Date" anchor="header.date">
2499  <iref primary="true" item="Date header" x:for-anchor=""/>
2500  <iref primary="true" item="Headers" subitem="Date" x:for-anchor=""/>
2501  <x:anchor-alias value="Date"/>
2502<t>
2503   The Date general-header field represents the date and time at which
2504   the message was originated, having the same semantics as orig-date in
2505   <xref target="RFC2822" x:fmt="of" x:sec="3.6.1"/>. The field value is an HTTP-date, as described in <xref target="full.date"/>;
2506   it &MUST; be sent in rfc1123-date format.
2507</t>
2508<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Date"/>
2509  <x:ref>Date</x:ref>  = "Date" ":" <x:ref>HTTP-date</x:ref>
2510</artwork></figure>
2511<t>
2512   An example is
2513</t>
2514<figure><artwork type="example">
2515    Date: Tue, 15 Nov 1994 08:12:31 GMT
2516</artwork></figure>
2517<t>
2518   Origin servers &MUST; include a Date header field in all responses,
2519   except in these cases:
2520  <list style="numbers">
2521      <t>If the response status code is 100 (Continue) or 101 (Switching
2522         Protocols), the response &MAY; include a Date header field, at
2523         the server's option.</t>
2524
2525      <t>If the response status code conveys a server error, e.g. 500
2526         (Internal Server Error) or 503 (Service Unavailable), and it is
2527         inconvenient or impossible to generate a valid Date.</t>
2528
2529      <t>If the server does not have a clock that can provide a
2530         reasonable approximation of the current time, its responses
2531         &MUST-NOT; include a Date header field. In this case, the rules
2532         in <xref target="clockless.origin.server.operation"/> &MUST; be followed.</t>
2533  </list>
2534</t>
2535<t>
2536   A received message that does not have a Date header field &MUST; be
2537   assigned one by the recipient if the message will be cached by that
2538   recipient or gatewayed via a protocol which requires a Date. An HTTP
2539   implementation without a clock &MUST-NOT; cache responses without
2540   revalidating them on every use. An HTTP cache, especially a shared
2541   cache, &SHOULD; use a mechanism, such as NTP <xref target="RFC1305"/>, to synchronize its
2542   clock with a reliable external standard.
2543</t>
2544<t>
2545   Clients &SHOULD; only send a Date header field in messages that include
2546   an entity-body, as in the case of the PUT and POST requests, and even
2547   then it is optional. A client without a clock &MUST-NOT; send a Date
2548   header field in a request.
2549</t>
2550<t>
2551   The HTTP-date sent in a Date header &SHOULD-NOT;  represent a date and
2552   time subsequent to the generation of the message. It &SHOULD; represent
2553   the best available approximation of the date and time of message
2554   generation, unless the implementation has no means of generating a
2555   reasonably accurate date and time. In theory, the date ought to
2556   represent the moment just before the entity is generated. In
2557   practice, the date can be generated at any time during the message
2558   origination without affecting its semantic value.
2559</t>
2560
2561<section title="Clockless Origin Server Operation" anchor="clockless.origin.server.operation">
2562<t>
2563   Some origin server implementations might not have a clock available.
2564   An origin server without a clock &MUST-NOT; assign Expires or Last-Modified
2565   values to a response, unless these values were associated
2566   with the resource by a system or user with a reliable clock. It &MAY;
2567   assign an Expires value that is known, at or before server
2568   configuration time, to be in the past (this allows "pre-expiration"
2569   of responses without storing separate Expires values for each
2570   resource).
2571</t>
2572</section>
2573</section>
2574
2575<section title="Host" anchor="header.host">
2576  <iref primary="true" item="Host header" x:for-anchor=""/>
2577  <iref primary="true" item="Headers" subitem="Host" x:for-anchor=""/>
2578  <x:anchor-alias value="Host"/>
2579<t>
2580   The Host request-header field specifies the Internet host and port
2581   number of the resource being requested, as obtained from the original
2582   URI given by the user or referring resource (generally an HTTP URL,
2583   as described in <xref target="http.url"/>). The Host field value &MUST; represent
2584   the naming authority of the origin server or gateway given by the
2585   original URL. This allows the origin server or gateway to
2586   differentiate between internally-ambiguous URLs, such as the root "/"
2587   URL of a server for multiple host names on a single IP address.
2588</t>
2589<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Host"/>
2590  <x:ref>Host</x:ref> = "Host" ":" <x:ref>uri-host</x:ref> [ ":" <x:ref>port</x:ref> ] ; <xref target="http.url"/>
2591</artwork></figure>
2592<t>
2593   A "host" without any trailing port information implies the default
2594   port for the service requested (e.g., "80" for an HTTP URL). For
2595   example, a request on the origin server for
2596   &lt;http://www.example.org/pub/WWW/&gt; would properly include:
2597</t>
2598<figure><artwork type="example">
2599    GET /pub/WWW/ HTTP/1.1
2600    Host: www.example.org
2601</artwork></figure>
2602<t>
2603   A client &MUST; include a Host header field in all HTTP/1.1 request
2604   messages. If the requested URI does not include an Internet host
2605   name for the service being requested, then the Host header field &MUST;
2606   be given with an empty value. An HTTP/1.1 proxy &MUST; ensure that any
2607   request message it forwards does contain an appropriate Host header
2608   field that identifies the service being requested by the proxy. All
2609   Internet-based HTTP/1.1 servers &MUST; respond with a 400 (Bad Request)
2610   status code to any HTTP/1.1 request message which lacks a Host header
2611   field.
2612</t>
2613<t>
2614   See Sections <xref target="the.resource.identified.by.a.request" format="counter"/>
2615   and <xref target="changes.to.simplify.multi-homed.web.servers.and.conserve.ip.addresses" format="counter"/>
2616   for other requirements relating to Host.
2617</t>
2618</section>
2619
2620<section title="TE" anchor="header.te">
2621  <iref primary="true" item="TE header" x:for-anchor=""/>
2622  <iref primary="true" item="Headers" subitem="TE" x:for-anchor=""/>
2623  <x:anchor-alias value="TE"/>
2624  <x:anchor-alias value="t-codings"/>
2625<t>
2626   The TE request-header field indicates what extension transfer-codings
2627   it is willing to accept in the response and whether or not it is
2628   willing to accept trailer fields in a chunked transfer-coding. Its
2629   value may consist of the keyword "trailers" and/or a comma-separated
2630   list of extension transfer-coding names with optional accept
2631   parameters (as described in <xref target="transfer.codings"/>).
2632</t>
2633<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="TE"/><iref primary="true" item="Grammar" subitem="t-codings"/>
2634  <x:ref>TE</x:ref>        = "TE" ":" #( <x:ref>t-codings</x:ref> )
2635  <x:ref>t-codings</x:ref> = "trailers" | ( <x:ref>transfer-extension</x:ref> [ <x:ref>accept-params</x:ref> ] )
2636</artwork></figure>
2637<t>
2638   The presence of the keyword "trailers" indicates that the client is
2639   willing to accept trailer fields in a chunked transfer-coding, as
2640   defined in <xref target="chunked.transfer.encoding"/>. This keyword is reserved for use with
2641   transfer-coding values even though it does not itself represent a
2642   transfer-coding.
2643</t>
2644<t>
2645   Examples of its use are:
2646</t>
2647<figure><artwork type="example">
2648    TE: deflate
2649    TE:
2650    TE: trailers, deflate;q=0.5
2651</artwork></figure>
2652<t>
2653   The TE header field only applies to the immediate connection.
2654   Therefore, the keyword &MUST; be supplied within a Connection header
2655   field (<xref target="header.connection"/>) whenever TE is present in an HTTP/1.1 message.
2656</t>
2657<t>
2658   A server tests whether a transfer-coding is acceptable, according to
2659   a TE field, using these rules:
2660  <list style="numbers">
2661    <x:lt>
2662      <t>The "chunked" transfer-coding is always acceptable. If the
2663         keyword "trailers" is listed, the client indicates that it is
2664         willing to accept trailer fields in the chunked response on
2665         behalf of itself and any downstream clients. The implication is
2666         that, if given, the client is stating that either all
2667         downstream clients are willing to accept trailer fields in the
2668         forwarded response, or that it will attempt to buffer the
2669         response on behalf of downstream recipients.
2670      </t><t>
2671         <x:h>Note:</x:h> HTTP/1.1 does not define any means to limit the size of a
2672         chunked response such that a client can be assured of buffering
2673         the entire response.</t>
2674    </x:lt>
2675    <x:lt>
2676      <t>If the transfer-coding being tested is one of the transfer-codings
2677         listed in the TE field, then it is acceptable unless it
2678         is accompanied by a qvalue of 0. (As defined in &qvalue;, a
2679         qvalue of 0 means "not acceptable.")</t>
2680    </x:lt>
2681    <x:lt>
2682      <t>If multiple transfer-codings are acceptable, then the
2683         acceptable transfer-coding with the highest non-zero qvalue is
2684         preferred.  The "chunked" transfer-coding always has a qvalue
2685         of 1.</t>
2686    </x:lt>
2687  </list>
2688</t>
2689<t>
2690   If the TE field-value is empty or if no TE field is present, the only
2691   transfer-coding  is "chunked". A message with no transfer-coding is
2692   always acceptable.
2693</t>
2694</section>
2695
2696<section title="Trailer" anchor="header.trailer">
2697  <iref primary="true" item="Trailer header" x:for-anchor=""/>
2698  <iref primary="true" item="Headers" subitem="Trailer" x:for-anchor=""/>
2699  <x:anchor-alias value="Trailer"/>
2700<t>
2701   The Trailer general field value indicates that the given set of
2702   header fields is present in the trailer of a message encoded with
2703   chunked transfer-coding.
2704</t>
2705<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Trailer"/>
2706  <x:ref>Trailer</x:ref>  = "Trailer" ":" 1#<x:ref>field-name</x:ref>
2707</artwork></figure>
2708<t>
2709   An HTTP/1.1 message &SHOULD; include a Trailer header field in a
2710   message using chunked transfer-coding with a non-empty trailer. Doing
2711   so allows the recipient to know which header fields to expect in the
2712   trailer.
2713</t>
2714<t>
2715   If no Trailer header field is present, the trailer &SHOULD-NOT;  include
2716   any header fields. See <xref target="chunked.transfer.encoding"/> for restrictions on the use of
2717   trailer fields in a "chunked" transfer-coding.
2718</t>
2719<t>
2720   Message header fields listed in the Trailer header field &MUST-NOT;
2721   include the following header fields:
2722  <list style="symbols">
2723    <t>Transfer-Encoding</t>
2724    <t>Content-Length</t>
2725    <t>Trailer</t>
2726  </list>
2727</t>
2728</section>
2729
2730<section title="Transfer-Encoding" anchor="header.transfer-encoding">
2731  <iref primary="true" item="Transfer-Encoding header" x:for-anchor=""/>
2732  <iref primary="true" item="Headers" subitem="Transfer-Encoding" x:for-anchor=""/>
2733  <x:anchor-alias value="Transfer-Encoding"/>
2734<t>
2735   The Transfer-Encoding general-header field indicates what (if any)
2736   type of transformation has been applied to the message body in order
2737   to safely transfer it between the sender and the recipient. This
2738   differs from the content-coding in that the transfer-coding is a
2739   property of the message, not of the entity.
2740</t>
2741<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Transfer-Encoding"/>
2742  <x:ref>Transfer-Encoding</x:ref>       = "Transfer-Encoding" ":" 1#<x:ref>transfer-coding</x:ref>
2743</artwork></figure>
2744<t>
2745   Transfer-codings are defined in <xref target="transfer.codings"/>. An example is:
2746</t>
2747<figure><artwork type="example">
2748  Transfer-Encoding: chunked
2749</artwork></figure>
2750<t>
2751   If multiple encodings have been applied to an entity, the transfer-codings
2752   &MUST; be listed in the order in which they were applied.
2753   Additional information about the encoding parameters &MAY; be provided
2754   by other entity-header fields not defined by this specification.
2755</t>
2756<t>
2757   Many older HTTP/1.0 applications do not understand the Transfer-Encoding
2758   header.
2759</t>
2760</section>
2761
2762<section title="Upgrade" anchor="header.upgrade">
2763  <iref primary="true" item="Upgrade header" x:for-anchor=""/>
2764  <iref primary="true" item="Headers" subitem="Upgrade" x:for-anchor=""/>
2765  <x:anchor-alias value="Upgrade"/>
2766<t>
2767   The Upgrade general-header allows the client to specify what
2768   additional communication protocols it supports and would like to use
2769   if the server finds it appropriate to switch protocols. The server
2770   &MUST; use the Upgrade header field within a 101 (Switching Protocols)
2771   response to indicate which protocol(s) are being switched.
2772</t>
2773<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Upgrade"/>
2774  <x:ref>Upgrade</x:ref>        = "Upgrade" ":" 1#<x:ref>product</x:ref>
2775</artwork></figure>
2776<t>
2777   For example,
2778</t>
2779<figure><artwork type="example">
2780    Upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11
2781</artwork></figure>
2782<t>
2783   The Upgrade header field is intended to provide a simple mechanism
2784   for transition from HTTP/1.1 to some other, incompatible protocol. It
2785   does so by allowing the client to advertise its desire to use another
2786   protocol, such as a later version of HTTP with a higher major version
2787   number, even though the current request has been made using HTTP/1.1.
2788   This eases the difficult transition between incompatible protocols by
2789   allowing the client to initiate a request in the more commonly
2790   supported protocol while indicating to the server that it would like
2791   to use a "better" protocol if available (where "better" is determined
2792   by the server, possibly according to the nature of the method and/or
2793   resource being requested).
2794</t>
2795<t>
2796   The Upgrade header field only applies to switching application-layer
2797   protocols upon the existing transport-layer connection. Upgrade
2798   cannot be used to insist on a protocol change; its acceptance and use
2799   by the server is optional. The capabilities and nature of the
2800   application-layer communication after the protocol change is entirely
2801   dependent upon the new protocol chosen, although the first action
2802   after changing the protocol &MUST; be a response to the initial HTTP
2803   request containing the Upgrade header field.
2804</t>
2805<t>
2806   The Upgrade header field only applies to the immediate connection.
2807   Therefore, the upgrade keyword &MUST; be supplied within a Connection
2808   header field (<xref target="header.connection"/>) whenever Upgrade is present in an
2809   HTTP/1.1 message.
2810</t>
2811<t>
2812   The Upgrade header field cannot be used to indicate a switch to a
2813   protocol on a different connection. For that purpose, it is more
2814   appropriate to use a 301, 302, 303, or 305 redirection response.
2815</t>
2816<t>
2817   This specification only defines the protocol name "HTTP" for use by
2818   the family of Hypertext Transfer Protocols, as defined by the HTTP
2819   version rules of <xref target="http.version"/> and future updates to this
2820   specification. Any token can be used as a protocol name; however, it
2821   will only be useful if both the client and server associate the name
2822   with the same protocol.
2823</t>
2824</section>
2825
2826<section title="Via" anchor="header.via">
2827  <iref primary="true" item="Via header" x:for-anchor=""/>
2828  <iref primary="true" item="Headers" subitem="Via" x:for-anchor=""/>
2829  <x:anchor-alias value="protocol-name"/>
2830  <x:anchor-alias value="protocol-version"/>
2831  <x:anchor-alias value="pseudonym"/>
2832  <x:anchor-alias value="received-by"/>
2833  <x:anchor-alias value="received-protocol"/>
2834  <x:anchor-alias value="Via"/>
2835<t>
2836   The Via general-header field &MUST; be used by gateways and proxies to
2837   indicate the intermediate protocols and recipients between the user
2838   agent and the server on requests, and between the origin server and
2839   the client on responses. It is analogous to the "Received" field defined in
2840   <xref target="RFC2822" x:fmt="of" x:sec="3.6.7"/> and is intended to be used for tracking message forwards,
2841   avoiding request loops, and identifying the protocol capabilities of
2842   all senders along the request/response chain.
2843</t>
2844<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"/>
2845  <x:ref>Via</x:ref> =  "Via" ":" 1#( <x:ref>received-protocol</x:ref> <x:ref>received-by</x:ref> [ <x:ref>comment</x:ref> ] )
2846  <x:ref>received-protocol</x:ref> = [ <x:ref>protocol-name</x:ref> "/" ] <x:ref>protocol-version</x:ref>
2847  <x:ref>protocol-name</x:ref>     = <x:ref>token</x:ref>
2848  <x:ref>protocol-version</x:ref>  = <x:ref>token</x:ref>
2849  <x:ref>received-by</x:ref>       = ( <x:ref>uri-host</x:ref> [ ":" <x:ref>port</x:ref> ] ) | <x:ref>pseudonym</x:ref>
2850  <x:ref>pseudonym</x:ref>         = <x:ref>token</x:ref>
2851</artwork></figure>
2852<t>
2853   The received-protocol indicates the protocol version of the message
2854   received by the server or client along each segment of the
2855   request/response chain. The received-protocol version is appended to
2856   the Via field value when the message is forwarded so that information
2857   about the protocol capabilities of upstream applications remains
2858   visible to all recipients.
2859</t>
2860<t>
2861   The protocol-name is optional if and only if it would be "HTTP". The
2862   received-by field is normally the host and optional port number of a
2863   recipient server or client that subsequently forwarded the message.
2864   However, if the real host is considered to be sensitive information,
2865   it &MAY; be replaced by a pseudonym. If the port is not given, it &MAY;
2866   be assumed to be the default port of the received-protocol.
2867</t>
2868<t>
2869   Multiple Via field values represents each proxy or gateway that has
2870   forwarded the message. Each recipient &MUST; append its information
2871   such that the end result is ordered according to the sequence of
2872   forwarding applications.
2873</t>
2874<t>
2875   Comments &MAY; be used in the Via header field to identify the software
2876   of the recipient proxy or gateway, analogous to the User-Agent and
2877   Server header fields. However, all comments in the Via field are
2878   optional and &MAY; be removed by any recipient prior to forwarding the
2879   message.
2880</t>
2881<t>
2882   For example, a request message could be sent from an HTTP/1.0 user
2883   agent to an internal proxy code-named "fred", which uses HTTP/1.1 to
2884   forward the request to a public proxy at p.example.net, which completes
2885   the request by forwarding it to the origin server at www.example.com.
2886   The request received by www.example.com would then have the following
2887   Via header field:
2888</t>
2889<figure><artwork type="example">
2890    Via: 1.0 fred, 1.1 p.example.net (Apache/1.1)
2891</artwork></figure>
2892<t>
2893   Proxies and gateways used as a portal through a network firewall
2894   &SHOULD-NOT;, by default, forward the names and ports of hosts within
2895   the firewall region. This information &SHOULD; only be propagated if
2896   explicitly enabled. If not enabled, the received-by host of any host
2897   behind the firewall &SHOULD; be replaced by an appropriate pseudonym
2898   for that host.
2899</t>
2900<t>
2901   For organizations that have strong privacy requirements for hiding
2902   internal structures, a proxy &MAY; combine an ordered subsequence of
2903   Via header field entries with identical received-protocol values into
2904   a single such entry. For example,
2905</t>
2906<figure><artwork type="example">
2907    Via: 1.0 ricky, 1.1 ethel, 1.1 fred, 1.0 lucy
2908</artwork></figure>
2909<t>
2910        could be collapsed to
2911</t>
2912<figure><artwork type="example">
2913    Via: 1.0 ricky, 1.1 mertz, 1.0 lucy
2914</artwork></figure>
2915<t>
2916   Applications &SHOULD-NOT;  combine multiple entries unless they are all
2917   under the same organizational control and the hosts have already been
2918   replaced by pseudonyms. Applications &MUST-NOT; combine entries which
2919   have different received-protocol values.
2920</t>
2921</section>
2922
2923</section>
2924
2925<section title="IANA Considerations" anchor="IANA.considerations">
2926<section title="Message Header Registration" anchor="message.header.registration">
2927<t>
2928   The Message Header Registry located at <eref target="http://www.iana.org/assignments/message-headers/message-header-index.html"/> should be updated
2929   with the permanent registrations below (see <xref target="RFC3864"/>):
2930</t>
2931<!--AUTOGENERATED FROM extract-header-defs.xslt, do not edit manually-->
2932<texttable align="left" suppress-title="true" anchor="iana.header.registration.table">
2933   <ttcol>Header Field Name</ttcol>
2934   <ttcol>Protocol</ttcol>
2935   <ttcol>Status</ttcol>
2936   <ttcol>Reference</ttcol>
2937
2938   <c>Connection</c>
2939   <c>http</c>
2940   <c>standard</c>
2941   <c>
2942      <xref target="header.connection"/>
2943   </c>
2944   <c>Content-Length</c>
2945   <c>http</c>
2946   <c>standard</c>
2947   <c>
2948      <xref target="header.content-length"/>
2949   </c>
2950   <c>Date</c>
2951   <c>http</c>
2952   <c>standard</c>
2953   <c>
2954      <xref target="header.date"/>
2955   </c>
2956   <c>Host</c>
2957   <c>http</c>
2958   <c>standard</c>
2959   <c>
2960      <xref target="header.host"/>
2961   </c>
2962   <c>TE</c>
2963   <c>http</c>
2964   <c>standard</c>
2965   <c>
2966      <xref target="header.te"/>
2967   </c>
2968   <c>Trailer</c>
2969   <c>http</c>
2970   <c>standard</c>
2971   <c>
2972      <xref target="header.trailer"/>
2973   </c>
2974   <c>Transfer-Encoding</c>
2975   <c>http</c>
2976   <c>standard</c>
2977   <c>
2978      <xref target="header.transfer-encoding"/>
2979   </c>
2980   <c>Upgrade</c>
2981   <c>http</c>
2982   <c>standard</c>
2983   <c>
2984      <xref target="header.upgrade"/>
2985   </c>
2986   <c>Via</c>
2987   <c>http</c>
2988   <c>standard</c>
2989   <c>
2990      <xref target="header.via"/>
2991   </c>
2992</texttable>
2993<!--(END)-->
2994<t>
2995   The change controller is: "IETF (iesg@ietf.org) - Internet Engineering Task Force".
2996</t>
2997</section>
2998
2999<section title="URI Scheme Registration" anchor="uri.scheme.registration">
3000<t>
3001   The entry for the "http" URI Scheme in the registry located at
3002   <eref target="http://www.iana.org/assignments/uri-schemes.html"/>
3003   should be updated to point to <xref target="http.url"/> of this document
3004   (see <xref target="RFC4395"/>).
3005</t>
3006</section>
3007
3008<section title="Internet Media Type Registrations" anchor="internet.media.type.http">
3009<t>
3010   This document serves as the specification for the Internet media types
3011   "message/http" and "application/http". The following is to be registered with
3012   IANA (see <xref target="RFC4288"/>).
3013</t>
3014<section title="Internet Media Type message/http" anchor="internet.media.type.message.http">
3015<iref item="Media Type" subitem="message/http" primary="true"/>
3016<iref item="message/http Media Type" primary="true"/>
3017<t>
3018   The message/http type can be used to enclose a single HTTP request or
3019   response message, provided that it obeys the MIME restrictions for all
3020   "message" types regarding line length and encodings.
3021</t>
3022<t>
3023  <list style="hanging" x:indent="12em">
3024    <t hangText="Type name:">
3025      message
3026    </t>
3027    <t hangText="Subtype name:">
3028      http
3029    </t>
3030    <t hangText="Required parameters:">
3031      none
3032    </t>
3033    <t hangText="Optional parameters:">
3034      version, msgtype
3035      <list style="hanging">
3036        <t hangText="version:">
3037          The HTTP-Version number of the enclosed message
3038          (e.g., "1.1"). If not present, the version can be
3039          determined from the first line of the body.
3040        </t>
3041        <t hangText="msgtype:">
3042          The message type -- "request" or "response". If not
3043          present, the type can be determined from the first
3044          line of the body.
3045        </t>
3046      </list>
3047    </t>
3048    <t hangText="Encoding considerations:">
3049      only "7bit", "8bit", or "binary" are permitted
3050    </t>
3051    <t hangText="Security considerations:">
3052      none
3053    </t>
3054    <t hangText="Interoperability considerations:">
3055      none
3056    </t>
3057    <t hangText="Published specification:">
3058      This specification (see <xref target="internet.media.type.message.http"/>).
3059    </t>
3060    <t hangText="Applications that use this media type:">
3061    </t>
3062    <t hangText="Additional information:">
3063      <list style="hanging">
3064        <t hangText="Magic number(s):">none</t>
3065        <t hangText="File extension(s):">none</t>
3066        <t hangText="Macintosh file type code(s):">none</t>
3067      </list>
3068    </t>
3069    <t hangText="Person and email address to contact for further information:">
3070      See Authors Section.
3071    </t>
3072                <t hangText="Intended usage:">
3073                  COMMON
3074    </t>
3075                <t hangText="Restrictions on usage:">
3076                  none
3077    </t>
3078    <t hangText="Author/Change controller:">
3079      IESG
3080    </t>
3081  </list>
3082</t>
3083</section>
3084<section title="Internet Media Type application/http" anchor="internet.media.type.application.http">
3085<iref item="Media Type" subitem="application/http" primary="true"/>
3086<iref item="application/http Media Type" primary="true"/>
3087<t>
3088   The application/http type can be used to enclose a pipeline of one or more
3089   HTTP request or response messages (not intermixed).
3090</t>
3091<t>
3092  <list style="hanging" x:indent="12em">
3093    <t hangText="Type name:">
3094      application
3095    </t>
3096    <t hangText="Subtype name:">
3097      http
3098    </t>
3099    <t hangText="Required parameters:">
3100      none
3101    </t>
3102    <t hangText="Optional parameters:">
3103      version, msgtype
3104      <list style="hanging">
3105        <t hangText="version:">
3106          The HTTP-Version number of the enclosed messages
3107          (e.g., "1.1"). If not present, the version can be
3108          determined from the first line of the body.
3109        </t>
3110        <t hangText="msgtype:">
3111          The message type -- "request" or "response". If not
3112          present, the type can be determined from the first
3113          line of the body.
3114        </t>
3115      </list>
3116    </t>
3117    <t hangText="Encoding considerations:">
3118      HTTP messages enclosed by this type
3119      are in "binary" format; use of an appropriate
3120      Content-Transfer-Encoding is required when
3121      transmitted via E-mail.
3122    </t>
3123    <t hangText="Security considerations:">
3124      none
3125    </t>
3126    <t hangText="Interoperability considerations:">
3127      none
3128    </t>
3129    <t hangText="Published specification:">
3130      This specification (see <xref target="internet.media.type.application.http"/>).
3131    </t>
3132    <t hangText="Applications that use this media type:">
3133    </t>
3134    <t hangText="Additional information:">
3135      <list style="hanging">
3136        <t hangText="Magic number(s):">none</t>
3137        <t hangText="File extension(s):">none</t>
3138        <t hangText="Macintosh file type code(s):">none</t>
3139      </list>
3140    </t>
3141    <t hangText="Person and email address to contact for further information:">
3142      See Authors Section.
3143    </t>
3144                <t hangText="Intended usage:">
3145                  COMMON
3146    </t>
3147                <t hangText="Restrictions on usage:">
3148                  none
3149    </t>
3150    <t hangText="Author/Change controller:">
3151      IESG
3152    </t>
3153  </list>
3154</t>
3155</section>
3156</section>
3157
3158</section>
3159
3160<section title="Security Considerations" anchor="security.considerations">
3161<t>
3162   This section is meant to inform application developers, information
3163   providers, and users of the security limitations in HTTP/1.1 as
3164   described by this document. The discussion does not include
3165   definitive solutions to the problems revealed, though it does make
3166   some suggestions for reducing security risks.
3167</t>
3168
3169<section title="Personal Information" anchor="personal.information">
3170<t>
3171   HTTP clients are often privy to large amounts of personal information
3172   (e.g. the user's name, location, mail address, passwords, encryption
3173   keys, etc.), and &SHOULD; be very careful to prevent unintentional
3174   leakage of this information.
3175   We very strongly recommend that a convenient interface be provided
3176   for the user to control dissemination of such information, and that
3177   designers and implementors be particularly careful in this area.
3178   History shows that errors in this area often create serious security
3179   and/or privacy problems and generate highly adverse publicity for the
3180   implementor's company.
3181</t>
3182</section>
3183
3184<section title="Abuse of Server Log Information" anchor="abuse.of.server.log.information">
3185<t>
3186   A server is in the position to save personal data about a user's
3187   requests which might identify their reading patterns or subjects of
3188   interest. This information is clearly confidential in nature and its
3189   handling can be constrained by law in certain countries. People using
3190   HTTP to provide data are responsible for ensuring that
3191   such material is not distributed without the permission of any
3192   individuals that are identifiable by the published results.
3193</t>
3194</section>
3195
3196<section title="Attacks Based On File and Path Names" anchor="attack.pathname">
3197<t>
3198   Implementations of HTTP origin servers &SHOULD; be careful to restrict
3199   the documents returned by HTTP requests to be only those that were
3200   intended by the server administrators. If an HTTP server translates
3201   HTTP URIs directly into file system calls, the server &MUST; take
3202   special care not to serve files that were not intended to be
3203   delivered to HTTP clients. For example, UNIX, Microsoft Windows, and
3204   other operating systems use ".." as a path component to indicate a
3205   directory level above the current one. On such a system, an HTTP
3206   server &MUST; disallow any such construct in the Request-URI if it
3207   would otherwise allow access to a resource outside those intended to
3208   be accessible via the HTTP server. Similarly, files intended for
3209   reference only internally to the server (such as access control
3210   files, configuration files, and script code) &MUST; be protected from
3211   inappropriate retrieval, since they might contain sensitive
3212   information. Experience has shown that minor bugs in such HTTP server
3213   implementations have turned into security risks.
3214</t>
3215</section>
3216
3217<section title="DNS Spoofing" anchor="dns.spoofing">
3218<t>
3219   Clients using HTTP rely heavily on the Domain Name Service, and are
3220   thus generally prone to security attacks based on the deliberate
3221   mis-association of IP addresses and DNS names. Clients need to be
3222   cautious in assuming the continuing validity of an IP number/DNS name
3223   association.
3224</t>
3225<t>
3226   In particular, HTTP clients &SHOULD; rely on their name resolver for
3227   confirmation of an IP number/DNS name association, rather than
3228   caching the result of previous host name lookups. Many platforms
3229   already can cache host name lookups locally when appropriate, and
3230   they &SHOULD; be configured to do so. It is proper for these lookups to
3231   be cached, however, only when the TTL (Time To Live) information
3232   reported by the name server makes it likely that the cached
3233   information will remain useful.
3234</t>
3235<t>
3236   If HTTP clients cache the results of host name lookups in order to
3237   achieve a performance improvement, they &MUST; observe the TTL
3238   information reported by DNS.
3239</t>
3240<t>
3241   If HTTP clients do not observe this rule, they could be spoofed when
3242   a previously-accessed server's IP address changes. As network
3243   renumbering is expected to become increasingly common <xref target="RFC1900"/>, the
3244   possibility of this form of attack will grow. Observing this
3245   requirement thus reduces this potential security vulnerability.
3246</t>
3247<t>
3248   This requirement also improves the load-balancing behavior of clients
3249   for replicated servers using the same DNS name and reduces the
3250   likelihood of a user's experiencing failure in accessing sites which
3251   use that strategy.
3252</t>
3253</section>
3254
3255<section title="Proxies and Caching" anchor="attack.proxies">
3256<t>
3257   By their very nature, HTTP proxies are men-in-the-middle, and
3258   represent an opportunity for man-in-the-middle attacks. Compromise of
3259   the systems on which the proxies run can result in serious security
3260   and privacy problems. Proxies have access to security-related
3261   information, personal information about individual users and
3262   organizations, and proprietary information belonging to users and
3263   content providers. A compromised proxy, or a proxy implemented or
3264   configured without regard to security and privacy considerations,
3265   might be used in the commission of a wide range of potential attacks.
3266</t>
3267<t>
3268   Proxy operators should protect the systems on which proxies run as
3269   they would protect any system that contains or transports sensitive
3270   information. In particular, log information gathered at proxies often
3271   contains highly sensitive personal information, and/or information
3272   about organizations. Log information should be carefully guarded, and
3273   appropriate guidelines for use developed and followed. (<xref target="abuse.of.server.log.information"/>).
3274</t>
3275<t>
3276   Proxy implementors should consider the privacy and security
3277   implications of their design and coding decisions, and of the
3278   configuration options they provide to proxy operators (especially the
3279   default configuration).
3280</t>
3281<t>
3282   Users of a proxy need to be aware that they are no trustworthier than
3283   the people who run the proxy; HTTP itself cannot solve this problem.
3284</t>
3285<t>
3286   The judicious use of cryptography, when appropriate, may suffice to
3287   protect against a broad range of security and privacy attacks. Such
3288   cryptography is beyond the scope of the HTTP/1.1 specification.
3289</t>
3290</section>
3291
3292<section title="Denial of Service Attacks on Proxies" anchor="attack.DoS">
3293<t>
3294   They exist. They are hard to defend against. Research continues.
3295   Beware.
3296</t>
3297</section>
3298</section>
3299
3300<section title="Acknowledgments" anchor="ack">
3301<t>
3302   This specification makes heavy use of the augmented BNF and generic
3303   constructs defined by David H. Crocker for <xref target="RFC822ABNF"/>. Similarly, it
3304   reuses many of the definitions provided by Nathaniel Borenstein and
3305   Ned Freed for MIME <xref target="RFC2045"/>. We hope that their inclusion in this
3306   specification will help reduce past confusion over the relationship
3307   between HTTP and Internet mail message formats.
3308</t>
3309<t>
3310   HTTP has evolved considerably over the years. It has
3311   benefited from a large and active developer community--the many
3312   people who have participated on the www-talk mailing list--and it is
3313   that community which has been most responsible for the success of
3314   HTTP and of the World-Wide Web in general. Marc Andreessen, Robert
3315   Cailliau, Daniel W. Connolly, Bob Denny, John Franks, Jean-Francois
3316   Groff, Phillip M. Hallam-Baker, Hakon W. Lie, Ari Luotonen, Rob
3317   McCool, Lou Montulli, Dave Raggett, Tony Sanders, and Marc
3318   VanHeyningen deserve special recognition for their efforts in
3319   defining early aspects of the protocol.
3320</t>
3321<t>
3322   This document has benefited greatly from the comments of all those
3323   participating in the HTTP-WG. In addition to those already mentioned,
3324   the following individuals have contributed to this specification:
3325</t>
3326<t>
3327   Gary Adams, Harald Tveit Alvestrand, Keith Ball, Brian Behlendorf,
3328   Paul Burchard, Maurizio Codogno, Mike Cowlishaw, Roman Czyborra,
3329   Michael A. Dolan, Daniel DuBois, David J. Fiander, Alan Freier, Marc Hedlund, Greg Herlihy,
3330   Koen Holtman, Alex Hopmann, Bob Jernigan, Shel Kaphan, Rohit Khare,
3331   John Klensin, Martijn Koster, Alexei Kosut, David M. Kristol,
3332   Daniel LaLiberte, Ben Laurie, Paul J. Leach, Albert Lunde,
3333   John C. Mallery, Jean-Philippe Martin-Flatin, Mitra, David Morris,
3334   Gavin Nicol, Ross Patterson, Bill Perry, Jeffrey Perry, Scott Powers, Owen Rees,
3335   Luigi Rizzo, David Robinson, Marc Salomon, Rich Salz,
3336   Allan M. Schiffman, Jim Seidman, Chuck Shotton, Eric W. Sink,
3337   Simon E. Spero, Richard N. Taylor, Robert S. Thau,
3338   Bill (BearHeart) Weinman, Francois Yergeau, Mary Ellen Zurko,
3339   Josh Cohen.
3340</t>
3341<t>
3342   Thanks to the "cave men" of Palo Alto. You know who you are.
3343</t>
3344<t>
3345   Jim Gettys (the editor of <xref target="RFC2616"/>) wishes particularly
3346   to thank Roy Fielding, the editor of <xref target="RFC2068"/>, along
3347   with John Klensin, Jeff Mogul, Paul Leach, Dave Kristol, Koen
3348   Holtman, John Franks, Josh Cohen, Alex Hopmann, Scott Lawrence, and
3349   Larry Masinter for their help. And thanks go particularly to Jeff
3350   Mogul and Scott Lawrence for performing the "MUST/MAY/SHOULD" audit.
3351</t>
3352<t>
3353   The Apache Group, Anselm Baird-Smith, author of Jigsaw, and Henrik
3354   Frystyk implemented RFC 2068 early, and we wish to thank them for the
3355   discovery of many of the problems that this document attempts to
3356   rectify.
3357</t>
3358</section>
3359
3360</middle>
3361<back>
3362
3363<references title="Normative References">
3364
3365<reference anchor="ISO-8859-1">
3366  <front>
3367    <title>
3368     Information technology -- 8-bit single-byte coded graphic character sets -- Part 1: Latin alphabet No. 1
3369    </title>
3370    <author>
3371      <organization>International Organization for Standardization</organization>
3372    </author>
3373    <date year="1998"/>
3374  </front>
3375  <seriesInfo name="ISO/IEC" value="8859-1:1998"/>
3376</reference>
3377
3378<reference anchor="Part2">
3379  <front>
3380    <title abbrev="HTTP/1.1">HTTP/1.1, part 2: Message Semantics</title>
3381    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
3382      <organization abbrev="Day Software">Day Software</organization>
3383      <address><email>fielding@gbiv.com</email></address>
3384    </author>
3385    <author initials="J." surname="Gettys" fullname="Jim Gettys">
3386      <organization>One Laptop per Child</organization>
3387      <address><email>jg@laptop.org</email></address>
3388    </author>
3389    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
3390      <organization abbrev="HP">Hewlett-Packard Company</organization>
3391      <address><email>JeffMogul@acm.org</email></address>
3392    </author>
3393    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
3394      <organization abbrev="Microsoft">Microsoft Corporation</organization>
3395      <address><email>henrikn@microsoft.com</email></address>
3396    </author>
3397    <author initials="L." surname="Masinter" fullname="Larry Masinter">
3398      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
3399      <address><email>LMM@acm.org</email></address>
3400    </author>
3401    <author initials="P." surname="Leach" fullname="Paul J. Leach">
3402      <organization abbrev="Microsoft">Microsoft Corporation</organization>
3403      <address><email>paulle@microsoft.com</email></address>
3404    </author>
3405    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
3406      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
3407      <address><email>timbl@w3.org</email></address>
3408    </author>
3409    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
3410      <organization abbrev="W3C">World Wide Web Consortium</organization>
3411      <address><email>ylafon@w3.org</email></address>
3412    </author>
3413    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
3414      <organization abbrev="greenbytes">greenbytes GmbH</organization>
3415      <address><email>julian.reschke@greenbytes.de</email></address>
3416    </author>
3417    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
3418  </front>
3419  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p2-semantics-&ID-VERSION;"/>
3420  <x:source href="p2-semantics.xml" basename="p2-semantics"/>
3421</reference>
3422
3423<reference anchor="Part3">
3424  <front>
3425    <title abbrev="HTTP/1.1">HTTP/1.1, part 3: Message Payload and Content Negotiation</title>
3426    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
3427      <organization abbrev="Day Software">Day Software</organization>
3428      <address><email>fielding@gbiv.com</email></address>
3429    </author>
3430    <author initials="J." surname="Gettys" fullname="Jim Gettys">
3431      <organization>One Laptop per Child</organization>
3432      <address><email>jg@laptop.org</email></address>
3433    </author>
3434    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
3435      <organization abbrev="HP">Hewlett-Packard Company</organization>
3436      <address><email>JeffMogul@acm.org</email></address>
3437    </author>
3438    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
3439      <organization abbrev="Microsoft">Microsoft Corporation</organization>
3440      <address><email>henrikn@microsoft.com</email></address>
3441    </author>
3442    <author initials="L." surname="Masinter" fullname="Larry Masinter">
3443      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
3444      <address><email>LMM@acm.org</email></address>
3445    </author>
3446    <author initials="P." surname="Leach" fullname="Paul J. Leach">
3447      <organization abbrev="Microsoft">Microsoft Corporation</organization>
3448      <address><email>paulle@microsoft.com</email></address>
3449    </author>
3450    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
3451      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
3452      <address><email>timbl@w3.org</email></address>
3453    </author>
3454    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
3455      <organization abbrev="W3C">World Wide Web Consortium</organization>
3456      <address><email>ylafon@w3.org</email></address>
3457    </author>
3458    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
3459      <organization abbrev="greenbytes">greenbytes GmbH</organization>
3460      <address><email>julian.reschke@greenbytes.de</email></address>
3461    </author>
3462    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
3463  </front>
3464  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p3-payload-&ID-VERSION;"/>
3465  <x:source href="p3-payload.xml" basename="p3-payload"/>
3466</reference>
3467
3468<reference anchor="Part5">
3469  <front>
3470    <title abbrev="HTTP/1.1">HTTP/1.1, part 5: Range Requests and Partial Responses</title>
3471    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
3472      <organization abbrev="Day Software">Day Software</organization>
3473      <address><email>fielding@gbiv.com</email></address>
3474    </author>
3475    <author initials="J." surname="Gettys" fullname="Jim Gettys">
3476      <organization>One Laptop per Child</organization>
3477      <address><email>jg@laptop.org</email></address>
3478    </author>
3479    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
3480      <organization abbrev="HP">Hewlett-Packard Company</organization>
3481      <address><email>JeffMogul@acm.org</email></address>
3482    </author>
3483    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
3484      <organization abbrev="Microsoft">Microsoft Corporation</organization>
3485      <address><email>henrikn@microsoft.com</email></address>
3486    </author>
3487    <author initials="L." surname="Masinter" fullname="Larry Masinter">
3488      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
3489      <address><email>LMM@acm.org</email></address>
3490    </author>
3491    <author initials="P." surname="Leach" fullname="Paul J. Leach">
3492      <organization abbrev="Microsoft">Microsoft Corporation</organization>
3493      <address><email>paulle@microsoft.com</email></address>
3494    </author>
3495    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
3496      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
3497      <address><email>timbl@w3.org</email></address>
3498    </author>
3499    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
3500      <organization abbrev="W3C">World Wide Web Consortium</organization>
3501      <address><email>ylafon@w3.org</email></address>
3502    </author>
3503    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
3504      <organization abbrev="greenbytes">greenbytes GmbH</organization>
3505      <address><email>julian.reschke@greenbytes.de</email></address>
3506    </author>
3507    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
3508  </front>
3509  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p5-range-&ID-VERSION;"/>
3510  <x:source href="p5-range.xml" basename="p5-range"/>
3511</reference>
3512
3513<reference anchor="Part6">
3514  <front>
3515    <title abbrev="HTTP/1.1">HTTP/1.1, part 6: Caching</title>
3516    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
3517      <organization abbrev="Day Software">Day Software</organization>
3518      <address><email>fielding@gbiv.com</email></address>
3519    </author>
3520    <author initials="J." surname="Gettys" fullname="Jim Gettys">
3521      <organization>One Laptop per Child</organization>
3522      <address><email>jg@laptop.org</email></address>
3523    </author>
3524    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
3525      <organization abbrev="HP">Hewlett-Packard Company</organization>
3526      <address><email>JeffMogul@acm.org</email></address>
3527    </author>
3528    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
3529      <organization abbrev="Microsoft">Microsoft Corporation</organization>
3530      <address><email>henrikn@microsoft.com</email></address>
3531    </author>
3532    <author initials="L." surname="Masinter" fullname="Larry Masinter">
3533      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
3534      <address><email>LMM@acm.org</email></address>
3535    </author>
3536    <author initials="P." surname="Leach" fullname="Paul J. Leach">
3537      <organization abbrev="Microsoft">Microsoft Corporation</organization>
3538      <address><email>paulle@microsoft.com</email></address>
3539    </author>
3540    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
3541      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
3542      <address><email>timbl@w3.org</email></address>
3543    </author>
3544    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
3545      <organization abbrev="W3C">World Wide Web Consortium</organization>
3546      <address><email>ylafon@w3.org</email></address>
3547    </author>
3548    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
3549      <organization abbrev="greenbytes">greenbytes GmbH</organization>
3550      <address><email>julian.reschke@greenbytes.de</email></address>
3551    </author>
3552    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
3553  </front>
3554  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p6-cache-&ID-VERSION;"/>
3555  <x:source href="p6-cache.xml" basename="p6-cache"/>
3556</reference>
3557
3558<reference anchor="RFC822ABNF">
3559  <front>
3560    <title abbrev="Standard for ARPA Internet Text Messages">Standard for the format of ARPA Internet text messages</title>
3561    <author initials="D.H." surname="Crocker" fullname="David H. Crocker">
3562      <organization>University of Delaware, Dept. of Electrical Engineering</organization>
3563      <address><email>DCrocker@UDel-Relay</email></address>
3564    </author>
3565    <date month="August" day="13" year="1982"/>
3566  </front>
3567  <seriesInfo name="STD" value="11"/>
3568  <seriesInfo name="RFC" value="822"/>
3569</reference>
3570
3571<reference anchor="RFC2045">
3572  <front>
3573    <title abbrev="Internet Message Bodies">Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies</title>
3574    <author initials="N." surname="Freed" fullname="Ned Freed">
3575      <organization>Innosoft International, Inc.</organization>
3576      <address><email>ned@innosoft.com</email></address>
3577    </author>
3578    <author initials="N.S." surname="Borenstein" fullname="Nathaniel S. Borenstein">
3579      <organization>First Virtual Holdings</organization>
3580      <address><email>nsb@nsb.fv.com</email></address>
3581    </author>
3582    <date month="November" year="1996"/>
3583  </front>
3584  <seriesInfo name="RFC" value="2045"/>
3585</reference>
3586
3587<reference anchor="RFC2047">
3588  <front>
3589    <title abbrev="Message Header Extensions">MIME (Multipurpose Internet Mail Extensions) Part Three: Message Header Extensions for Non-ASCII Text</title>
3590    <author initials="K." surname="Moore" fullname="Keith Moore">
3591      <organization>University of Tennessee</organization>
3592      <address><email>moore@cs.utk.edu</email></address>
3593    </author>
3594    <date month="November" year="1996"/>
3595  </front>
3596  <seriesInfo name="RFC" value="2047"/>
3597</reference>
3598
3599<reference anchor="RFC2119">
3600  <front>
3601    <title>Key words for use in RFCs to Indicate Requirement Levels</title>
3602    <author initials="S." surname="Bradner" fullname="Scott Bradner">
3603      <organization>Harvard University</organization>
3604      <address><email>sob@harvard.edu</email></address>
3605    </author>
3606    <date month="March" year="1997"/>
3607  </front>
3608  <seriesInfo name="BCP" value="14"/>
3609  <seriesInfo name="RFC" value="2119"/>
3610</reference>
3611
3612<reference anchor="RFC2396">
3613  <front>
3614    <title abbrev="URI Generic Syntax">Uniform Resource Identifiers (URI): Generic Syntax</title>
3615    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
3616      <organization abbrev="MIT/LCS">World Wide Web Consortium</organization>
3617      <address><email>timbl@w3.org</email></address>
3618    </author>
3619    <author initials="R.T." surname="Fielding" fullname="Roy T. Fielding">
3620      <organization abbrev="U.C. Irvine">Department of Information and Computer Science</organization>
3621      <address><email>fielding@ics.uci.edu</email></address>
3622    </author>
3623    <author initials="L." surname="Masinter" fullname="Larry Masinter">
3624      <organization abbrev="Xerox Corporation">Xerox PARC</organization>
3625      <address><email>masinter@parc.xerox.com</email></address>
3626    </author>
3627    <date month="August" year="1998"/>
3628  </front>
3629  <seriesInfo name="RFC" value="2396"/>
3630</reference>
3631
3632<reference anchor="USASCII">
3633  <front>
3634    <title>Coded Character Set -- 7-bit American Standard Code for Information Interchange</title>
3635    <author>
3636      <organization>American National Standards Institute</organization>
3637    </author>
3638    <date year="1986"/>
3639  </front>
3640  <seriesInfo name="ANSI" value="X3.4"/>
3641</reference>
3642
3643</references>
3644
3645<references title="Informative References">
3646
3647<reference anchor="Nie1997" target="http://doi.acm.org/10.1145/263105.263157">
3648  <front>
3649    <title>Network Performance Effects of HTTP/1.1, CSS1, and PNG</title>
3650    <author initials="H.F.." surname="Nielsen" fullname="H.F. Nielsen">
3651      <organization/>
3652    </author>
3653    <author initials="J." surname="Gettys" fullname="J. Gettys">
3654      <organization/>
3655    </author>
3656    <author initials="E." surname="Prud'hommeaux" fullname="E. Prud'hommeaux">
3657      <organization/>
3658    </author>
3659    <author initials="H." surname="Lie" fullname="H. Lie">
3660      <organization/>
3661    </author>
3662    <author initials="C." surname="Lilley" fullname="C. Lilley">
3663      <organization/>
3664    </author>
3665    <date year="1997" month="September"/>
3666  </front>
3667  <seriesInfo name="ACM" value="Proceedings of the ACM SIGCOMM '97 conference on Applications, technologies, architectures, and protocols for computer communication SIGCOMM '97"/>
3668</reference>
3669
3670<reference anchor="Pad1995" target="http://portal.acm.org/citation.cfm?id=219094">
3671  <front>
3672    <title>Improving HTTP Latency</title>
3673    <author initials="V.N." surname="Padmanabhan" fullname="Venkata N. Padmanabhan">
3674      <organization/>
3675    </author>
3676    <author initials="J.C." surname="Mogul" fullname="Jeffrey C. Mogul">
3677      <organization/>
3678    </author>
3679    <date year="1995" month="December"/>
3680  </front>
3681  <seriesInfo name="Computer Networks and ISDN Systems" value="v. 28, pp. 25-35"/>
3682</reference>
3683
3684<reference anchor="RFC822">
3685  <front>
3686    <title abbrev="Standard for ARPA Internet Text Messages">Standard for the format of ARPA Internet text messages</title>
3687    <author initials="D.H." surname="Crocker" fullname="David H. Crocker">
3688      <organization>University of Delaware, Dept. of Electrical Engineering</organization>
3689      <address><email>DCrocker@UDel-Relay</email></address>
3690    </author>
3691    <date month="August" day="13" year="1982"/>
3692  </front>
3693  <seriesInfo name="STD" value="11"/>
3694  <seriesInfo name="RFC" value="822"/>
3695</reference>
3696
3697<reference anchor="RFC959">
3698  <front>
3699    <title abbrev="File Transfer Protocol">File Transfer Protocol</title>
3700    <author initials="J." surname="Postel" fullname="J. Postel">
3701      <organization>Information Sciences Institute (ISI)</organization>
3702    </author>
3703    <author initials="J." surname="Reynolds" fullname="J. Reynolds">
3704      <organization/>
3705    </author>
3706    <date month="October" year="1985"/>
3707  </front>
3708  <seriesInfo name="STD" value="9"/>
3709  <seriesInfo name="RFC" value="959"/>
3710</reference>
3711
3712<reference anchor="RFC1123">
3713  <front>
3714    <title>Requirements for Internet Hosts - Application and Support</title>
3715    <author initials="R." surname="Braden" fullname="Robert Braden">
3716      <organization>University of Southern California (USC), Information Sciences Institute</organization>
3717      <address><email>Braden@ISI.EDU</email></address>
3718    </author>
3719    <date month="October" year="1989"/>
3720  </front>
3721  <seriesInfo name="STD" value="3"/>
3722  <seriesInfo name="RFC" value="1123"/>
3723</reference>
3724
3725<reference anchor="RFC1305">
3726  <front>
3727    <title>Network Time Protocol (Version 3) Specification, Implementation</title>
3728    <author initials="D." surname="Mills" fullname="David L. Mills">
3729      <organization>University of Delaware, Electrical Engineering Department</organization>
3730      <address><email>mills@udel.edu</email></address>
3731    </author>
3732    <date month="March" year="1992"/>
3733  </front>
3734  <seriesInfo name="RFC" value="1305"/>
3735</reference>
3736
3737<reference anchor="RFC1436">
3738  <front>
3739    <title abbrev="Gopher">The Internet Gopher Protocol (a distributed document search and retrieval protocol)</title>
3740    <author initials="F." surname="Anklesaria" fullname="Farhad Anklesaria">
3741      <organization>University of Minnesota, Computer and Information Services</organization>
3742      <address><email>fxa@boombox.micro.umn.edu</email></address>
3743    </author>
3744    <author initials="M." surname="McCahill" fullname="Mark McCahill">
3745      <organization>University of Minnesota, Computer and Information Services</organization>
3746      <address><email>mpm@boombox.micro.umn.edu</email></address>
3747    </author>
3748    <author initials="P." surname="Lindner" fullname="Paul Lindner">
3749      <organization>University of Minnesota, Computer and Information Services</organization>
3750      <address><email>lindner@boombox.micro.umn.edu</email></address>
3751    </author>
3752    <author initials="D." surname="Johnson" fullname="David Johnson">
3753      <organization>University of Minnesota, Computer and Information Services</organization>
3754      <address><email>dmj@boombox.micro.umn.edu</email></address>
3755    </author>
3756    <author initials="D." surname="Torrey" fullname="Daniel Torrey">
3757      <organization>University of Minnesota, Computer and Information Services</organization>
3758      <address><email>daniel@boombox.micro.umn.edu</email></address>
3759    </author>
3760    <author initials="B." surname="Alberti" fullname="Bob Alberti">
3761      <organization>University of Minnesota, Computer and Information Services</organization>
3762      <address><email>alberti@boombox.micro.umn.edu</email></address>
3763    </author>
3764    <date month="March" year="1993"/>
3765  </front>
3766  <seriesInfo name="RFC" value="1436"/>
3767</reference>
3768
3769<reference anchor="RFC1630">
3770  <front>
3771    <title abbrev="URIs in WWW">Universal Resource Identifiers in WWW: A Unifying Syntax for the Expression of Names and Addresses of Objects on the Network as used in the World-Wide Web</title>
3772    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
3773      <organization>CERN, World-Wide Web project</organization>
3774      <address><email>timbl@info.cern.ch</email></address>
3775    </author>
3776    <date month="June" year="1994"/>
3777  </front>
3778  <seriesInfo name="RFC" value="1630"/>
3779</reference>
3780
3781<reference anchor="RFC1737">
3782  <front>
3783    <title abbrev="Requirements for Uniform Resource Names">Functional Requirements for Uniform Resource Names</title>
3784    <author initials="L." surname="Masinter" fullname="Larry Masinter">
3785      <organization>Xerox Palo Alto Research Center</organization>
3786      <address><email>masinter@parc.xerox.com</email></address>
3787    </author>
3788    <author initials="K." surname="Sollins" fullname="Karen Sollins">
3789      <organization>MIT Laboratory for Computer Science</organization>
3790      <address><email>sollins@lcs.mit.edu</email></address>
3791    </author>
3792    <date month="December" year="1994"/>
3793  </front>
3794  <seriesInfo name="RFC" value="1737"/>
3795</reference>
3796
3797<reference anchor="RFC1738">
3798  <front>
3799    <title>Uniform Resource Locators (URL)</title>
3800    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
3801      <organization>CERN, World-Wide Web project</organization>
3802      <address><email>timbl@info.cern.ch</email></address>
3803    </author>
3804    <author initials="L." surname="Masinter" fullname="Larry Masinter">
3805      <organization>Xerox PARC</organization>
3806      <address><email>masinter@parc.xerox.com</email></address>
3807    </author>
3808    <author initials="M." surname="McCahill" fullname="Mark McCahill">
3809      <organization>University of Minnesota, Computer and Information Services</organization>
3810      <address><email>mpm@boombox.micro.umn.edu</email></address>
3811    </author>
3812    <date month="December" year="1994"/>
3813  </front>
3814  <seriesInfo name="RFC" value="1738"/>
3815</reference>
3816
3817<reference anchor="RFC1808">
3818  <front>
3819    <title>Relative Uniform Resource Locators</title>
3820    <author initials="R." surname="Fielding" fullname="Roy T. Fielding">
3821      <organization>University of California Irvine, Department of Information and Computer Science</organization>
3822      <address><email>fielding@ics.uci.edu</email></address>
3823    </author>
3824    <date month="June" year="1995"/>
3825  </front>
3826  <seriesInfo name="RFC" value="1808"/>
3827</reference>
3828
3829<reference anchor="RFC1900">
3830  <front>
3831    <title>Renumbering Needs Work</title>
3832    <author initials="B." surname="Carpenter" fullname="Brian E. Carpenter">
3833      <organization>CERN, Computing and Networks Division</organization>
3834      <address><email>brian@dxcoms.cern.ch</email></address>
3835    </author>
3836    <author initials="Y." surname="Rekhter" fullname="Yakov Rekhter">
3837      <organization>cisco Systems</organization>
3838      <address><email>yakov@cisco.com</email></address>
3839    </author>
3840    <date month="February" year="1996"/>
3841  </front>
3842  <seriesInfo name="RFC" value="1900"/>
3843</reference>
3844
3845<reference anchor="RFC1945">
3846  <front>
3847    <title abbrev="HTTP/1.0">Hypertext Transfer Protocol -- HTTP/1.0</title>
3848    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
3849      <organization>MIT, Laboratory for Computer Science</organization>
3850      <address><email>timbl@w3.org</email></address>
3851    </author>
3852    <author initials="R.T." surname="Fielding" fullname="Roy T. Fielding">
3853      <organization>University of California, Irvine, Department of Information and Computer Science</organization>
3854      <address><email>fielding@ics.uci.edu</email></address>
3855    </author>
3856    <author initials="H.F." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
3857      <organization>W3 Consortium, MIT Laboratory for Computer Science</organization>
3858      <address><email>frystyk@w3.org</email></address>
3859    </author>
3860    <date month="May" year="1996"/>
3861  </front>
3862  <seriesInfo name="RFC" value="1945"/>
3863</reference>
3864
3865<reference anchor="RFC2068">
3866  <front>
3867    <title abbrev="HTTP/1.1">Hypertext Transfer Protocol -- HTTP/1.1</title>
3868    <author initials="R." surname="Fielding" fullname="Roy T. Fielding">
3869      <organization>University of California, Irvine, Department of Information and Computer Science</organization>
3870      <address><email>fielding@ics.uci.edu</email></address>
3871    </author>
3872    <author initials="J." surname="Gettys" fullname="Jim Gettys">
3873      <organization>MIT Laboratory for Computer Science</organization>
3874      <address><email>jg@w3.org</email></address>
3875    </author>
3876    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
3877      <organization>Digital Equipment Corporation, Western Research Laboratory</organization>
3878      <address><email>mogul@wrl.dec.com</email></address>
3879    </author>
3880    <author initials="H." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
3881      <organization>MIT Laboratory for Computer Science</organization>
3882      <address><email>frystyk@w3.org</email></address>
3883    </author>
3884    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
3885      <organization>MIT Laboratory for Computer Science</organization>
3886      <address><email>timbl@w3.org</email></address>
3887    </author>
3888    <date month="January" year="1997"/>
3889  </front>
3890  <seriesInfo name="RFC" value="2068"/>
3891</reference>
3892
3893<reference anchor="RFC2145">
3894  <front>
3895    <title abbrev="HTTP Version Numbers">Use and Interpretation of HTTP Version Numbers</title>
3896    <author initials="J.C." surname="Mogul" fullname="Jeffrey C. Mogul">
3897      <organization>Western Research Laboratory</organization>
3898      <address><email>mogul@wrl.dec.com</email></address>
3899    </author>
3900    <author initials="R.T." surname="Fielding" fullname="Roy T. Fielding">
3901      <organization>Department of Information and Computer Science</organization>
3902      <address><email>fielding@ics.uci.edu</email></address>
3903    </author>
3904    <author initials="J." surname="Gettys" fullname="Jim Gettys">
3905      <organization>MIT Laboratory for Computer Science</organization>
3906      <address><email>jg@w3.org</email></address>
3907    </author>
3908    <author initials="H.F." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
3909      <organization>W3 Consortium</organization>
3910      <address><email>frystyk@w3.org</email></address>
3911    </author>
3912    <date month="May" year="1997"/>
3913  </front>
3914  <seriesInfo name="RFC" value="2145"/>
3915</reference>
3916
3917<reference anchor="RFC2324">
3918  <front>
3919    <title abbrev="HTCPCP/1.0">Hyper Text Coffee Pot Control Protocol (HTCPCP/1.0)</title>
3920    <author initials="L." surname="Masinter" fullname="Larry Masinter">
3921      <organization>Xerox Palo Alto Research Center</organization>
3922      <address><email>masinter@parc.xerox.com</email></address>
3923    </author>
3924    <date month="April" day="1" year="1998"/>
3925  </front>
3926  <seriesInfo name="RFC" value="2324"/>
3927</reference>
3928
3929<reference anchor="RFC2616">
3930  <front>
3931    <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
3932    <author initials="R." surname="Fielding" fullname="R. Fielding">
3933      <organization>University of California, Irvine</organization>
3934      <address><email>fielding@ics.uci.edu</email></address>
3935    </author>
3936    <author initials="J." surname="Gettys" fullname="J. Gettys">
3937      <organization>W3C</organization>
3938      <address><email>jg@w3.org</email></address>
3939    </author>
3940    <author initials="J." surname="Mogul" fullname="J. Mogul">
3941      <organization>Compaq Computer Corporation</organization>
3942      <address><email>mogul@wrl.dec.com</email></address>
3943    </author>
3944    <author initials="H." surname="Frystyk" fullname="H. Frystyk">
3945      <organization>MIT Laboratory for Computer Science</organization>
3946      <address><email>frystyk@w3.org</email></address>
3947    </author>
3948    <author initials="L." surname="Masinter" fullname="L. Masinter">
3949      <organization>Xerox Corporation</organization>
3950      <address><email>masinter@parc.xerox.com</email></address>
3951    </author>
3952    <author initials="P." surname="Leach" fullname="P. Leach">
3953      <organization>Microsoft Corporation</organization>
3954      <address><email>paulle@microsoft.com</email></address>
3955    </author>
3956    <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
3957      <organization>W3C</organization>
3958      <address><email>timbl@w3.org</email></address>
3959    </author>
3960    <date month="June" year="1999"/>
3961  </front>
3962  <seriesInfo name="RFC" value="2616"/>
3963</reference>
3964
3965<reference anchor="RFC2821">
3966  <front>
3967    <title>Simple Mail Transfer Protocol</title>
3968    <author initials="J." surname="Klensin" fullname="J. Klensin">
3969      <organization>AT&amp;T Laboratories</organization>
3970      <address><email>klensin@research.att.com</email></address>
3971    </author>
3972    <date year="2001" month="April"/>
3973  </front>
3974  <seriesInfo name="RFC" value="2821"/>
3975</reference>
3976
3977<reference anchor="RFC2822">
3978  <front>
3979    <title>Internet Message Format</title>
3980    <author initials="P." surname="Resnick" fullname="P. Resnick">
3981      <organization>QUALCOMM Incorporated</organization>
3982    </author>
3983    <date year="2001" month="April"/>
3984  </front>
3985  <seriesInfo name="RFC" value="2822"/>
3986</reference>
3987
3988<reference anchor='RFC3864'>
3989  <front>
3990    <title>Registration Procedures for Message Header Fields</title>
3991    <author initials='G.' surname='Klyne' fullname='G. Klyne'>
3992      <organization>Nine by Nine</organization>
3993      <address><email>GK-IETF@ninebynine.org</email></address>
3994    </author>
3995    <author initials='M.' surname='Nottingham' fullname='M. Nottingham'>
3996      <organization>BEA Systems</organization>
3997      <address><email>mnot@pobox.com</email></address>
3998    </author>
3999    <author initials='J.' surname='Mogul' fullname='J. Mogul'>
4000      <organization>HP Labs</organization>
4001      <address><email>JeffMogul@acm.org</email></address>
4002    </author>
4003    <date year='2004' month='September' />
4004  </front>
4005  <seriesInfo name='BCP' value='90' />
4006  <seriesInfo name='RFC' value='3864' />
4007</reference>
4008
4009<reference anchor='RFC3977'>
4010  <front>
4011    <title>Network News Transfer Protocol (NNTP)</title>
4012    <author initials='C.' surname='Feather' fullname='C. Feather'>
4013      <organization>THUS plc</organization>
4014      <address><email>clive@demon.net</email></address>
4015    </author>
4016    <date year='2006' month='October' />
4017  </front>
4018  <seriesInfo name="RFC" value="3977"/>
4019</reference>
4020
4021<reference anchor="RFC4288">
4022  <front>
4023    <title>Media Type Specifications and Registration Procedures</title>
4024    <author initials="N." surname="Freed" fullname="N. Freed">
4025      <organization>Sun Microsystems</organization>
4026      <address>
4027        <email>ned.freed@mrochek.com</email>
4028      </address>
4029    </author>
4030    <author initials="J." surname="Klensin" fullname="J. Klensin">
4031      <organization/>
4032      <address>
4033        <email>klensin+ietf@jck.com</email>
4034      </address>
4035    </author>
4036    <date year="2005" month="December"/>
4037  </front>
4038  <seriesInfo name="BCP" value="13"/>
4039  <seriesInfo name="RFC" value="4288"/>
4040</reference>
4041
4042<reference anchor='RFC4395'>
4043  <front>
4044    <title>Guidelines and Registration Procedures for New URI Schemes</title>
4045    <author initials='T.' surname='Hansen' fullname='T. Hansen'>
4046      <organization>AT&amp;T Laboratories</organization>
4047      <address>
4048        <email>tony+urireg@maillennium.att.com</email>
4049      </address>
4050    </author>
4051    <author initials='T.' surname='Hardie' fullname='T. Hardie'>
4052      <organization>Qualcomm, Inc.</organization>
4053      <address>
4054        <email>hardie@qualcomm.com</email>
4055      </address>
4056    </author>
4057    <author initials='L.' surname='Masinter' fullname='L. Masinter'>
4058      <organization>Adobe Systems</organization>
4059      <address>
4060        <email>LMM@acm.org</email>
4061      </address>
4062    </author>
4063    <date year='2006' month='February' />
4064  </front>
4065  <seriesInfo name='BCP' value='115' />
4066  <seriesInfo name='RFC' value='4395' />
4067</reference>
4068
4069<reference anchor="Spe" target="http://sunsite.unc.edu/mdma-release/http-prob.html">
4070  <front>
4071  <title>Analysis of HTTP Performance Problems</title>
4072  <author initials="S." surname="Spero" fullname="Simon E. Spero">
4073    <organization/>
4074  </author>
4075  <date/>
4076  </front>
4077</reference>
4078
4079<reference anchor="Tou1998" target="http://www.isi.edu/touch/pubs/http-perf96/">
4080  <front>
4081  <title>Analysis of HTTP Performance</title>
4082  <author initials="J." surname="Touch" fullname="Joe Touch">
4083    <organization>USC/Information Sciences Institute</organization>
4084    <address><email>touch@isi.edu</email></address>
4085  </author>
4086  <author initials="J." surname="Heidemann" fullname="John Heidemann">
4087    <organization>USC/Information Sciences Institute</organization>
4088    <address><email>johnh@isi.edu</email></address>
4089  </author>
4090  <author initials="K." surname="Obraczka" fullname="Katia Obraczka">
4091    <organization>USC/Information Sciences Institute</organization>
4092    <address><email>katia@isi.edu</email></address>
4093  </author>
4094  <date year="1998" month="Aug"/>
4095  </front>
4096  <seriesInfo name="ISI Research Report" value="ISI/RR-98-463"/>
4097  <annotation>(original report dated Aug. 1996)</annotation>
4098</reference>
4099
4100<reference anchor="WAIS">
4101  <front>
4102    <title>WAIS Interface Protocol Prototype Functional Specification (v1.5)</title>
4103    <author initials="F." surname="Davis" fullname="F. Davis">
4104      <organization>Thinking Machines Corporation</organization>
4105    </author>
4106    <author initials="B." surname="Kahle" fullname="B. Kahle">
4107      <organization>Thinking Machines Corporation</organization>
4108    </author>
4109    <author initials="H." surname="Morris" fullname="H. Morris">
4110      <organization>Thinking Machines Corporation</organization>
4111    </author>
4112    <author initials="J." surname="Salem" fullname="J. Salem">
4113      <organization>Thinking Machines Corporation</organization>
4114    </author>
4115    <author initials="T." surname="Shen" fullname="T. Shen">
4116      <organization>Thinking Machines Corporation</organization>
4117    </author>
4118    <author initials="R." surname="Wang" fullname="R. Wang">
4119      <organization>Thinking Machines Corporation</organization>
4120    </author>
4121    <author initials="J." surname="Sui" fullname="J. Sui">
4122      <organization>Thinking Machines Corporation</organization>
4123    </author>
4124    <author initials="M." surname="Grinbaum" fullname="M. Grinbaum">
4125      <organization>Thinking Machines Corporation</organization>
4126    </author>
4127    <date month="April" year="1990"/>
4128  </front>
4129  <seriesInfo name="Thinking Machines Corporation" value=""/>
4130</reference>
4131
4132</references>
4133
4134
4135<section title="Tolerant Applications" anchor="tolerant.applications">
4136<t>
4137   Although this document specifies the requirements for the generation
4138   of HTTP/1.1 messages, not all applications will be correct in their
4139   implementation. We therefore recommend that operational applications
4140   be tolerant of deviations whenever those deviations can be
4141   interpreted unambiguously.
4142</t>
4143<t>
4144   Clients &SHOULD; be tolerant in parsing the Status-Line and servers
4145   tolerant when parsing the Request-Line. In particular, they &SHOULD;
4146   accept any amount of SP or HTAB characters between fields, even though
4147   only a single SP is required.
4148</t>
4149<t>
4150   The line terminator for message-header fields is the sequence CRLF.
4151   However, we recommend that applications, when parsing such headers,
4152   recognize a single LF as a line terminator and ignore the leading CR.
4153</t>
4154<t>
4155   The character set of an entity-body &SHOULD; be labeled as the lowest
4156   common denominator of the character codes used within that body, with
4157   the exception that not labeling the entity is preferred over labeling
4158   the entity with the labels US-ASCII or ISO-8859-1. See &payload;.
4159</t>
4160<t>
4161   Additional rules for requirements on parsing and encoding of dates
4162   and other potential problems with date encodings include:
4163</t>
4164<t>
4165  <list style="symbols">
4166     <t>HTTP/1.1 clients and caches &SHOULD; assume that an RFC-850 date
4167        which appears to be more than 50 years in the future is in fact
4168        in the past (this helps solve the "year 2000" problem).</t>
4169
4170     <t>An HTTP/1.1 implementation &MAY; internally represent a parsed
4171        Expires date as earlier than the proper value, but &MUST-NOT;
4172        internally represent a parsed Expires date as later than the
4173        proper value.</t>
4174
4175     <t>All expiration-related calculations &MUST; be done in GMT. The
4176        local time zone &MUST-NOT; influence the calculation or comparison
4177        of an age or expiration time.</t>
4178
4179     <t>If an HTTP header incorrectly carries a date value with a time
4180        zone other than GMT, it &MUST; be converted into GMT using the
4181        most conservative possible conversion.</t>
4182  </list>
4183</t>
4184</section>
4185
4186<section title="Conversion of Date Formats" anchor="conversion.of.date.formats">
4187<t>
4188   HTTP/1.1 uses a restricted set of date formats (<xref target="full.date"/>) to
4189   simplify the process of date comparison. Proxies and gateways from
4190   other protocols &SHOULD; ensure that any Date header field present in a
4191   message conforms to one of the HTTP/1.1 formats and rewrite the date
4192   if necessary.
4193</t>
4194</section>
4195
4196<section title="Compatibility with Previous Versions" anchor="compatibility">
4197<t>
4198   It is beyond the scope of a protocol specification to mandate
4199   compliance with previous versions. HTTP/1.1 was deliberately
4200   designed, however, to make supporting previous versions easy. It is
4201   worth noting that, at the time of composing this specification
4202   (1996), we would expect commercial HTTP/1.1 servers to:
4203  <list style="symbols">
4204     <t>recognize the format of the Request-Line for HTTP/0.9, 1.0, and
4205        1.1 requests;</t>
4206
4207     <t>understand any valid request in the format of HTTP/0.9, 1.0, or
4208        1.1;</t>
4209
4210     <t>respond appropriately with a message in the same major version
4211        used by the client.</t>
4212  </list>
4213</t>
4214<t>
4215   And we would expect HTTP/1.1 clients to:
4216  <list style="symbols">
4217     <t>recognize the format of the Status-Line for HTTP/1.0 and 1.1
4218        responses;</t>
4219
4220     <t>understand any valid response in the format of HTTP/0.9, 1.0, or
4221        1.1.</t>
4222  </list>
4223</t>
4224<t>
4225   For most implementations of HTTP/1.0, each connection is established
4226   by the client prior to the request and closed by the server after
4227   sending the response. Some implementations implement the Keep-Alive
4228   version of persistent connections described in <xref x:sec="19.7.1" x:fmt="of" target="RFC2068"/>.
4229</t>
4230
4231<section title="Changes from HTTP/1.0" anchor="changes.from.1.0">
4232<t>
4233   This section summarizes major differences between versions HTTP/1.0
4234   and HTTP/1.1.
4235</t>
4236
4237<section title="Changes to Simplify Multi-homed Web Servers and Conserve IP Addresses" anchor="changes.to.simplify.multi-homed.web.servers.and.conserve.ip.addresses">
4238<t>
4239   The requirements that clients and servers support the Host request-header,
4240   report an error if the Host request-header (<xref target="header.host"/>) is
4241   missing from an HTTP/1.1 request, and accept absolute URIs (<xref target="request-uri"/>)
4242   are among the most important changes defined by this
4243   specification.
4244</t>
4245<t>
4246   Older HTTP/1.0 clients assumed a one-to-one relationship of IP
4247   addresses and servers; there was no other established mechanism for
4248   distinguishing the intended server of a request than the IP address
4249   to which that request was directed. The changes outlined above will
4250   allow the Internet, once older HTTP clients are no longer common, to
4251   support multiple Web sites from a single IP address, greatly
4252   simplifying large operational Web servers, where allocation of many
4253   IP addresses to a single host has created serious problems. The
4254   Internet will also be able to recover the IP addresses that have been
4255   allocated for the sole purpose of allowing special-purpose domain
4256   names to be used in root-level HTTP URLs. Given the rate of growth of
4257   the Web, and the number of servers already deployed, it is extremely
4258   important that all implementations of HTTP (including updates to
4259   existing HTTP/1.0 applications) correctly implement these
4260   requirements:
4261  <list style="symbols">
4262     <t>Both clients and servers &MUST; support the Host request-header.</t>
4263
4264     <t>A client that sends an HTTP/1.1 request &MUST; send a Host header.</t>
4265
4266     <t>Servers &MUST; report a 400 (Bad Request) error if an HTTP/1.1
4267        request does not include a Host request-header.</t>
4268
4269     <t>Servers &MUST; accept absolute URIs.</t>
4270  </list>
4271</t>
4272</section>
4273</section>
4274
4275<section title="Compatibility with HTTP/1.0 Persistent Connections" anchor="compatibility.with.http.1.0.persistent.connections">
4276<t>
4277   Some clients and servers might wish to be compatible with some
4278   previous implementations of persistent connections in HTTP/1.0
4279   clients and servers. Persistent connections in HTTP/1.0 are
4280   explicitly negotiated as they are not the default behavior. HTTP/1.0
4281   experimental implementations of persistent connections are faulty,
4282   and the new facilities in HTTP/1.1 are designed to rectify these
4283   problems. The problem was that some existing 1.0 clients may be
4284   sending Keep-Alive to a proxy server that doesn't understand
4285   Connection, which would then erroneously forward it to the next
4286   inbound server, which would establish the Keep-Alive connection and
4287   result in a hung HTTP/1.0 proxy waiting for the close on the
4288   response. The result is that HTTP/1.0 clients must be prevented from
4289   using Keep-Alive when talking to proxies.
4290</t>
4291<t>
4292   However, talking to proxies is the most important use of persistent
4293   connections, so that prohibition is clearly unacceptable. Therefore,
4294   we need some other mechanism for indicating a persistent connection
4295   is desired, which is safe to use even when talking to an old proxy
4296   that ignores Connection. Persistent connections are the default for
4297   HTTP/1.1 messages; we introduce a new keyword (Connection: close) for
4298   declaring non-persistence. See <xref target="header.connection"/>.
4299</t>
4300<t>
4301   The original HTTP/1.0 form of persistent connections (the Connection:
4302   Keep-Alive and Keep-Alive header) is documented in <xref target="RFC2068"/>.
4303</t>
4304</section>
4305
4306<section title="Changes from RFC 2068" anchor="changes.from.rfc.2068">
4307<t>
4308   This specification has been carefully audited to correct and
4309   disambiguate key word usage; RFC 2068 had many problems in respect to
4310   the conventions laid out in <xref target="RFC2119"/>.
4311</t>
4312<t>
4313   Transfer-coding and message lengths all interact in ways that
4314   required fixing exactly when chunked encoding is used (to allow for
4315   transfer encoding that may not be self delimiting); it was important
4316   to straighten out exactly how message lengths are computed. (Sections
4317   <xref target="transfer.codings" format="counter"/>, <xref target="message.length" format="counter"/>,
4318   <xref target="header.content-length" format="counter"/>,
4319   see also <xref target="Part3"/>, <xref target="Part5"/> and <xref target="Part6"/>)
4320</t>
4321<t>
4322   The use and interpretation of HTTP version numbers has been clarified
4323   by <xref target="RFC2145"/>. Require proxies to upgrade requests to highest protocol
4324   version they support to deal with problems discovered in HTTP/1.0
4325   implementations (<xref target="http.version"/>)
4326</t>
4327<t>
4328   Transfer-coding had significant problems, particularly with
4329   interactions with chunked encoding. The solution is that transfer-codings
4330   become as full fledged as content-codings. This involves
4331   adding an IANA registry for transfer-codings (separate from content
4332   codings), a new header field (TE) and enabling trailer headers in the
4333   future. Transfer encoding is a major performance benefit, so it was
4334   worth fixing <xref target="Nie1997"/>. TE also solves another, obscure, downward
4335   interoperability problem that could have occurred due to interactions
4336   between authentication trailers, chunked encoding and HTTP/1.0
4337   clients.(Section <xref target="transfer.codings" format="counter"/>, <xref target="chunked.transfer.encoding" format="counter"/>,
4338   and <xref target="header.te" format="counter"/>)
4339</t>
4340</section>
4341
4342<section title="Changes from RFC 2616" anchor="changes.from.rfc.2616">
4343<t>
4344  The CHAR rule does not allow the NUL character anymore (this affects
4345  the comment and quoted-string rules).  Furthermore, the quoted-pair
4346  rule does not allow escaping NUL, CR or LF anymore.
4347  (<xref target="basic.rules"/>)
4348</t>
4349<t>
4350  Clarify that HTTP-Version is case sensitive.
4351  (<xref target="http.version"/>)
4352</t>
4353<t>
4354  Remove reference to non-existant identity transfer-coding value tokens.
4355  (Sections <xref format="counter" target="transfer.codings"/> and
4356  <xref format="counter" target="message.length"/>)
4357</t>
4358<t>
4359  Clarification that the chunk length does not include
4360  the count of the octets in the chunk header and trailer.
4361  (<xref target="chunked.transfer.encoding"/>)
4362</t>
4363<t>
4364  Fix BNF to add query, as the abs_path production in
4365  <xref x:sec="3" x:fmt="of" target="RFC2396"/> doesn't define it.
4366  (<xref target="request-uri"/>)
4367</t>
4368<t>
4369  Clarify exactly when close connection options must be sent.
4370  (<xref target="header.connection"/>)
4371</t>
4372</section>
4373</section>
4374
4375<section title="Change Log (to be removed by RFC Editor before publication)" anchor="change.log">
4376
4377<section title="Since RFC2616">
4378<t>
4379  Extracted relevant partitions from <xref target="RFC2616"/>.
4380</t>
4381</section>
4382
4383<section title="Since draft-ietf-httpbis-p1-messaging-00">
4384<t>
4385  Closed issues:
4386  <list style="symbols">
4387    <t>
4388      <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/1"/>:
4389      "HTTP Version should be case sensitive"
4390      (<eref target="http://purl.org/NET/http-errata#verscase"/>)
4391    </t>
4392    <t>
4393      <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/2"/>:
4394      "'unsafe' characters"
4395      (<eref target="http://purl.org/NET/http-errata#unsafe-uri"/>)
4396    </t>
4397    <t>
4398      <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/3"/>:
4399      "Chunk Size Definition"
4400      (<eref target="http://purl.org/NET/http-errata#chunk-size"/>)
4401    </t>
4402    <t>
4403      <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/4"/>:
4404      "Message Length"
4405      (<eref target="http://purl.org/NET/http-errata#msg-len-chars"/>)
4406    </t>
4407    <t>
4408      <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/8"/>:
4409      "Media Type Registrations"
4410      (<eref target="http://purl.org/NET/http-errata#media-reg"/>)
4411    </t>
4412    <t>
4413      <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/11"/>:
4414      "URI includes query"
4415      (<eref target="http://purl.org/NET/http-errata#uriquery"/>)
4416    </t>
4417    <t>
4418      <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/15"/>:
4419      "No close on 1xx responses"
4420      (<eref target="http://purl.org/NET/http-errata#noclose1xx"/>)
4421    </t>
4422    <t>
4423      <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/16"/>:
4424      "Remove 'identity' token references"
4425      (<eref target="http://purl.org/NET/http-errata#identity"/>)
4426    </t>
4427    <t>
4428      <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/26"/>:
4429      "Import query BNF"
4430    </t>
4431    <t>
4432      <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/31"/>:
4433      "qdtext BNF"
4434    </t>
4435    <t>
4436      <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/35"/>:
4437      "Normative and Informative references"
4438    </t>
4439    <t>
4440      <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/42"/>:
4441      "RFC2606 Compliance"
4442    </t>
4443    <t>
4444      <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/45"/>:
4445      "RFC977 reference"
4446    </t>
4447    <t>
4448      <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/46"/>:
4449      "RFC1700 references"
4450    </t>
4451    <t>
4452      <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/47"/>:
4453      "inconsistency in date format explanation"
4454    </t>
4455    <t>
4456      <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/48"/>:
4457      "Date reference typo"
4458    </t>
4459    <t>
4460      <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/65"/>:
4461      "Informative references"
4462    </t>
4463    <t>
4464      <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/66"/>:
4465      "ISO-8859-1 Reference"
4466    </t>
4467    <t>
4468      <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/86"/>:
4469      "Normative up-to-date references"
4470    </t>
4471  </list>
4472</t>
4473<t>
4474  Other changes:
4475  <list style="symbols">
4476    <t>
4477      Update media type registrations to use RFC4288 template.
4478    </t>
4479    <t>
4480      Use names of RFC4234 core rules DQUOTE and HTAB,
4481      fix broken ABNF for chunk-data
4482      (work in progress on <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/36"/>)
4483    </t>
4484  </list>
4485</t>
4486</section>
4487
4488<section title="Since draft-ietf-httpbis-p1-messaging-01">
4489<t>
4490  Closed issues:
4491  <list style="symbols">
4492    <t>
4493      <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/19"/>:
4494      "Bodies on GET (and other) requests"
4495    </t>
4496    <t>
4497      <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/55"/>:
4498      "Updating to RFC4288"
4499    </t>
4500    <t>
4501      <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/57"/>:
4502      "Status Code and Reason Phrase"
4503    </t>
4504    <t>
4505      <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/82"/>:
4506      "rel_path not used"
4507    </t>
4508  </list>
4509</t>
4510<t>
4511  Ongoing work on ABNF conversion (<eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/36"/>):
4512  <list style="symbols">
4513    <t>
4514      Get rid of duplicate BNF rule names ("host" -> "uri-host", "trailer" ->
4515      "trailer-part").
4516    </t>
4517    <t>
4518      Avoid underscore character in rule names ("http_URL" ->
4519      "http-URL", "abs_path" -> "path-absolute").
4520    </t>
4521    <t>
4522      Add rules for terms imported from URI spec ("absoluteURI", "authority",
4523      "path-absolute", "port", "query", "relativeURI", "host) -- these will
4524      have to be updated when switching over to RFC3986.
4525    </t>
4526    <t>
4527      Synchronize core rules with RFC5234 (this includes a change to CHAR
4528      which now excludes NUL).
4529    </t>
4530    <t>
4531      Get rid of prose rules that span multiple lines.
4532    </t>
4533    <t>
4534      Get rid of unused rules LOALPHA and UPALPHA.
4535    </t>
4536    <t>
4537      Move "Product Tokens" section (back) into Part 1, as "token" is used
4538      in the definition of the Upgrade header.
4539    </t>
4540    <t>
4541      Add explicit references to BNF syntax and rules imported from other parts of the specification.
4542    </t>
4543    <t>
4544      Rewrite prose rule "token" in terms of "tchar", rewrite prose rule "TEXT".
4545    </t>
4546  </list>
4547</t>
4548</section>
4549
4550<section title="Since draft-ietf-httpbis-p1-messaging-02" anchor="changes.since.02">
4551<t>
4552  Closed issues:
4553  <list style="symbols">
4554    <t>
4555      <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/51"/>:
4556      "HTTP-date vs. rfc1123-date"
4557    </t>
4558    <t>
4559      <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/64"/>:
4560      "WS in quoted-pair"
4561    </t>
4562  </list>
4563</t>
4564<t>
4565  Ongoing work on IANA Message Header Registration (<eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/40"/>):
4566  <list style="symbols">
4567    <t>
4568      Reference RFC 3984, and update header registrations for headers defined
4569      in this document.
4570    </t>
4571  </list>
4572</t>
4573<t>
4574  Ongoing work on ABNF conversion (<eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/36"/>):
4575  <list style="symbols">
4576    <t>
4577      Replace string literals when the string really is case-sensitive (HTTP-Version).
4578    </t>
4579  </list>
4580</t>
4581</section>
4582
4583<section title="Since draft-ietf-httpbis-p1-messaging-03" anchor="changes.since.03">
4584<t>
4585  Closed issues:
4586  <list style="symbols">
4587    <t>
4588      <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/28"/>:
4589      "Connection closing"
4590    </t>
4591    <t>
4592      <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/97"/>:
4593      "Move registrations and registry information to IANA Considerations"
4594    </t>
4595    <t>
4596      <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/120"/>:
4597      "need new URL for PAD1995 reference"
4598    </t>
4599    <t>
4600      <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/127"/>:
4601      "IANA Considerations: update HTTP URI scheme registration"
4602    </t>
4603  </list>
4604</t>
4605<t>
4606  Ongoing work on ABNF conversion (<eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/36"/>):
4607  <list style="symbols">
4608    <t>
4609      Replace string literals when the string really is case-sensitive (HTTP-Date).
4610    </t>
4611    <t>
4612      Replace HEX by HEXDIG for future consistence with RFC 5234's core rules.
4613    </t>
4614  </list>
4615</t>
4616</section>
4617
4618</section>
4619
4620</back>
4621</rfc>
Note: See TracBrowser for help on using the repository browser.