source: draft-ietf-httpbis/latest/p3-payload.xml @ 205

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

Add sections that for now normatively reference the ABNF syntax and basic rules from Part1, also start work on referencing ABNF rules adopted from other parts (ongoing); relates to #36.

  • Property svn:eol-style set to native
File size: 107.1 KB
1<?xml version="1.0" encoding="utf-8"?>
2<?xml-stylesheet type='text/xsl' href='../myxml2rfc.xslt'?>
3<!DOCTYPE rfc [
4  <!ENTITY MAY "<bcp14 xmlns=''>MAY</bcp14>">
5  <!ENTITY MUST "<bcp14 xmlns=''>MUST</bcp14>">
6  <!ENTITY MUST-NOT "<bcp14 xmlns=''>MUST NOT</bcp14>">
7  <!ENTITY OPTIONAL "<bcp14 xmlns=''>OPTIONAL</bcp14>">
8  <!ENTITY RECOMMENDED "<bcp14 xmlns=''>RECOMMENDED</bcp14>">
9  <!ENTITY REQUIRED "<bcp14 xmlns=''>REQUIRED</bcp14>">
10  <!ENTITY SHALL "<bcp14 xmlns=''>SHALL</bcp14>">
11  <!ENTITY SHALL-NOT "<bcp14 xmlns=''>SHALL NOT</bcp14>">
12  <!ENTITY SHOULD "<bcp14 xmlns=''>SHOULD</bcp14>">
13  <!ENTITY SHOULD-NOT "<bcp14 xmlns=''>SHOULD NOT</bcp14>">
14  <!ENTITY ID-VERSION "latest">
15  <!ENTITY ID-MONTH "February">
16  <!ENTITY ID-YEAR "2008">
17  <!ENTITY notation-abnf            "<xref target='Part1' x:rel='#notation.abnf' xmlns:x=''/>">
18  <!ENTITY basic-rules              "<xref target='Part1' x:rel='#basic.rules' xmlns:x=''/>">
19  <!ENTITY caching-neg-resp         "<xref target='Part6' x:rel='#caching.negotiated.responses' xmlns:x=''/>">
20  <!ENTITY header-transfer-encoding "<xref target='Part1' x:rel='#header.transfer-encoding' xmlns:x=''/>">
21  <!ENTITY header-allow             "<xref target='Part2' x:rel='#header.allow' xmlns:x=''/>">
22  <!ENTITY header-content-length    "<xref target='Part1' x:rel='#header.content-length' xmlns:x=''/>">
23  <!ENTITY header-content-range     "<xref target='Part5' x:rel='#header.content-range' xmlns:x=''/>">
24  <!ENTITY header-expires           "<xref target='Part6' x:rel='#header.expires' xmlns:x=''/>">
25  <!ENTITY header-last-modified     "<xref target='Part4' x:rel='#header.last-modified' xmlns:x=''/>">
26  <!ENTITY header-user-agent        "<xref target='Part2' x:rel='#header.user-agent' xmlns:x=''/>">
27  <!ENTITY header-vary              "<xref target='Part6' x:rel='#header.vary' xmlns:x=''/>">
28  <!ENTITY message-body             "<xref target='Part1' x:rel='#message.body' xmlns:x=''/>">
29  <!ENTITY message-length           "<xref target='Part1' x:rel='#message.length' xmlns:x=''/>">
30  <!ENTITY multipart-byteranges     "<xref target='Part5' x:rel='' xmlns:x=''/>">
32<?rfc toc="yes" ?>
33<?rfc symrefs="yes" ?>
34<?rfc sortrefs="yes" ?>
35<?rfc compact="yes"?>
36<?rfc subcompact="no" ?>
37<?rfc linkmailto="no" ?>
38<?rfc editing="no" ?>
39<?rfc comments="yes"?>
40<?rfc inline="yes"?>
41<?rfc-ext allow-markup-in-artwork="yes" ?>
42<?rfc-ext include-references-in-index="yes" ?>
43<rfc obsoletes="2616" category="std"
44     ipr="full3978" docName="draft-ietf-httpbis-p3-payload-&ID-VERSION;"
45     xmlns:x=''>
48  <title abbrev="HTTP/1.1, Part 3">HTTP/1.1, part 3: Message Payload and Content Negotiation</title>
50  <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
51    <organization abbrev="Day Software">Day Software</organization>
52    <address>
53      <postal>
54        <street>23 Corporate Plaza DR, Suite 280</street>
55        <city>Newport Beach</city>
56        <region>CA</region>
57        <code>92660</code>
58        <country>USA</country>
59      </postal>
60      <phone>+1-949-706-5300</phone>
61      <facsimile>+1-949-706-5305</facsimile>
62      <email></email>
63      <uri></uri>
64    </address>
65  </author>
67  <author initials="J." surname="Gettys" fullname="Jim Gettys">
68    <organization>One Laptop per Child</organization>
69    <address>
70      <postal>
71        <street>21 Oak Knoll Road</street>
72        <city>Carlisle</city>
73        <region>MA</region>
74        <code>01741</code>
75        <country>USA</country>
76      </postal>
77      <email></email>
78      <uri></uri>
79    </address>
80  </author>
82  <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
83    <organization abbrev="HP">Hewlett-Packard Company</organization>
84    <address>
85      <postal>
86        <street>HP Labs, Large Scale Systems Group</street>
87        <street>1501 Page Mill Road, MS 1177</street>
88        <city>Palo Alto</city>
89        <region>CA</region>
90        <code>94304</code>
91        <country>USA</country>
92      </postal>
93      <email></email>
94    </address>
95  </author>
97  <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
98    <organization abbrev="Microsoft">Microsoft Corporation</organization>
99    <address>
100      <postal>
101        <street>1 Microsoft Way</street>
102        <city>Redmond</city>
103        <region>WA</region>
104        <code>98052</code>
105        <country>USA</country>
106      </postal>
107      <email></email>
108    </address>
109  </author>
111  <author initials="L." surname="Masinter" fullname="Larry Masinter">
112    <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
113    <address>
114      <postal>
115        <street>345 Park Ave</street>
116        <city>San Jose</city>
117        <region>CA</region>
118        <code>95110</code>
119        <country>USA</country>
120      </postal>
121      <email></email>
122      <uri></uri>
123    </address>
124  </author>
126  <author initials="P." surname="Leach" fullname="Paul J. Leach">
127    <organization abbrev="Microsoft">Microsoft Corporation</organization>
128    <address>
129      <postal>
130        <street>1 Microsoft Way</street>
131        <city>Redmond</city>
132        <region>WA</region>
133        <code>98052</code>
134      </postal>
135      <email></email>
136    </address>
137  </author>
139  <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
140    <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
141    <address>
142      <postal>
143        <street>MIT Computer Science and Artificial Intelligence Laboratory</street>
144        <street>The Stata Center, Building 32</street>
145        <street>32 Vassar Street</street>
146        <city>Cambridge</city>
147        <region>MA</region>
148        <code>02139</code>
149        <country>USA</country>
150      </postal>
151      <email></email>
152      <uri></uri>
153    </address>
154  </author>
156  <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
157    <organization abbrev="W3C">World Wide Web Consortium</organization>
158    <address>
159      <postal>
160        <street>W3C / ERCIM</street>
161        <street>2004, rte des Lucioles</street>
162        <city>Sophia-Antipolis</city>
163        <region>AM</region>
164        <code>06902</code>
165        <country>France</country>
166      </postal>
167      <email></email>
168      <uri></uri>
169    </address>
170  </author>
172  <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
173    <organization abbrev="greenbytes">greenbytes GmbH</organization>
174    <address>
175      <postal>
176        <street>Hafenweg 16</street>
177        <city>Muenster</city><region>NW</region><code>48155</code>
178        <country>Germany</country>
179      </postal>
180      <phone>+49 251 2807760</phone>   
181      <facsimile>+49 251 2807761</facsimile>   
182      <email></email>       
183      <uri></uri>     
184    </address>
185  </author>
187  <date month="&ID-MONTH;" year="&ID-YEAR;"/>
191   The Hypertext Transfer Protocol (HTTP) is an application-level
192   protocol for distributed, collaborative, hypermedia information
193   systems. HTTP has been in use by the World Wide Web global information
194   initiative since 1990. This document is Part 3 of the seven-part specification
195   that defines the protocol referred to as "HTTP/1.1" and, taken together,
196   obsoletes RFC 2616.  Part 3 defines HTTP message content,
197   metadata, and content negotiation.
201<note title="Editorial Note (To be removed by RFC Editor)">
202  <t>
203    Discussion of this draft should take place on the HTTPBIS working group
204    mailing list ( The current issues list is
205    at <eref target=""/>
206    and related documents (including fancy diffs) can be found at
207    <eref target=""/>.
208  </t>
209  <t>
210    This draft incorporates those issue resolutions that were either
211    collected in the original RFC2616 errata list (<eref target=""/>),
212    or which were agreed upon on the mailing list between October 2006 and
213    November 2007 (as published in "draft-lafon-rfc2616bis-03").
214  </t>
218<section title="Introduction" anchor="introduction">
220   This document defines HTTP/1.1 message payloads (a.k.a., content), the
221   associated metadata header fields that define how the payload is intended
222   to be interpreted by a recipient, the request header fields that
223   may influence content selection, and the various selection algorithms
224   that are collectively referred to as HTTP content negotiation.
227   This document is currently disorganized in order to minimize the changes
228   between drafts and enable reviewers to see the smaller errata changes.
229   The next draft will reorganize the sections to better reflect the content.
230   In particular, the sections on entities will be renamed payload and moved
231   to the first half of the document, while the sections on content negotiation
232   and associated request header fields will be moved to the second half.  The
233   current mess reflects how widely dispersed these topics and associated
234   requirements had become in <xref target="RFC2616"/>.
237<section title="Requirements" anchor="intro.requirements">
239   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
240   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
241   document are to be interpreted as described in <xref target="RFC2119"/>.
244   An implementation is not compliant if it fails to satisfy one or more
245   of the &MUST; or &REQUIRED; level requirements for the protocols it
246   implements. An implementation that satisfies all the &MUST; or &REQUIRED;
247   level and all the &SHOULD; level requirements for its protocols is said
248   to be "unconditionally compliant"; one that satisfies all the &MUST;
249   level requirements but not all the &SHOULD; level requirements for its
250   protocols is said to be "conditionally compliant."
255<section title="Notational Conventions and Generic Grammar" anchor="notation">
257  This specification uses the ABNF syntax defined in &notation-abnf; and
258  the core rules defined in &basic-rules;:
259  <cref anchor="abnf.dep">ABNF syntax and basic rules will be adopted from RFC 5234, see
260  <eref target=""/>.</cref>
262<figure><artwork type="abnf2616">
263  ALPHA         = &lt;ALPHA, defined in &basic-rules;&gt;
264  DIGIT         = &lt;DIGIT, defined in &basic-rules;&gt;
265  OCTET         = &lt;OCTET, defined in &basic-rules;&gt;
267<figure><artwork type="abnf2616">
268  quoted-string = &lt;quoted-string, defined in &basic-rules;&gt;
269  token         = &lt;token, defined in &basic-rules;&gt;
273<section title="Protocol Parameters" anchor="protocol.parameters">
275<section title="Character Sets" anchor="character.sets">
277   HTTP uses the same definition of the term "character set" as that
278   described for MIME:
281   The term "character set" is used in this document to refer to a
282   method used with one or more tables to convert a sequence of octets
283   into a sequence of characters. Note that unconditional conversion in
284   the other direction is not required, in that not all characters may
285   be available in a given character set and a character set may provide
286   more than one sequence of octets to represent a particular character.
287   This definition is intended to allow various kinds of character
288   encoding, from simple single-table mappings such as US-ASCII to
289   complex table switching methods such as those that use ISO-2022's
290   techniques. However, the definition associated with a MIME character
291   set name &MUST; fully specify the mapping to be performed from octets
292   to characters. In particular, use of external profiling information
293   to determine the exact mapping is not permitted.
296      <x:h>Note:</x:h> This use of the term "character set" is more commonly
297      referred to as a "character encoding." However, since HTTP and
298      MIME share the same registry, it is important that the terminology
299      also be shared.
302   HTTP character sets are identified by case-insensitive tokens. The
303   complete set of tokens is defined by the IANA Character Set registry
304   (<eref target=""/>).
306<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="charset"/>
307  charset = token
310   Although HTTP allows an arbitrary token to be used as a charset
311   value, any token that has a predefined value within the IANA
312   Character Set registry &MUST; represent the character set defined
313   by that registry. Applications &SHOULD; limit their use of character
314   sets to those defined by the IANA registry.
317   HTTP uses charset in two contexts: within an Accept-Charset request
318   header (in which the charset value is an unquoted token) and as the
319   value of a parameter in a Content-Type header (within a request or
320   response), in which case the parameter value of the charset parameter
321   may be quoted.
324   Implementors should be aware of IETF character set requirements <xref target="RFC3629"/>
325   <xref target="RFC2277"/>.
328<section title="Missing Charset" anchor="missing.charset">
330   Some HTTP/1.0 software has interpreted a Content-Type header without
331   charset parameter incorrectly to mean "recipient should guess."
332   Senders wishing to defeat this behavior &MAY; include a charset
333   parameter even when the charset is ISO-8859-1 (<xref target="ISO-8859-1"/>) and &SHOULD; do so when
334   it is known that it will not confuse the recipient.
337   Unfortunately, some older HTTP/1.0 clients did not deal properly with
338   an explicit charset parameter. HTTP/1.1 recipients &MUST; respect the
339   charset label provided by the sender; and those user agents that have
340   a provision to "guess" a charset &MUST; use the charset from the
341   content-type field if they support that charset, rather than the
342   recipient's preference, when initially displaying a document. See
343   <xref target="canonicalization.and.text.defaults"/>.
348<section title="Content Codings" anchor="content.codings">
350   Content coding values indicate an encoding transformation that has
351   been or can be applied to an entity. Content codings are primarily
352   used to allow a document to be compressed or otherwise usefully
353   transformed without losing the identity of its underlying media type
354   and without loss of information. Frequently, the entity is stored in
355   coded form, transmitted directly, and only decoded by the recipient.
357<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="content-coding"/>
358  content-coding   = token
361   All content-coding values are case-insensitive. HTTP/1.1 uses
362   content-coding values in the Accept-Encoding (<xref target="header.accept-encoding"/>) and
363   Content-Encoding (<xref target="header.content-encoding"/>) header fields. Although the value
364   describes the content-coding, what is more important is that it
365   indicates what decoding mechanism will be required to remove the
366   encoding.
369   The Internet Assigned Numbers Authority (IANA) acts as a registry for
370   content-coding value tokens. Initially, the registry contains the
371   following tokens:
374   gzip<iref item="gzip"/>
375  <list>
376    <t>
377        An encoding format produced by the file compression program
378        "gzip" (GNU zip) as described in <xref target="RFC1952"/>. This format is a
379        Lempel-Ziv coding (LZ77) with a 32 bit CRC.
380    </t>
381  </list>
384   compress<iref item="compress"/>
385  <list><t>
386        The encoding format produced by the common UNIX file compression
387        program "compress". This format is an adaptive Lempel-Ziv-Welch
388        coding (LZW).
390        Use of program names for the identification of encoding formats
391        is not desirable and is discouraged for future encodings. Their
392        use here is representative of historical practice, not good
393        design. For compatibility with previous implementations of HTTP,
394        applications &SHOULD; consider "x-gzip" and "x-compress" to be
395        equivalent to "gzip" and "compress" respectively.
396  </t></list>
399   deflate<iref item="deflate"/>
400  <list><t>
401        The "zlib" format defined in <xref target="RFC1950"/> in combination with
402        the "deflate" compression mechanism described in <xref target="RFC1951"/>.
403  </t></list>
406   identity<iref item="identity"/>
407  <list><t>
408        The default (identity) encoding; the use of no transformation
409        whatsoever. This content-coding is used only in the Accept-Encoding
410        header, and &SHOULD-NOT;  be used in the Content-Encoding
411        header.
412  </t></list>
415   New content-coding value tokens &SHOULD; be registered; to allow
416   interoperability between clients and servers, specifications of the
417   content coding algorithms needed to implement a new value &SHOULD; be
418   publicly available and adequate for independent implementation, and
419   conform to the purpose of content coding defined in this section.
423<section title="Media Types" anchor="media.types">
425   HTTP uses Internet Media Types <xref target="RFC2046"/> in the Content-Type (<xref target="header.content-type"/>)
426   and Accept (<xref target="header.accept"/>) header fields in order to provide
427   open and extensible data typing and type negotiation.
429<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="media-type"/><iref primary="true" item="Grammar" subitem="type"/><iref primary="true" item="Grammar" subitem="subtype"/>
430  media-type     = type "/" subtype *( ";" parameter )
431  type           = token
432  subtype        = token
435   Parameters &MAY; follow the type/subtype in the form of attribute/value
436   pairs.
438<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"/>
439  parameter               = attribute "=" value
440  attribute               = token
441  value                   = token | quoted-string
444   The type, subtype, and parameter attribute names are case-insensitive.
445   Parameter values might or might not be case-sensitive,
446   depending on the semantics of the parameter name. Linear white space
447   (LWS) &MUST-NOT; be used between the type and subtype, nor between an
448   attribute and its value. The presence or absence of a parameter might
449   be significant to the processing of a media-type, depending on its
450   definition within the media type registry.
453   Note that some older HTTP applications do not recognize media type
454   parameters. When sending data to older HTTP applications,
455   implementations &SHOULD; only use media type parameters when they are
456   required by that type/subtype definition.
459   Media-type values are registered with the Internet Assigned Number
460   Authority (IANA). The media type registration process is
461   outlined in <xref target="RFC4288"/>. Use of non-registered media types is
462   discouraged.
465<section title="Canonicalization and Text Defaults" anchor="canonicalization.and.text.defaults">
467   Internet media types are registered with a canonical form. An
468   entity-body transferred via HTTP messages &MUST; be represented in the
469   appropriate canonical form prior to its transmission except for
470   "text" types, as defined in the next paragraph.
473   When in canonical form, media subtypes of the "text" type use CRLF as
474   the text line break. HTTP relaxes this requirement and allows the
475   transport of text media with plain CR or LF alone representing a line
476   break when it is done consistently for an entire entity-body. HTTP
477   applications &MUST; accept CRLF, bare CR, and bare LF as being
478   representative of a line break in text media received via HTTP. In
479   addition, if the text is represented in a character set that does not
480   use octets 13 and 10 for CR and LF respectively, as is the case for
481   some multi-byte character sets, HTTP allows the use of whatever octet
482   sequences are defined by that character set to represent the
483   equivalent of CR and LF for line breaks. This flexibility regarding
484   line breaks applies only to text media in the entity-body; a bare CR
485   or LF &MUST-NOT; be substituted for CRLF within any of the HTTP control
486   structures (such as header fields and multipart boundaries).
489   If an entity-body is encoded with a content-coding, the underlying
490   data &MUST; be in a form defined above prior to being encoded.
493   The "charset" parameter is used with some media types to define the
494   character set (<xref target="character.sets"/>) of the data. When no explicit charset
495   parameter is provided by the sender, media subtypes of the "text"
496   type are defined to have a default charset value of "ISO-8859-1" when
497   received via HTTP. Data in character sets other than "ISO-8859-1" or
498   its subsets &MUST; be labeled with an appropriate charset value. See
499   <xref target="missing.charset"/> for compatibility problems.
503<section title="Multipart Types" anchor="multipart.types">
505   MIME provides for a number of "multipart" types -- encapsulations of
506   one or more entities within a single message-body. All multipart
507   types share a common syntax, as defined in <xref target="RFC2046" x:sec="5.1.1" x:fmt="of"/>,
508   and &MUST; include a boundary parameter as part of the media type
509   value. The message body is itself a protocol element and &MUST;
510   therefore use only CRLF to represent line breaks between body-parts.
511   Unlike in RFC 2046, the epilogue of any multipart message &MUST; be
512   empty; HTTP applications &MUST-NOT; transmit the epilogue (even if the
513   original multipart contains an epilogue). These restrictions exist in
514   order to preserve the self-delimiting nature of a multipart message-body,
515   wherein the "end" of the message-body is indicated by the
516   ending multipart boundary.
519   In general, HTTP treats a multipart message-body no differently than
520   any other media type: strictly as payload. The one exception is the
521   "multipart/byteranges" type (&multipart-byteranges;) when it appears in a 206
522   (Partial Content) response.
523   <!-- jre: re-insert removed text pointing to caching? -->
524   In all
525   other cases, an HTTP user agent &SHOULD; follow the same or similar
526   behavior as a MIME user agent would upon receipt of a multipart type.
527   The MIME header fields within each body-part of a multipart message-body
528   do not have any significance to HTTP beyond that defined by
529   their MIME semantics.
532   In general, an HTTP user agent &SHOULD; follow the same or similar
533   behavior as a MIME user agent would upon receipt of a multipart type.
534   If an application receives an unrecognized multipart subtype, the
535   application &MUST; treat it as being equivalent to "multipart/mixed".
538      <x:h>Note:</x:h> The "multipart/form-data" type has been specifically defined
539      for carrying form data suitable for processing via the POST
540      request method, as described in <xref target="RFC2388"/>.
545<section title="Quality Values" anchor="quality.values">
547   HTTP content negotiation (<xref target="content.negotiation"/>) uses short "floating point"
548   numbers to indicate the relative importance ("weight") of various
549   negotiable parameters.  A weight is normalized to a real number in
550   the range 0 through 1, where 0 is the minimum and 1 the maximum
551   value. If a parameter has a quality value of 0, then content with
552   this parameter is `not acceptable' for the client. HTTP/1.1
553   applications &MUST-NOT; generate more than three digits after the
554   decimal point. User configuration of these values &SHOULD; also be
555   limited in this fashion.
557<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="qvalue"/>
558  qvalue         = ( "0" [ "." 0*3DIGIT ] )
559                 | ( "1" [ "." 0*3("0") ] )
562   "Quality values" is a misnomer, since these values merely represent
563   relative degradation in desired quality.
567<section title="Language Tags" anchor="language.tags">
569   A language tag identifies a natural language spoken, written, or
570   otherwise conveyed by human beings for communication of information
571   to other human beings. Computer languages are explicitly excluded.
572   HTTP uses language tags within the Accept-Language and Content-Language
573   fields.
576   The syntax and registry of HTTP language tags is the same as that
577   defined by <xref target="RFC1766"/>. In summary, a language tag is composed of 1
578   or more parts: A primary language tag and a possibly empty series of
579   subtags:
581<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="language-tag"/><iref primary="true" item="Grammar" subitem="primary-tag"/><iref primary="true" item="Grammar" subitem="subtag"/>
582  language-tag  = primary-tag *( "-" subtag )
583  primary-tag   = 1*8ALPHA
584  subtag        = 1*8ALPHA
587   White space is not allowed within the tag and all tags are case-insensitive.
588   The name space of language tags is administered by the
589   IANA. Example tags include:
591<figure><artwork type="example">
592    en, en-US, en-cockney, i-cherokee, x-pig-latin
595   where any two-letter primary-tag is an ISO-639 language abbreviation
596   and any two-letter initial subtag is an ISO-3166 country code. (The
597   last three tags above are not registered tags; all but the last are
598   examples of tags which could be registered in future.)
603<section title="Entity" anchor="entity">
605   Request and Response messages &MAY; transfer an entity if not otherwise
606   restricted by the request method or response status code. An entity
607   consists of entity-header fields and an entity-body, although some
608   responses will only include the entity-headers.
611   In this section, both sender and recipient refer to either the client
612   or the server, depending on who sends and who receives the entity.
615<section title="Entity Header Fields" anchor="entity.header.fields">
617   Entity-header fields define metainformation about the entity-body or,
618   if no body is present, about the resource identified by the request.
620<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="entity-header"/><iref primary="true" item="Grammar" subitem="extension-header"/>
621  entity-header  = Allow                    ; &header-allow;
622                 | Content-Encoding         ; <xref target="header.content-encoding"/>
623                 | Content-Language         ; <xref target="header.content-language"/>
624                 | Content-Length           ; &header-content-length;
625                 | Content-Location         ; <xref target="header.content-location"/>
626                 | Content-MD5              ; <xref target="header.content-md5"/>
627                 | Content-Range            ; &header-content-range;
628                 | Content-Type             ; <xref target="header.content-type"/>
629                 | Expires                  ; &header-expires;
630                 | Last-Modified            ; &header-last-modified;
631                 | extension-header
633  extension-header = message-header
636   The extension-header mechanism allows additional entity-header fields
637   to be defined without changing the protocol, but these fields cannot
638   be assumed to be recognizable by the recipient. Unrecognized header
639   fields &SHOULD; be ignored by the recipient and &MUST; be forwarded by
640   transparent proxies.
644<section title="Entity Body" anchor="entity.body">
646   The entity-body (if any) sent with an HTTP request or response is in
647   a format and encoding defined by the entity-header fields.
649<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="entity-body"/>
650  entity-body    = *OCTET
653   An entity-body is only present in a message when a message-body is
654   present, as described in &message-body;. The entity-body is obtained
655   from the message-body by decoding any Transfer-Encoding that might
656   have been applied to ensure safe and proper transfer of the message.
659<section title="Type" anchor="type">
661   When an entity-body is included with a message, the data type of that
662   body is determined via the header fields Content-Type and Content-Encoding.
663   These define a two-layer, ordered encoding model:
665<figure><artwork type="example">
666    entity-body := Content-Encoding( Content-Type( data ) )
669   Content-Type specifies the media type of the underlying data.
670   Content-Encoding may be used to indicate any additional content
671   codings applied to the data, usually for the purpose of data
672   compression, that are a property of the requested resource. There is
673   no default encoding.
676   Any HTTP/1.1 message containing an entity-body &SHOULD; include a
677   Content-Type header field defining the media type of that body. If
678   and only if the media type is not given by a Content-Type field, the
679   recipient &MAY; attempt to guess the media type via inspection of its
680   content and/or the name extension(s) of the URI used to identify the
681   resource. If the media type remains unknown, the recipient &SHOULD;
682   treat it as type "application/octet-stream".
686<section title="Entity Length" anchor="entity.length">
688   The entity-length of a message is the length of the message-body
689   before any transfer-codings have been applied. &message-length; defines
690   how the transfer-length of a message-body is determined.
696<section title="Content Negotiation" anchor="content.negotiation">
698   Most HTTP responses include an entity which contains information for
699   interpretation by a human user. Naturally, it is desirable to supply
700   the user with the "best available" entity corresponding to the
701   request. Unfortunately for servers and caches, not all users have the
702   same preferences for what is "best," and not all user agents are
703   equally capable of rendering all entity types. For that reason, HTTP
704   has provisions for several mechanisms for "content negotiation" --
705   the process of selecting the best representation for a given response
706   when there are multiple representations available.
707  <list><t>
708      <x:h>Note:</x:h> This is not called "format negotiation" because the
709      alternate representations may be of the same media type, but use
710      different capabilities of that type, be in different languages,
711      etc.
712  </t></list>
715   Any response containing an entity-body &MAY; be subject to negotiation,
716   including error responses.
719   There are two kinds of content negotiation which are possible in
720   HTTP: server-driven and agent-driven negotiation. These two kinds of
721   negotiation are orthogonal and thus may be used separately or in
722   combination. One method of combination, referred to as transparent
723   negotiation, occurs when a cache uses the agent-driven negotiation
724   information provided by the origin server in order to provide
725   server-driven negotiation for subsequent requests.
728<section title="Server-driven Negotiation" anchor="server-driven.negotiation">
730   If the selection of the best representation for a response is made by
731   an algorithm located at the server, it is called server-driven
732   negotiation. Selection is based on the available representations of
733   the response (the dimensions over which it can vary; e.g. language,
734   content-coding, etc.) and the contents of particular header fields in
735   the request message or on other information pertaining to the request
736   (such as the network address of the client).
739   Server-driven negotiation is advantageous when the algorithm for
740   selecting from among the available representations is difficult to
741   describe to the user agent, or when the server desires to send its
742   "best guess" to the client along with the first response (hoping to
743   avoid the round-trip delay of a subsequent request if the "best
744   guess" is good enough for the user). In order to improve the server's
745   guess, the user agent &MAY; include request header fields (Accept,
746   Accept-Language, Accept-Encoding, etc.) which describe its
747   preferences for such a response.
750   Server-driven negotiation has disadvantages:
751  <list style="numbers">
752    <t>
753         It is impossible for the server to accurately determine what
754         might be "best" for any given user, since that would require
755         complete knowledge of both the capabilities of the user agent
756         and the intended use for the response (e.g., does the user want
757         to view it on screen or print it on paper?).
758    </t>
759    <t>
760         Having the user agent describe its capabilities in every
761         request can be both very inefficient (given that only a small
762         percentage of responses have multiple representations) and a
763         potential violation of the user's privacy.
764    </t>
765    <t>
766         It complicates the implementation of an origin server and the
767         algorithms for generating responses to a request.
768    </t>
769    <t>
770         It may limit a public cache's ability to use the same response
771         for multiple user's requests.
772    </t>
773  </list>
776   HTTP/1.1 includes the following request-header fields for enabling
777   server-driven negotiation through description of user agent
778   capabilities and user preferences: Accept (<xref target="header.accept"/>), Accept-Charset
779   (<xref target="header.accept-charset"/>), Accept-Encoding (<xref target="header.accept-encoding"/>), Accept-Language
780   (<xref target="header.accept-language"/>), and User-Agent (&header-user-agent;). However, an
781   origin server is not limited to these dimensions and &MAY; vary the
782   response based on any aspect of the request, including information
783   outside the request-header fields or within extension header fields
784   not defined by this specification.
787   The Vary header field (&header-vary;) can be used to express the parameters the
788   server uses to select a representation that is subject to server-driven
789   negotiation.
793<section title="Agent-driven Negotiation" anchor="agent-driven.negotiation">
795   With agent-driven negotiation, selection of the best representation
796   for a response is performed by the user agent after receiving an
797   initial response from the origin server. Selection is based on a list
798   of the available representations of the response included within the
799   header fields or entity-body of the initial response, with each
800   representation identified by its own URI. Selection from among the
801   representations may be performed automatically (if the user agent is
802   capable of doing so) or manually by the user selecting from a
803   generated (possibly hypertext) menu.
806   Agent-driven negotiation is advantageous when the response would vary
807   over commonly-used dimensions (such as type, language, or encoding),
808   when the origin server is unable to determine a user agent's
809   capabilities from examining the request, and generally when public
810   caches are used to distribute server load and reduce network usage.
813   Agent-driven negotiation suffers from the disadvantage of needing a
814   second request to obtain the best alternate representation. This
815   second request is only efficient when caching is used. In addition,
816   this specification does not define any mechanism for supporting
817   automatic selection, though it also does not prevent any such
818   mechanism from being developed as an extension and used within
819   HTTP/1.1.
822   HTTP/1.1 defines the 300 (Multiple Choices) and 406 (Not Acceptable)
823   status codes for enabling agent-driven negotiation when the server is
824   unwilling or unable to provide a varying response using server-driven
825   negotiation.
829<section title="Transparent Negotiation" anchor="transparent.negotiation">
831   Transparent negotiation is a combination of both server-driven and
832   agent-driven negotiation. When a cache is supplied with a form of the
833   list of available representations of the response (as in agent-driven
834   negotiation) and the dimensions of variance are completely understood
835   by the cache, then the cache becomes capable of performing server-driven
836   negotiation on behalf of the origin server for subsequent
837   requests on that resource.
840   Transparent negotiation has the advantage of distributing the
841   negotiation work that would otherwise be required of the origin
842   server and also removing the second request delay of agent-driven
843   negotiation when the cache is able to correctly guess the right
844   response.
847   This specification does not define any mechanism for transparent
848   negotiation, though it also does not prevent any such mechanism from
849   being developed as an extension that could be used within HTTP/1.1.
854<section title="Header Field Definitions" anchor="header.fields">
856   This section defines the syntax and semantics of HTTP/1.1 header fields
857   related to the payload of messages.
860   For entity-header fields, both sender and recipient refer to either the
861   client or the server, depending on who sends and who receives the entity.
864<section title="Accept" anchor="header.accept">
865  <iref primary="true" item="Accept header" x:for-anchor=""/>
866  <iref primary="true" item="Headers" subitem="Accept" x:for-anchor=""/>
868   The Accept request-header field can be used to specify certain media
869   types which are acceptable for the response. Accept headers can be
870   used to indicate that the request is specifically limited to a small
871   set of desired types, as in the case of a request for an in-line
872   image.
874<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Accept"/><iref primary="true" item="Grammar" subitem="media-range"/><iref primary="true" item="Grammar" subitem="accept-params"/><iref primary="true" item="Grammar" subitem="accept-extension"/>
875  Accept         = "Accept" ":"
876                   #( media-range [ accept-params ] )
878  media-range    = ( "*/*"
879                   | ( type "/" "*" )
880                   | ( type "/" subtype )
881                   ) *( ";" parameter )
882  accept-params  = ";" "q" "=" qvalue *( accept-extension )
883  accept-extension = ";" token [ "=" ( token | quoted-string ) ]
886   The asterisk "*" character is used to group media types into ranges,
887   with "*/*" indicating all media types and "type/*" indicating all
888   subtypes of that type. The media-range &MAY; include media type
889   parameters that are applicable to that range.
892   Each media-range &MAY; be followed by one or more accept-params,
893   beginning with the "q" parameter for indicating a relative quality
894   factor. The first "q" parameter (if any) separates the media-range
895   parameter(s) from the accept-params. Quality factors allow the user
896   or user agent to indicate the relative degree of preference for that
897   media-range, using the qvalue scale from 0 to 1 (<xref target="quality.values"/>). The
898   default value is q=1.
899  <list><t>
900      <x:h>Note:</x:h> Use of the "q" parameter name to separate media type
901      parameters from Accept extension parameters is due to historical
902      practice. Although this prevents any media type parameter named
903      "q" from being used with a media range, such an event is believed
904      to be unlikely given the lack of any "q" parameters in the IANA
905      media type registry and the rare usage of any media type
906      parameters in Accept. Future media types are discouraged from
907      registering any parameter named "q".
908  </t></list>
911   The example
913<figure><artwork type="example">
914    Accept: audio/*; q=0.2, audio/basic
917   &SHOULD; be interpreted as "I prefer audio/basic, but send me any audio
918   type if it is the best available after an 80% mark-down in quality."
921   If no Accept header field is present, then it is assumed that the
922   client accepts all media types. If an Accept header field is present,
923   and if the server cannot send a response which is acceptable
924   according to the combined Accept field value, then the server &SHOULD;
925   send a 406 (Not Acceptable) response.
928   A more elaborate example is
930<figure><artwork type="example">
931    Accept: text/plain; q=0.5, text/html,
932            text/x-dvi; q=0.8, text/x-c
935   Verbally, this would be interpreted as "text/html and text/x-c are
936   the preferred media types, but if they do not exist, then send the
937   text/x-dvi entity, and if that does not exist, send the text/plain
938   entity."
941   Media ranges can be overridden by more specific media ranges or
942   specific media types. If more than one media range applies to a given
943   type, the most specific reference has precedence. For example,
945<figure><artwork type="example">
946    Accept: text/*, text/html, text/html;level=1, */*
949   have the following precedence:
951<figure><artwork type="example">
952    1) text/html;level=1
953    2) text/html
954    3) text/*
955    4) */*
958   The media type quality factor associated with a given type is
959   determined by finding the media range with the highest precedence
960   which matches that type. For example,
962<figure><artwork type="example">
963    Accept: text/*;q=0.3, text/html;q=0.7, text/html;level=1,
964            text/html;level=2;q=0.4, */*;q=0.5
967   would cause the following values to be associated:
969<figure><artwork type="example">
970    text/html;level=1         = 1
971    text/html                 = 0.7
972    text/plain                = 0.3
973    image/jpeg                = 0.5
974    text/html;level=2         = 0.4
975    text/html;level=3         = 0.7
978      <x:h>Note:</x:h> A user agent might be provided with a default set of quality
979      values for certain media ranges. However, unless the user agent is
980      a closed system which cannot interact with other rendering agents,
981      this default set ought to be configurable by the user.
985<section title="Accept-Charset" anchor="header.accept-charset">
986  <iref primary="true" item="Accept-Charset header" x:for-anchor=""/>
987  <iref primary="true" item="Headers" subitem="Accept-Charset" x:for-anchor=""/>
989   The Accept-Charset request-header field can be used to indicate what
990   character sets are acceptable for the response. This field allows
991   clients capable of understanding more comprehensive or special-purpose
992   character sets to signal that capability to a server which is
993   capable of representing documents in those character sets.
995<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Accept-Charset"/>
996  Accept-Charset = "Accept-Charset" ":"
997          1#( ( charset | "*" ) [ ";" "q" "=" qvalue ] )
1000   Character set values are described in <xref target="character.sets"/>. Each charset &MAY;
1001   be given an associated quality value which represents the user's
1002   preference for that charset. The default value is q=1. An example is
1004<figure><artwork type="example">
1005   Accept-Charset: iso-8859-5, unicode-1-1;q=0.8
1008   The special value "*", if present in the Accept-Charset field,
1009   matches every character set (including ISO-8859-1) which is not
1010   mentioned elsewhere in the Accept-Charset field. If no "*" is present
1011   in an Accept-Charset field, then all character sets not explicitly
1012   mentioned get a quality value of 0, except for ISO-8859-1, which gets
1013   a quality value of 1 if not explicitly mentioned.
1016   If no Accept-Charset header is present, the default is that any
1017   character set is acceptable. If an Accept-Charset header is present,
1018   and if the server cannot send a response which is acceptable
1019   according to the Accept-Charset header, then the server &SHOULD; send
1020   an error response with the 406 (Not Acceptable) status code, though
1021   the sending of an unacceptable response is also allowed.
1025<section title="Accept-Encoding" anchor="header.accept-encoding">
1026  <iref primary="true" item="Accept-Encoding header" x:for-anchor=""/>
1027  <iref primary="true" item="Headers" subitem="Accept-Encoding" x:for-anchor=""/>
1029   The Accept-Encoding request-header field is similar to Accept, but
1030   restricts the content-codings (<xref target="content.codings"/>) that are acceptable in
1031   the response.
1033<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Accept-Encoding"/><iref primary="true" item="Grammar" subitem="codings"/>
1034  Accept-Encoding  = "Accept-Encoding" ":"
1035                     #( codings [ ";" "q" "=" qvalue ] )
1036  codings          = ( content-coding | "*" )
1039   Examples of its use are:
1041<figure><artwork type="example">
1042    Accept-Encoding: compress, gzip
1043    Accept-Encoding:
1044    Accept-Encoding: *
1045    Accept-Encoding: compress;q=0.5, gzip;q=1.0
1046    Accept-Encoding: gzip;q=1.0, identity; q=0.5, *;q=0
1049   A server tests whether a content-coding is acceptable, according to
1050   an Accept-Encoding field, using these rules:
1051  <list style="numbers">
1052      <t>If the content-coding is one of the content-codings listed in
1053         the Accept-Encoding field, then it is acceptable, unless it is
1054         accompanied by a qvalue of 0. (As defined in <xref target="quality.values"/>, a
1055         qvalue of 0 means "not acceptable.")</t>
1057      <t>The special "*" symbol in an Accept-Encoding field matches any
1058         available content-coding not explicitly listed in the header
1059         field.</t>
1061      <t>If multiple content-codings are acceptable, then the acceptable
1062         content-coding with the highest non-zero qvalue is preferred.</t>
1064      <t>The "identity" content-coding is always acceptable, unless
1065         specifically refused because the Accept-Encoding field includes
1066         "identity;q=0", or because the field includes "*;q=0" and does
1067         not explicitly include the "identity" content-coding. If the
1068         Accept-Encoding field-value is empty, then only the "identity"
1069         encoding is acceptable.</t>
1070  </list>
1073   If an Accept-Encoding field is present in a request, and if the
1074   server cannot send a response which is acceptable according to the
1075   Accept-Encoding header, then the server &SHOULD; send an error response
1076   with the 406 (Not Acceptable) status code.
1079   If no Accept-Encoding field is present in a request, the server &MAY;
1080   assume that the client will accept any content coding. In this case,
1081   if "identity" is one of the available content-codings, then the
1082   server &SHOULD; use the "identity" content-coding, unless it has
1083   additional information that a different content-coding is meaningful
1084   to the client.
1085  <list><t>
1086      <x:h>Note:</x:h> If the request does not include an Accept-Encoding field,
1087      and if the "identity" content-coding is unavailable, then
1088      content-codings commonly understood by HTTP/1.0 clients (i.e.,
1089      "gzip" and "compress") are preferred; some older clients
1090      improperly display messages sent with other content-codings.  The
1091      server might also make this decision based on information about
1092      the particular user-agent or client.
1093    </t><t>
1094      <x:h>Note:</x:h> Most HTTP/1.0 applications do not recognize or obey qvalues
1095      associated with content-codings. This means that qvalues will not
1096      work and are not permitted with x-gzip or x-compress.
1097    </t></list>
1101<section title="Accept-Language" anchor="header.accept-language">
1102  <iref primary="true" item="Accept-Language header" x:for-anchor=""/>
1103  <iref primary="true" item="Headers" subitem="Accept-Language" x:for-anchor=""/>
1105   The Accept-Language request-header field is similar to Accept, but
1106   restricts the set of natural languages that are preferred as a
1107   response to the request. Language tags are defined in <xref target="language.tags"/>.
1109<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Accept-Language"/><iref primary="true" item="Grammar" subitem="language-range"/>
1110  Accept-Language = "Accept-Language" ":"
1111                    1#( language-range [ ";" "q" "=" qvalue ] )
1112  language-range  = ( ( 1*8ALPHA *( "-" 1*8ALPHA ) ) | "*" )
1115   Each language-range &MAY; be given an associated quality value which
1116   represents an estimate of the user's preference for the languages
1117   specified by that range. The quality value defaults to "q=1". For
1118   example,
1120<figure><artwork type="example">
1121    Accept-Language: da, en-gb;q=0.8, en;q=0.7
1124   would mean: "I prefer Danish, but will accept British English and
1125   other types of English." A language-range matches a language-tag if
1126   it exactly equals the tag, or if it exactly equals a prefix of the
1127   tag such that the first tag character following the prefix is "-".
1128   The special range "*", if present in the Accept-Language field,
1129   matches every tag not matched by any other range present in the
1130   Accept-Language field.
1131  <list><t>
1132      <x:h>Note:</x:h> This use of a prefix matching rule does not imply that
1133      language tags are assigned to languages in such a way that it is
1134      always true that if a user understands a language with a certain
1135      tag, then this user will also understand all languages with tags
1136      for which this tag is a prefix. The prefix rule simply allows the
1137      use of prefix tags if this is the case.
1138  </t></list>
1141   The language quality factor assigned to a language-tag by the
1142   Accept-Language field is the quality value of the longest language-range
1143   in the field that matches the language-tag. If no language-range
1144   in the field matches the tag, the language quality factor
1145   assigned is 0. If no Accept-Language header is present in the
1146   request, the server
1147   &SHOULD; assume that all languages are equally acceptable. If an
1148   Accept-Language header is present, then all languages which are
1149   assigned a quality factor greater than 0 are acceptable.
1152   It might be contrary to the privacy expectations of the user to send
1153   an Accept-Language header with the complete linguistic preferences of
1154   the user in every request. For a discussion of this issue, see
1155   <xref target=""/>.
1158   As intelligibility is highly dependent on the individual user, it is
1159   recommended that client applications make the choice of linguistic
1160   preference available to the user. If the choice is not made
1161   available, then the Accept-Language header field &MUST-NOT; be given in
1162   the request.
1163  <list><t>
1164      <x:h>Note:</x:h> When making the choice of linguistic preference available to
1165      the user, we remind implementors of  the fact that users are not
1166      familiar with the details of language matching as described above,
1167      and should provide appropriate guidance. As an example, users
1168      might assume that on selecting "en-gb", they will be served any
1169      kind of English document if British English is not available. A
1170      user agent might suggest in such a case to add "en" to get the
1171      best matching behavior.
1172  </t></list>
1176<section title="Content-Encoding" anchor="header.content-encoding">
1177  <iref primary="true" item="Content-Encoding header" x:for-anchor=""/>
1178  <iref primary="true" item="Headers" subitem="Content-Encoding" x:for-anchor=""/>
1180   The Content-Encoding entity-header field is used as a modifier to the
1181   media-type. When present, its value indicates what additional content
1182   codings have been applied to the entity-body, and thus what decoding
1183   mechanisms must be applied in order to obtain the media-type
1184   referenced by the Content-Type header field. Content-Encoding is
1185   primarily used to allow a document to be compressed without losing
1186   the identity of its underlying media type.
1188<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Encoding"/>
1189  Content-Encoding  = "Content-Encoding" ":" 1#content-coding
1192   Content codings are defined in <xref target="content.codings"/>. An example of its use is
1194<figure><artwork type="example">
1195    Content-Encoding: gzip
1198   The content-coding is a characteristic of the entity identified by
1199   the Request-URI. Typically, the entity-body is stored with this
1200   encoding and is only decoded before rendering or analogous usage.
1201   However, a non-transparent proxy &MAY; modify the content-coding if the
1202   new coding is known to be acceptable to the recipient, unless the
1203   "no-transform" cache-control directive is present in the message.
1206   If the content-coding of an entity is not "identity", then the
1207   response &MUST; include a Content-Encoding entity-header (<xref target="header.content-encoding"/>)
1208   that lists the non-identity content-coding(s) used.
1211   If the content-coding of an entity in a request message is not
1212   acceptable to the origin server, the server &SHOULD; respond with a
1213   status code of 415 (Unsupported Media Type).
1216   If multiple encodings have been applied to an entity, the content
1217   codings &MUST; be listed in the order in which they were applied.
1218   Additional information about the encoding parameters &MAY; be provided
1219   by other entity-header fields not defined by this specification.
1223<section title="Content-Language" anchor="header.content-language">
1224  <iref primary="true" item="Content-Language header" x:for-anchor=""/>
1225  <iref primary="true" item="Headers" subitem="Content-Language" x:for-anchor=""/>
1227   The Content-Language entity-header field describes the natural
1228   language(s) of the intended audience for the enclosed entity. Note
1229   that this might not be equivalent to all the languages used within
1230   the entity-body.
1232<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Language"/>
1233  Content-Language  = "Content-Language" ":" 1#language-tag
1236   Language tags are defined in <xref target="language.tags"/>. The primary purpose of
1237   Content-Language is to allow a user to identify and differentiate
1238   entities according to the user's own preferred language. Thus, if the
1239   body content is intended only for a Danish-literate audience, the
1240   appropriate field is
1242<figure><artwork type="example">
1243    Content-Language: da
1246   If no Content-Language is specified, the default is that the content
1247   is intended for all language audiences. This might mean that the
1248   sender does not consider it to be specific to any natural language,
1249   or that the sender does not know for which language it is intended.
1252   Multiple languages &MAY; be listed for content that is intended for
1253   multiple audiences. For example, a rendition of the "Treaty of
1254   Waitangi," presented simultaneously in the original Maori and English
1255   versions, would call for
1257<figure><artwork type="example">
1258    Content-Language: mi, en
1261   However, just because multiple languages are present within an entity
1262   does not mean that it is intended for multiple linguistic audiences.
1263   An example would be a beginner's language primer, such as "A First
1264   Lesson in Latin," which is clearly intended to be used by an
1265   English-literate audience. In this case, the Content-Language would
1266   properly only include "en".
1269   Content-Language &MAY; be applied to any media type -- it is not
1270   limited to textual documents.
1274<section title="Content-Location" anchor="header.content-location">
1275  <iref primary="true" item="Content-Location header" x:for-anchor=""/>
1276  <iref primary="true" item="Headers" subitem="Content-Location" x:for-anchor=""/>
1278   The Content-Location entity-header field &MAY; be used to supply the
1279   resource location for the entity enclosed in the message when that
1280   entity is accessible from a location separate from the requested
1281   resource's URI. A server &SHOULD; provide a Content-Location for the
1282   variant corresponding to the response entity; especially in the case
1283   where a resource has multiple entities associated with it, and those
1284   entities actually have separate locations by which they might be
1285   individually accessed, the server &SHOULD; provide a Content-Location
1286   for the particular variant which is returned.
1288<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Location"/>
1289  Content-Location = "Content-Location" ":"
1290                    ( absoluteURI | relativeURI )
1293   The value of Content-Location also defines the base URI for the
1294   entity.
1297   The Content-Location value is not a replacement for the original
1298   requested URI; it is only a statement of the location of the resource
1299   corresponding to this particular entity at the time of the request.
1300   Future requests &MAY; specify the Content-Location URI as the request-URI
1301   if the desire is to identify the source of that particular
1302   entity.
1305   A cache cannot assume that an entity with a Content-Location
1306   different from the URI used to retrieve it can be used to respond to
1307   later requests on that Content-Location URI. However, the Content-Location
1308   can be used to differentiate between multiple entities
1309   retrieved from a single requested resource, as described in &caching-neg-resp;.
1312   If the Content-Location is a relative URI, the relative URI is
1313   interpreted relative to the Request-URI.
1316   The meaning of the Content-Location header in PUT or POST requests is
1317   undefined; servers are free to ignore it in those cases.
1321<section title="Content-MD5" anchor="header.content-md5">
1322  <iref primary="true" item="Content-MD5 header" x:for-anchor=""/>
1323  <iref primary="true" item="Headers" subitem="Content-MD5" x:for-anchor=""/>
1325   The Content-MD5 entity-header field, as defined in <xref target="RFC1864"/>, is
1326   an MD5 digest of the entity-body for the purpose of providing an
1327   end-to-end message integrity check (MIC) of the entity-body. (Note: a
1328   MIC is good for detecting accidental modification of the entity-body
1329   in transit, but is not proof against malicious attacks.)
1331<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-MD5"/><iref primary="true" item="Grammar" subitem="md5-digest"/>
1332  Content-MD5   = "Content-MD5" ":" md5-digest
1333  md5-digest    = &lt;base64 of 128 bit MD5 digest as per <xref target="RFC1864"/>&gt;
1336   The Content-MD5 header field &MAY; be generated by an origin server or
1337   client to function as an integrity check of the entity-body. Only
1338   origin servers or clients &MAY; generate the Content-MD5 header field;
1339   proxies and gateways &MUST-NOT; generate it, as this would defeat its
1340   value as an end-to-end integrity check. Any recipient of the entity-body,
1341   including gateways and proxies, &MAY; check that the digest value
1342   in this header field matches that of the entity-body as received.
1345   The MD5 digest is computed based on the content of the entity-body,
1346   including any content-coding that has been applied, but not including
1347   any transfer-encoding applied to the message-body. If the message is
1348   received with a transfer-encoding, that encoding &MUST; be removed
1349   prior to checking the Content-MD5 value against the received entity.
1352   This has the result that the digest is computed on the octets of the
1353   entity-body exactly as, and in the order that, they would be sent if
1354   no transfer-encoding were being applied.
1357   HTTP extends RFC 1864 to permit the digest to be computed for MIME
1358   composite media-types (e.g., multipart/* and message/rfc822), but
1359   this does not change how the digest is computed as defined in the
1360   preceding paragraph.
1363   There are several consequences of this. The entity-body for composite
1364   types &MAY; contain many body-parts, each with its own MIME and HTTP
1365   headers (including Content-MD5, Content-Transfer-Encoding, and
1366   Content-Encoding headers). If a body-part has a Content-Transfer-Encoding
1367   or Content-Encoding header, it is assumed that the content
1368   of the body-part has had the encoding applied, and the body-part is
1369   included in the Content-MD5 digest as is -- i.e., after the
1370   application. The Transfer-Encoding header field is not allowed within
1371   body-parts.
1374   Conversion of all line breaks to CRLF &MUST-NOT; be done before
1375   computing or checking the digest: the line break convention used in
1376   the text actually transmitted &MUST; be left unaltered when computing
1377   the digest.
1378  <list><t>
1379      <x:h>Note:</x:h> while the definition of Content-MD5 is exactly the same for
1380      HTTP as in RFC 1864 for MIME entity-bodies, there are several ways
1381      in which the application of Content-MD5 to HTTP entity-bodies
1382      differs from its application to MIME entity-bodies. One is that
1383      HTTP, unlike MIME, does not use Content-Transfer-Encoding, and
1384      does use Transfer-Encoding and Content-Encoding. Another is that
1385      HTTP more frequently uses binary content types than MIME, so it is
1386      worth noting that, in such cases, the byte order used to compute
1387      the digest is the transmission byte order defined for the type.
1388      Lastly, HTTP allows transmission of text types with any of several
1389      line break conventions and not just the canonical form using CRLF.
1390  </t></list>
1394<section title="Content-Type" anchor="header.content-type">
1395  <iref primary="true" item="Content-Type header" x:for-anchor=""/>
1396  <iref primary="true" item="Headers" subitem="Content-Type" x:for-anchor=""/>
1398   The Content-Type entity-header field indicates the media type of the
1399   entity-body sent to the recipient or, in the case of the HEAD method,
1400   the media type that would have been sent had the request been a GET.
1402<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Type"/>
1403  Content-Type   = "Content-Type" ":" media-type
1406   Media types are defined in <xref target="media.types"/>. An example of the field is
1408<figure><artwork type="example">
1409    Content-Type: text/html; charset=ISO-8859-4
1412   Further discussion of methods for identifying the media type of an
1413   entity is provided in <xref target="type"/>.
1419<section title="IANA Considerations" anchor="IANA.considerations">
1421   <cref>TBD.</cref>
1425<section title="Security Considerations" anchor="security.considerations">
1427   This section is meant to inform application developers, information
1428   providers, and users of the security limitations in HTTP/1.1 as
1429   described by this document. The discussion does not include
1430   definitive solutions to the problems revealed, though it does make
1431   some suggestions for reducing security risks.
1434<section title="Privacy Issues Connected to Accept Headers" anchor="">
1436   Accept request-headers can reveal information about the user to all
1437   servers which are accessed. The Accept-Language header in particular
1438   can reveal information the user would consider to be of a private
1439   nature, because the understanding of particular languages is often
1440   strongly correlated to the membership of a particular ethnic group.
1441   User agents which offer the option to configure the contents of an
1442   Accept-Language header to be sent in every request are strongly
1443   encouraged to let the configuration process include a message which
1444   makes the user aware of the loss of privacy involved.
1447   An approach that limits the loss of privacy would be for a user agent
1448   to omit the sending of Accept-Language headers by default, and to ask
1449   the user whether or not to start sending Accept-Language headers to a
1450   server if it detects, by looking for any Vary response-header fields
1451   generated by the server, that such sending could improve the quality
1452   of service.
1455   Elaborate user-customized accept header fields sent in every request,
1456   in particular if these include quality values, can be used by servers
1457   as relatively reliable and long-lived user identifiers. Such user
1458   identifiers would allow content providers to do click-trail tracking,
1459   and would allow collaborating content providers to match cross-server
1460   click-trails or form submissions of individual users. Note that for
1461   many users not behind a proxy, the network address of the host
1462   running the user agent will also serve as a long-lived user
1463   identifier. In environments where proxies are used to enhance
1464   privacy, user agents ought to be conservative in offering accept
1465   header configuration options to end users. As an extreme privacy
1466   measure, proxies could filter the accept headers in relayed requests.
1467   General purpose user agents which provide a high degree of header
1468   configurability &SHOULD; warn users about the loss of privacy which can
1469   be involved.
1473<section title="Content-Disposition Issues" anchor="content-disposition.issues">
1475   <xref target="RFC1806"/>, from which the often implemented Content-Disposition
1476   (see <xref target="content-disposition"/>) header in HTTP is derived, has a number of very
1477   serious security considerations. Content-Disposition is not part of
1478   the HTTP standard, but since it is widely implemented, we are
1479   documenting its use and risks for implementors. See <xref target="RFC2183"/>
1480   (which updates <xref target="RFC1806"/>) for details.
1486<section title="Acknowledgments" anchor="ack">
1491<references title="Normative References">
1493<reference anchor="ISO-8859-1">
1494  <front>
1495    <title>
1496     Information technology -- 8-bit single-byte coded graphic character sets -- Part 1: Latin alphabet No. 1
1497    </title>
1498    <author>
1499      <organization>International Organization for Standardization</organization>
1500    </author>
1501    <date year="1998"/>
1502  </front>
1503  <seriesInfo name="ISO/IEC" value="8859-1:1998"/>
1506<reference anchor="Part1">
1507  <front>
1508    <title abbrev="HTTP/1.1">HTTP/1.1, part 1: URIs, Connections, and Message Parsing</title>
1509    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
1510      <organization abbrev="Day Software">Day Software</organization>
1511      <address><email></email></address>
1512    </author>
1513    <author initials="J." surname="Gettys" fullname="Jim Gettys">
1514      <organization>One Laptop per Child</organization>
1515      <address><email></email></address>
1516    </author>
1517    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
1518      <organization abbrev="HP">Hewlett-Packard Company</organization>
1519      <address><email></email></address>
1520    </author>
1521    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
1522      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1523      <address><email></email></address>
1524    </author>
1525    <author initials="L." surname="Masinter" fullname="Larry Masinter">
1526      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
1527      <address><email></email></address>
1528    </author>
1529    <author initials="P." surname="Leach" fullname="Paul J. Leach">
1530      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1531      <address><email></email></address>
1532    </author>
1533    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1534      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
1535      <address><email></email></address>
1536    </author>
1537    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
1538      <organization abbrev="W3C">World Wide Web Consortium</organization>
1539      <address><email></email></address>
1540    </author>
1541    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1542      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1543      <address><email></email></address>
1544    </author>
1545    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
1546  </front>
1547  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p1-messaging-&ID-VERSION;"/>
1548  <x:source href="p1-messaging.xml" basename="p1-messaging"/>
1551<reference anchor="Part2">
1552  <front>
1553    <title abbrev="HTTP/1.1">HTTP/1.1, part 2: Message Semantics</title>
1554    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
1555      <organization abbrev="Day Software">Day Software</organization>
1556      <address><email></email></address>
1557    </author>
1558    <author initials="J." surname="Gettys" fullname="Jim Gettys">
1559      <organization>One Laptop per Child</organization>
1560      <address><email></email></address>
1561    </author>
1562    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
1563      <organization abbrev="HP">Hewlett-Packard Company</organization>
1564      <address><email></email></address>
1565    </author>
1566    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
1567      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1568      <address><email></email></address>
1569    </author>
1570    <author initials="L." surname="Masinter" fullname="Larry Masinter">
1571      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
1572      <address><email></email></address>
1573    </author>
1574    <author initials="P." surname="Leach" fullname="Paul J. Leach">
1575      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1576      <address><email></email></address>
1577    </author>
1578    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1579      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
1580      <address><email></email></address>
1581    </author>
1582    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
1583      <organization abbrev="W3C">World Wide Web Consortium</organization>
1584      <address><email></email></address>
1585    </author>
1586    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1587      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1588      <address><email></email></address>
1589    </author>
1590    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
1591  </front>
1592  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p2-semantics-&ID-VERSION;"/>
1593  <x:source href="p2-semantics.xml" basename="p2-semantics"/>
1596<reference anchor="Part4">
1597  <front>
1598    <title abbrev="HTTP/1.1">HTTP/1.1, part 4: Conditional Requests</title>
1599    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
1600      <organization abbrev="Day Software">Day Software</organization>
1601      <address><email></email></address>
1602    </author>
1603    <author initials="J." surname="Gettys" fullname="Jim Gettys">
1604      <organization>One Laptop per Child</organization>
1605      <address><email></email></address>
1606    </author>
1607    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
1608      <organization abbrev="HP">Hewlett-Packard Company</organization>
1609      <address><email></email></address>
1610    </author>
1611    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
1612      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1613      <address><email></email></address>
1614    </author>
1615    <author initials="L." surname="Masinter" fullname="Larry Masinter">
1616      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
1617      <address><email></email></address>
1618    </author>
1619    <author initials="P." surname="Leach" fullname="Paul J. Leach">
1620      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1621      <address><email></email></address>
1622    </author>
1623    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1624      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
1625      <address><email></email></address>
1626    </author>
1627    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
1628      <organization abbrev="W3C">World Wide Web Consortium</organization>
1629      <address><email></email></address>
1630    </author>
1631    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1632      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1633      <address><email></email></address>
1634    </author>
1635    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
1636  </front>
1637  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p4-conditional-&ID-VERSION;"/>
1638  <x:source href="p4-conditional.xml" basename="p4-conditional"/>
1641<reference anchor="Part5">
1642  <front>
1643    <title abbrev="HTTP/1.1">HTTP/1.1, part 5: Range Requests and Partial Responses</title>
1644    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
1645      <organization abbrev="Day Software">Day Software</organization>
1646      <address><email></email></address>
1647    </author>
1648    <author initials="J." surname="Gettys" fullname="Jim Gettys">
1649      <organization>One Laptop per Child</organization>
1650      <address><email></email></address>
1651    </author>
1652    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
1653      <organization abbrev="HP">Hewlett-Packard Company</organization>
1654      <address><email></email></address>
1655    </author>
1656    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
1657      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1658      <address><email></email></address>
1659    </author>
1660    <author initials="L." surname="Masinter" fullname="Larry Masinter">
1661      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
1662      <address><email></email></address>
1663    </author>
1664    <author initials="P." surname="Leach" fullname="Paul J. Leach">
1665      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1666      <address><email></email></address>
1667    </author>
1668    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1669      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
1670      <address><email></email></address>
1671    </author>
1672    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
1673      <organization abbrev="W3C">World Wide Web Consortium</organization>
1674      <address><email></email></address>
1675    </author>
1676    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1677      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1678      <address><email></email></address>
1679    </author>
1680    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
1681  </front>
1682  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p5-range-&ID-VERSION;"/>
1683  <x:source href="p5-range.xml" basename="p5-range"/>
1686<reference anchor="Part6">
1687  <front>
1688    <title abbrev="HTTP/1.1">HTTP/1.1, part 6: Caching</title>
1689    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
1690      <organization abbrev="Day Software">Day Software</organization>
1691      <address><email></email></address>
1692    </author>
1693    <author initials="J." surname="Gettys" fullname="Jim Gettys">
1694      <organization>One Laptop per Child</organization>
1695      <address><email></email></address>
1696    </author>
1697    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
1698      <organization abbrev="HP">Hewlett-Packard Company</organization>
1699      <address><email></email></address>
1700    </author>
1701    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
1702      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1703      <address><email></email></address>
1704    </author>
1705    <author initials="L." surname="Masinter" fullname="Larry Masinter">
1706      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
1707      <address><email></email></address>
1708    </author>
1709    <author initials="P." surname="Leach" fullname="Paul J. Leach">
1710      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1711      <address><email></email></address>
1712    </author>
1713    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1714      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
1715      <address><email></email></address>
1716    </author>
1717    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
1718      <organization abbrev="W3C">World Wide Web Consortium</organization>
1719      <address><email></email></address>
1720    </author>
1721    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1722      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1723      <address><email></email></address>
1724    </author>
1725    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
1726  </front>
1727  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p6-cache-&ID-VERSION;"/>
1728  <x:source href="p6-cache.xml" basename="p6-cache"/>
1731<reference anchor="RFC1766">
1732  <front>
1733    <title abbrev="Language Tag">Tags for the Identification of Languages</title>
1734    <author initials="H." surname="Alvestrand" fullname="Harald Tveit Alvestrand">
1735      <organization>UNINETT</organization>
1736      <address><email></email></address>
1737    </author>
1738    <date month="March" year="1995"/>
1739  </front>
1740  <seriesInfo name="RFC" value="1766"/>
1743<reference anchor="RFC1864">
1744  <front>
1745    <title abbrev="Content-MD5 Header Field">The Content-MD5 Header Field</title>
1746    <author initials="J." surname="Myers" fullname="John G. Myers">
1747      <organization>Carnegie Mellon University</organization>
1748      <address><email></email></address>
1749    </author>
1750    <author initials="M." surname="Rose" fullname="Marshall T. Rose">
1751      <organization>Dover Beach Consulting, Inc.</organization>
1752      <address><email></email></address>
1753    </author>
1754    <date month="October" year="1995"/>
1755  </front>
1756  <seriesInfo name="RFC" value="1864"/>
1759<reference anchor="RFC1950">
1760  <front>
1761    <title>ZLIB Compressed Data Format Specification version 3.3</title>
1762    <author initials="L.P." surname="Deutsch" fullname="L. Peter Deutsch">
1763      <organization>Aladdin Enterprises</organization>
1764      <address><email></email></address>
1765    </author>
1766    <author initials="J-L." surname="Gailly" fullname="Jean-Loup Gailly">
1767      <organization/>
1768    </author>
1769    <date month="May" year="1996"/>
1770  </front>
1771  <seriesInfo name="RFC" value="1950"/>
1772  <annotation>
1773    RFC1950 is an Informational RFC, thus it may be less stable than
1774    this specification. On the other hand, this downward reference was
1775    present since <xref target="RFC2068"/> (published in 1997), therefore it is unlikely
1776    to cause problems in practice.
1777  </annotation>
1780<reference anchor="RFC1951">
1781  <front>
1782    <title>DEFLATE Compressed Data Format Specification version 1.3</title>
1783    <author initials="P." surname="Deutsch" fullname="L. Peter Deutsch">
1784      <organization>Aladdin Enterprises</organization>
1785      <address><email></email></address>
1786    </author>
1787    <date month="May" year="1996"/>
1788  </front>
1789  <seriesInfo name="RFC" value="1951"/>
1790  <annotation>
1791    RFC1951 is an Informational RFC, thus it may be less stable than
1792    this specification. On the other hand, this downward reference was
1793    present since <xref target="RFC2068"/> (published in 1997), therefore it is unlikely
1794    to cause problems in practice.
1795  </annotation>
1798<reference anchor="RFC1952">
1799  <front>
1800    <title>GZIP file format specification version 4.3</title>
1801    <author initials="P." surname="Deutsch" fullname="L. Peter Deutsch">
1802      <organization>Aladdin Enterprises</organization>
1803      <address><email></email></address>
1804    </author>
1805    <author initials="J-L." surname="Gailly" fullname="Jean-Loup Gailly">
1806      <organization/>
1807      <address><email></email></address>
1808    </author>
1809    <author initials="M." surname="Adler" fullname="Mark Adler">
1810      <organization/>
1811      <address><email></email></address>
1812    </author>
1813    <author initials="L.P." surname="Deutsch" fullname="L. Peter Deutsch">
1814      <organization/>
1815      <address><email></email></address>
1816    </author>
1817    <author initials="G." surname="Randers-Pehrson" fullname="Glenn Randers-Pehrson">
1818      <organization/>
1819      <address><email></email></address>
1820    </author>
1821    <date month="May" year="1996"/>
1822  </front>
1823  <seriesInfo name="RFC" value="1952"/>
1824  <annotation>
1825    RFC1952 is an Informational RFC, thus it may be less stable than
1826    this specification. On the other hand, this downward reference was
1827    present since <xref target="RFC2068"/> (published in 1997), therefore it is unlikely
1828    to cause problems in practice.
1829  </annotation>
1832<reference anchor="RFC2045">
1833  <front>
1834    <title abbrev="Internet Message Bodies">Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies</title>
1835    <author initials="N." surname="Freed" fullname="Ned Freed">
1836      <organization>Innosoft International, Inc.</organization>
1837      <address><email></email></address>
1838    </author>
1839    <author initials="N.S." surname="Borenstein" fullname="Nathaniel S. Borenstein">
1840      <organization>First Virtual Holdings</organization>
1841      <address><email></email></address>
1842    </author>
1843    <date month="November" year="1996"/>
1844  </front>
1845  <seriesInfo name="RFC" value="2045"/>
1848<reference anchor="RFC2046">
1849  <front>
1850    <title abbrev="Media Types">Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types</title>
1851    <author initials="N." surname="Freed" fullname="Ned Freed">
1852      <organization>Innosoft International, Inc.</organization>
1853      <address><email></email></address>
1854    </author>
1855    <author initials="N." surname="Borenstein" fullname="Nathaniel S. Borenstein">
1856      <organization>First Virtual Holdings</organization>
1857      <address><email></email></address>
1858    </author>
1859    <date month="November" year="1996"/>
1860  </front>
1861  <seriesInfo name="RFC" value="2046"/>
1864<reference anchor="RFC2119">
1865  <front>
1866    <title>Key words for use in RFCs to Indicate Requirement Levels</title>
1867    <author initials="S." surname="Bradner" fullname="Scott Bradner">
1868      <organization>Harvard University</organization>
1869      <address><email></email></address>
1870    </author>
1871    <date month="March" year="1997"/>
1872  </front>
1873  <seriesInfo name="BCP" value="14"/>
1874  <seriesInfo name="RFC" value="2119"/>
1879<references title="Informative References">
1881<reference anchor="RFC1806">
1882  <front>
1883    <title abbrev="Content-Disposition">Communicating Presentation Information in Internet Messages: The Content-Disposition Header</title>
1884    <author initials="R." surname="Troost" fullname="Rens Troost">
1885      <organization>New Century Systems</organization>
1886      <address><email></email></address>
1887    </author>
1888    <author initials="S." surname="Dorner" fullname="Steve Dorner">
1889      <organization>QUALCOMM Incorporated</organization>
1890      <address><email></email></address>
1891    </author>
1892    <date month="June" year="1995"/>
1893  </front>
1894  <seriesInfo name="RFC" value="1806"/>
1897<reference anchor="RFC1945">
1898  <front>
1899    <title abbrev="HTTP/1.0">Hypertext Transfer Protocol -- HTTP/1.0</title>
1900    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1901      <organization>MIT, Laboratory for Computer Science</organization>
1902      <address><email></email></address>
1903    </author>
1904    <author initials="R.T." surname="Fielding" fullname="Roy T. Fielding">
1905      <organization>University of California, Irvine, Department of Information and Computer Science</organization>
1906      <address><email></email></address>
1907    </author>
1908    <author initials="H.F." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
1909      <organization>W3 Consortium, MIT Laboratory for Computer Science</organization>
1910      <address><email></email></address>
1911    </author>
1912    <date month="May" year="1996"/>
1913  </front>
1914  <seriesInfo name="RFC" value="1945"/>
1917<reference anchor="RFC2049">
1918  <front>
1919    <title abbrev="MIME Conformance">Multipurpose Internet Mail Extensions (MIME) Part Five: Conformance Criteria and Examples</title>
1920    <author initials="N." surname="Freed" fullname="Ned Freed">
1921      <organization>Innosoft International, Inc.</organization>
1922      <address><email></email></address>
1923    </author>
1924    <author initials="N.S." surname="Borenstein" fullname="Nathaniel S. Borenstein">
1925      <organization>First Virtual Holdings</organization>
1926      <address><email></email></address>
1927    </author>
1928    <date month="November" year="1996"/>
1929  </front>
1930  <seriesInfo name="RFC" value="2049"/>
1933<reference anchor="RFC2068">
1934  <front>
1935    <title abbrev="HTTP/1.1">Hypertext Transfer Protocol -- HTTP/1.1</title>
1936    <author initials="R." surname="Fielding" fullname="Roy T. Fielding">
1937      <organization>University of California, Irvine, Department of Information and Computer Science</organization>
1938      <address><email></email></address>
1939    </author>
1940    <author initials="J." surname="Gettys" fullname="Jim Gettys">
1941      <organization>MIT Laboratory for Computer Science</organization>
1942      <address><email></email></address>
1943    </author>
1944    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
1945      <organization>Digital Equipment Corporation, Western Research Laboratory</organization>
1946      <address><email></email></address>
1947    </author>
1948    <author initials="H." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
1949      <organization>MIT Laboratory for Computer Science</organization>
1950      <address><email></email></address>
1951    </author>
1952    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1953      <organization>MIT Laboratory for Computer Science</organization>
1954      <address><email></email></address>
1955    </author>
1956    <date month="January" year="1997"/>
1957  </front>
1958  <seriesInfo name="RFC" value="2068"/>
1961<reference anchor="RFC2076">
1962  <front>
1963    <title abbrev="Internet Message Headers">Common Internet Message Headers</title>
1964    <author initials="J." surname="Palme" fullname="Jacob Palme">
1965      <organization>Stockholm University/KTH</organization>
1966      <address><email></email></address>
1967    </author>
1968    <date month="February" year="1997"/>
1969  </front>
1970  <seriesInfo name="RFC" value="2076"/>
1973<reference anchor="RFC2183">
1974  <front>
1975    <title abbrev="Content-Disposition">Communicating Presentation Information in Internet Messages: The Content-Disposition Header Field</title>
1976    <author initials="R." surname="Troost" fullname="Rens Troost">
1977      <organization>New Century Systems</organization>
1978      <address><email></email></address>
1979    </author>
1980    <author initials="S." surname="Dorner" fullname="Steve Dorner">
1981      <organization>QUALCOMM Incorporated</organization>
1982      <address><email></email></address>
1983    </author>
1984    <author initials="K." surname="Moore" fullname="Keith Moore">
1985      <organization>Department of Computer Science</organization>
1986      <address><email></email></address>
1987    </author>
1988    <date month="August" year="1997"/>
1989  </front>
1990  <seriesInfo name="RFC" value="2183"/>
1993<reference anchor="RFC2277">
1994  <front>
1995    <title abbrev="Charset Policy">IETF Policy on Character Sets and Languages</title>
1996    <author initials="H.T." surname="Alvestrand" fullname="Harald Tveit Alvestrand">
1997      <organization>UNINETT</organization>
1998      <address><email></email></address>
1999    </author>
2000    <date month="January" year="1998"/>
2001  </front>
2002  <seriesInfo name="BCP" value="18"/>
2003  <seriesInfo name="RFC" value="2277"/>
2006<reference anchor="RFC2388">
2007  <front>
2008    <title abbrev="multipart/form-data">Returning Values from Forms:  multipart/form-data</title>
2009    <author initials="L." surname="Masinter" fullname="Larry Masinter">
2010      <organization>Xerox Palo Alto Research Center</organization>
2011      <address><email></email></address>
2012    </author>
2013    <date year="1998" month="August"/>
2014  </front>
2015  <seriesInfo name="RFC" value="2388"/>
2018<reference anchor="RFC2557">
2019  <front>
2020    <title abbrev="MIME Encapsulation of Aggregate Documents">MIME Encapsulation of Aggregate Documents, such as HTML (MHTML)</title>
2021    <author initials="F." surname="Palme" fullname="Jacob Palme">
2022      <organization>Stockholm University and KTH</organization>
2023      <address><email></email></address>
2024    </author>
2025    <author initials="A." surname="Hopmann" fullname="Alex Hopmann">
2026      <organization>Microsoft Corporation</organization>
2027      <address><email></email></address>
2028    </author>
2029    <author initials="N." surname="Shelness" fullname="Nick Shelness">
2030      <organization>Lotus Development Corporation</organization>
2031      <address><email></email></address>
2032    </author>
2033    <author initials="E." surname="Stefferud" fullname="Einar Stefferud">
2034      <organization/>
2035      <address><email></email></address>
2036    </author>
2037    <date year="1999" month="March"/>
2038  </front>
2039  <seriesInfo name="RFC" value="2557"/>
2042<reference anchor="RFC2616">
2043  <front>
2044    <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
2045    <author initials="R." surname="Fielding" fullname="R. Fielding">
2046      <organization>University of California, Irvine</organization>
2047      <address><email></email></address>
2048    </author>
2049    <author initials="J." surname="Gettys" fullname="J. Gettys">
2050      <organization>W3C</organization>
2051      <address><email></email></address>
2052    </author>
2053    <author initials="J." surname="Mogul" fullname="J. Mogul">
2054      <organization>Compaq Computer Corporation</organization>
2055      <address><email></email></address>
2056    </author>
2057    <author initials="H." surname="Frystyk" fullname="H. Frystyk">
2058      <organization>MIT Laboratory for Computer Science</organization>
2059      <address><email></email></address>
2060    </author>
2061    <author initials="L." surname="Masinter" fullname="L. Masinter">
2062      <organization>Xerox Corporation</organization>
2063      <address><email></email></address>
2064    </author>
2065    <author initials="P." surname="Leach" fullname="P. Leach">
2066      <organization>Microsoft Corporation</organization>
2067      <address><email></email></address>
2068    </author>
2069    <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
2070      <organization>W3C</organization>
2071      <address><email></email></address>
2072    </author>
2073    <date month="June" year="1999"/>
2074  </front>
2075  <seriesInfo name="RFC" value="2616"/>
2078<reference anchor="RFC2822">
2079  <front>
2080    <title>Internet Message Format</title>
2081    <author initials="P." surname="Resnick" fullname="P. Resnick">
2082      <organization>QUALCOMM Incorporated</organization>
2083    </author>
2084    <date year="2001" month="April"/>
2085  </front>
2086  <seriesInfo name="RFC" value="2822"/>
2089<reference anchor="RFC3629">
2090  <front>
2091    <title>UTF-8, a transformation format of ISO 10646</title>
2092    <author initials="F." surname="Yergeau" fullname="F. Yergeau">
2093      <organization>Alis Technologies</organization>
2094      <address><email></email></address>
2095    </author>
2096    <date month="November" year="2003"/>
2097  </front>
2098  <seriesInfo name="RFC" value="3629"/>
2099  <seriesInfo name="STD" value="63"/>
2102<reference anchor="RFC4288">
2103  <front>
2104    <title>Media Type Specifications and Registration Procedures</title>
2105    <author initials="N." surname="Freed" fullname="N. Freed">
2106      <organization>Sun Microsystems</organization>
2107      <address>
2108        <email></email>
2109      </address>
2110    </author>
2111    <author initials="J." surname="Klensin" fullname="J. Klensin">
2112      <organization/>
2113      <address>
2114        <email></email>
2115      </address>
2116    </author>
2117    <date year="2005" month="December"/>
2118  </front>
2119  <seriesInfo name="BCP" value="13"/>
2120  <seriesInfo name="RFC" value="4288"/>
2125<section title="Differences Between HTTP Entities and RFC 2045 Entities" anchor="differences.between.http.entities.and.rfc.2045.entities">
2127   HTTP/1.1 uses many of the constructs defined for Internet Mail (<xref target="RFC2822"/>) and the Multipurpose Internet Mail Extensions (MIME <xref target="RFC2045"/>) to
2128   allow entities to be transmitted in an open variety of
2129   representations and with extensible mechanisms. However, RFC 2045
2130   discusses mail, and HTTP has a few features that are different from
2131   those described in RFC 2045. These differences were carefully chosen
2132   to optimize performance over binary connections, to allow greater
2133   freedom in the use of new media types, to make date comparisons
2134   easier, and to acknowledge the practice of some early HTTP servers
2135   and clients.
2138   This appendix describes specific areas where HTTP differs from RFC
2139   2045. Proxies and gateways to strict MIME environments &SHOULD; be
2140   aware of these differences and provide the appropriate conversions
2141   where necessary. Proxies and gateways from MIME environments to HTTP
2142   also need to be aware of the differences because some conversions
2143   might be required.
2145<section title="MIME-Version" anchor="mime-version">
2147   HTTP is not a MIME-compliant protocol. However, HTTP/1.1 messages &MAY;
2148   include a single MIME-Version general-header field to indicate what
2149   version of the MIME protocol was used to construct the message. Use
2150   of the MIME-Version header field indicates that the message is in
2151   full compliance with the MIME protocol (as defined in <xref target="RFC2045"/>).
2152   Proxies/gateways are responsible for ensuring full compliance (where
2153   possible) when exporting HTTP messages to strict MIME environments.
2155<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="MIME-Version"/>
2156  MIME-Version   = "MIME-Version" ":" 1*DIGIT "." 1*DIGIT
2159   MIME version "1.0" is the default for use in HTTP/1.1. However,
2160   HTTP/1.1 message parsing and semantics are defined by this document
2161   and not the MIME specification.
2165<section title="Conversion to Canonical Form" anchor="">
2167   <xref target="RFC2045"/> requires that an Internet mail entity be converted to
2168   canonical form prior to being transferred, as described in <xref target="RFC2049" x:fmt="of" x:sec="4"/>.
2169   <xref target="canonicalization.and.text.defaults"/> of this document describes the forms
2170   allowed for subtypes of the "text" media type when transmitted over
2171   HTTP. <xref target="RFC2046"/> requires that content with a type of "text" represent
2172   line breaks as CRLF and forbids the use of CR or LF outside of line
2173   break sequences. HTTP allows CRLF, bare CR, and bare LF to indicate a
2174   line break within text content when a message is transmitted over
2175   HTTP.
2178   Where it is possible, a proxy or gateway from HTTP to a strict MIME
2179   environment &SHOULD; translate all line breaks within the text media
2180   types described in <xref target="canonicalization.and.text.defaults"/> of this document to the RFC 2049
2181   canonical form of CRLF. Note, however, that this might be complicated
2182   by the presence of a Content-Encoding and by the fact that HTTP
2183   allows the use of some character sets which do not use octets 13 and
2184   10 to represent CR and LF, as is the case for some multi-byte
2185   character sets.
2188   Implementors should note that conversion will break any cryptographic
2189   checksums applied to the original content unless the original content
2190   is already in canonical form. Therefore, the canonical form is
2191   recommended for any content that uses such checksums in HTTP.
2195<section title="Introduction of Content-Encoding" anchor="introduction.of.content-encoding">
2197   RFC 2045 does not include any concept equivalent to HTTP/1.1's
2198   Content-Encoding header field. Since this acts as a modifier on the
2199   media type, proxies and gateways from HTTP to MIME-compliant
2200   protocols &MUST; either change the value of the Content-Type header
2201   field or decode the entity-body before forwarding the message. (Some
2202   experimental applications of Content-Type for Internet mail have used
2203   a media-type parameter of ";conversions=&lt;content-coding&gt;" to perform
2204   a function equivalent to Content-Encoding. However, this parameter is
2205   not part of RFC 2045).
2209<section title="No Content-Transfer-Encoding" anchor="no.content-transfer-encoding">
2211   HTTP does not use the Content-Transfer-Encoding field of RFC
2212   2045. Proxies and gateways from MIME-compliant protocols to HTTP &MUST;
2213   remove any Content-Transfer-Encoding
2214   prior to delivering the response message to an HTTP client.
2217   Proxies and gateways from HTTP to MIME-compliant protocols are
2218   responsible for ensuring that the message is in the correct format
2219   and encoding for safe transport on that protocol, where "safe
2220   transport" is defined by the limitations of the protocol being used.
2221   Such a proxy or gateway &SHOULD; label the data with an appropriate
2222   Content-Transfer-Encoding if doing so will improve the likelihood of
2223   safe transport over the destination protocol.
2227<section title="Introduction of Transfer-Encoding" anchor="introduction.of.transfer-encoding">
2229   HTTP/1.1 introduces the Transfer-Encoding header field (&header-transfer-encoding;).
2230   Proxies/gateways &MUST; remove any transfer-coding prior to
2231   forwarding a message via a MIME-compliant protocol.
2235<section title="MHTML and Line Length Limitations" anchor="mhtml.line.length">
2237   HTTP implementations which share code with MHTML <xref target="RFC2557"/> implementations
2238   need to be aware of MIME line length limitations. Since HTTP does not
2239   have this limitation, HTTP does not fold long lines. MHTML messages
2240   being transported by HTTP follow all conventions of MHTML, including
2241   line length limitations and folding, canonicalization, etc., since
2242   HTTP transports all message-bodies as payload (see <xref target="multipart.types"/>) and
2243   does not interpret the content or any MIME header lines that might be
2244   contained therein.
2249<section title="Additional Features" anchor="additional.features">
2251   <xref target="RFC1945"/> and <xref target="RFC2068"/> document protocol elements used by some
2252   existing HTTP implementations, but not consistently and correctly
2253   across most HTTP/1.1 applications. Implementors are advised to be
2254   aware of these features, but cannot rely upon their presence in, or
2255   interoperability with, other HTTP/1.1 applications. Some of these
2256   describe proposed experimental features, and some describe features
2257   that experimental deployment found lacking that are now addressed in
2258   the base HTTP/1.1 specification.
2261   A number of other headers, such as Content-Disposition and Title,
2262   from SMTP and MIME are also often implemented (see <xref target="RFC2076"/>).
2265<section title="Content-Disposition" anchor="content-disposition">
2266<iref item="Headers" subitem="Content-Disposition" primary="true" x:for-anchor=""/>
2267<iref item="Content-Disposition header" primary="true" x:for-anchor=""/>
2269   The Content-Disposition response-header field has been proposed as a
2270   means for the origin server to suggest a default filename if the user
2271   requests that the content is saved to a file. This usage is derived
2272   from the definition of Content-Disposition in <xref target="RFC1806"/>.
2274<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="content-disposition"/><iref primary="true" item="Grammar" subitem="disposition-type"/><iref primary="true" item="Grammar" subitem="disposition-parm"/><iref primary="true" item="Grammar" subitem="filename-parm"/><iref primary="true" item="Grammar" subitem="disp-extension-token"/><iref primary="true" item="Grammar" subitem="disp-extension-parm"/>
2275  content-disposition = "Content-Disposition" ":"
2276                        disposition-type *( ";" disposition-parm )
2277  disposition-type = "attachment" | disp-extension-token
2278  disposition-parm = filename-parm | disp-extension-parm
2279  filename-parm = "filename" "=" quoted-string
2280  disp-extension-token = token
2281  disp-extension-parm = token "=" ( token | quoted-string )
2284   An example is
2286<figure><artwork type="example">
2287     Content-Disposition: attachment; filename="fname.ext"
2290   The receiving user agent &SHOULD-NOT;  respect any directory path
2291   information present in the filename-parm parameter, which is the only
2292   parameter believed to apply to HTTP implementations at this time. The
2293   filename &SHOULD; be treated as a terminal component only.
2296   If this header is used in a response with the application/octet-stream
2297   content-type, the implied suggestion is that the user agent
2298   should not display the response, but directly enter a `save response
2299   as...' dialog.
2302   See <xref target="content-disposition.issues"/> for Content-Disposition security issues.
2307<section title="Compatibility with Previous Versions" anchor="compatibility">
2308<section title="Changes from RFC 2068" anchor="changes.from.rfc.2068">
2310   Transfer-coding and message lengths all interact in ways that
2311   required fixing exactly when chunked encoding is used (to allow for
2312   transfer encoding that may not be self delimiting); it was important
2313   to straighten out exactly how message lengths are computed.
2314   (<xref target="entity.length"/>, see also <xref target="Part1"/>,
2315   <xref target="Part5"/> and <xref target="Part6"/>).
2318   Charset wildcarding is introduced to avoid explosion of character set
2319   names in accept headers. (<xref target="header.accept-charset"/>)
2322   Content-Base was deleted from the specification: it was not
2323   implemented widely, and there is no simple, safe way to introduce it
2324   without a robust extension mechanism. In addition, it is used in a
2325   similar, but not identical fashion in MHTML <xref target="RFC2557"/>.
2328   A content-coding of "identity" was introduced, to solve problems
2329   discovered in caching. (<xref target="content.codings"/>)
2332   Quality Values of zero should indicate that "I don't want something"
2333   to allow clients to refuse a representation. (<xref target="quality.values"/>)
2336   The Alternates<iref item="Alternates header" primary="true"/><iref item="Headers" subitem="Alternate" primary="true"/>, Content-Version<iref item="Content-Version header" primary="true"/><iref item="Headers" subitem="Content-Version" primary="true"/>, Derived-From<iref item="Derived-From header" primary="true"/><iref item="Headers" subitem="Derived-From" primary="true"/>, Link<iref item="Link header" primary="true"/><iref item="Headers" subitem="Link" primary="true"/>, URI<iref item="URI header" primary="true"/><iref item="Headers" subitem="URI" primary="true"/>, Public<iref item="Public header" primary="true"/><iref item="Headers" subitem="Public" primary="true"/> and
2337   Content-Base<iref item="Content-Base header" primary="true"/><iref item="Headers" subitem="Content-Base" primary="true"/> header fields were defined in previous versions of this
2338   specification, but not commonly implemented. See <xref target="RFC2068"/>.
2342<section title="Changes from RFC 2616" anchor="changes.from.rfc.2616">
2344  Clarify contexts that charset is used in.
2345  (<xref target="character.sets"/>)
2348  Remove reference to non-existant identity transfer-coding value tokens.
2349  (<xref target="no.content-transfer-encoding"/>)
2355<section title="Change Log (to be removed by RFC Editor before publication)">
2357<section title="Since RFC2616">
2359  Extracted relevant partitions from <xref target="RFC2616"/>.
2363<section title="Since draft-ietf-httpbis-p3-payload-00">
2365  Closed issues:
2366  <list style="symbols">
2367    <t>
2368      <eref target=""/>:
2369      "Media Type Registrations"
2370      (<eref target=""/>)
2371    </t>
2372    <t>
2373      <eref target=""/>:
2374      "Clarification regarding quoting of charset values"
2375      (<eref target=""/>)
2376    </t>
2377    <t>
2378      <eref target=""/>:
2379      "Remove 'identity' token references"
2380      (<eref target=""/>)
2381    </t>
2382    <t>
2383      <eref target=""/>:
2384      "Accept-Encoding BNF"
2385    </t>
2386    <t>
2387      <eref target=""/>:
2388      "Normative and Informative references"
2389    </t>
2390    <t>
2391      <eref target=""/>:
2392      "RFC1700 references"
2393    </t>
2394    <t>
2395      <eref target=""/>:
2396      "Updating to RFC4288"
2397    </t>
2398    <t>
2399      <eref target=""/>:
2400      "Informative references"
2401    </t>
2402    <t>
2403      <eref target=""/>:
2404      "ISO-8859-1 Reference"
2405    </t>
2406    <t>
2407      <eref target=""/>:
2408      "Encoding References Normative"
2409    </t>
2410    <t>
2411      <eref target=""/>:
2412      "Normative up-to-date references"
2413    </t>
2414  </list>
2418<section title="Since draft-ietf-httpbis-p3-payload-01">
2420  Ongoing work on ABNF conversion (<eref target=""/>):
2421  <list style="symbols">
2422    <t>
2423      Add explicit references to BNF syntax and rules imported from other parts of the specification.
2424    </t>
2425  </list>
Note: See TracBrowser for help on using the repository browser.