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

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

Remove character set defaulting for text media types (to be done: add security considerations WRT charset sniffing); relates to #20.

  • Property svn:eol-style set to native
File size: 107.8 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 message-headers          "<xref target='Part1' x:rel='#message.headers' xmlns:x=''/>">
31  <!ENTITY general-syntax           "<xref target='Part1' x:rel='#general.syntax' xmlns:x=''/>">
32  <!ENTITY multipart-byteranges     "<xref target='Part5' x:rel='' xmlns:x=''/>">
34<?rfc toc="yes" ?>
35<?rfc symrefs="yes" ?>
36<?rfc sortrefs="yes" ?>
37<?rfc compact="yes"?>
38<?rfc subcompact="no" ?>
39<?rfc linkmailto="no" ?>
40<?rfc editing="no" ?>
41<?rfc comments="yes"?>
42<?rfc inline="yes"?>
43<?rfc-ext allow-markup-in-artwork="yes" ?>
44<?rfc-ext include-references-in-index="yes" ?>
45<rfc obsoletes="2616" category="std"
46     ipr="full3978" docName="draft-ietf-httpbis-p3-payload-&ID-VERSION;"
47     xmlns:x=''>
50  <title abbrev="HTTP/1.1, Part 3">HTTP/1.1, part 3: Message Payload and Content Negotiation</title>
52  <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
53    <organization abbrev="Day Software">Day Software</organization>
54    <address>
55      <postal>
56        <street>23 Corporate Plaza DR, Suite 280</street>
57        <city>Newport Beach</city>
58        <region>CA</region>
59        <code>92660</code>
60        <country>USA</country>
61      </postal>
62      <phone>+1-949-706-5300</phone>
63      <facsimile>+1-949-706-5305</facsimile>
64      <email></email>
65      <uri></uri>
66    </address>
67  </author>
69  <author initials="J." surname="Gettys" fullname="Jim Gettys">
70    <organization>One Laptop per Child</organization>
71    <address>
72      <postal>
73        <street>21 Oak Knoll Road</street>
74        <city>Carlisle</city>
75        <region>MA</region>
76        <code>01741</code>
77        <country>USA</country>
78      </postal>
79      <email></email>
80      <uri></uri>
81    </address>
82  </author>
84  <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
85    <organization abbrev="HP">Hewlett-Packard Company</organization>
86    <address>
87      <postal>
88        <street>HP Labs, Large Scale Systems Group</street>
89        <street>1501 Page Mill Road, MS 1177</street>
90        <city>Palo Alto</city>
91        <region>CA</region>
92        <code>94304</code>
93        <country>USA</country>
94      </postal>
95      <email></email>
96    </address>
97  </author>
99  <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
100    <organization abbrev="Microsoft">Microsoft Corporation</organization>
101    <address>
102      <postal>
103        <street>1 Microsoft Way</street>
104        <city>Redmond</city>
105        <region>WA</region>
106        <code>98052</code>
107        <country>USA</country>
108      </postal>
109      <email></email>
110    </address>
111  </author>
113  <author initials="L." surname="Masinter" fullname="Larry Masinter">
114    <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
115    <address>
116      <postal>
117        <street>345 Park Ave</street>
118        <city>San Jose</city>
119        <region>CA</region>
120        <code>95110</code>
121        <country>USA</country>
122      </postal>
123      <email></email>
124      <uri></uri>
125    </address>
126  </author>
128  <author initials="P." surname="Leach" fullname="Paul J. Leach">
129    <organization abbrev="Microsoft">Microsoft Corporation</organization>
130    <address>
131      <postal>
132        <street>1 Microsoft Way</street>
133        <city>Redmond</city>
134        <region>WA</region>
135        <code>98052</code>
136      </postal>
137      <email></email>
138    </address>
139  </author>
141  <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
142    <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
143    <address>
144      <postal>
145        <street>MIT Computer Science and Artificial Intelligence Laboratory</street>
146        <street>The Stata Center, Building 32</street>
147        <street>32 Vassar Street</street>
148        <city>Cambridge</city>
149        <region>MA</region>
150        <code>02139</code>
151        <country>USA</country>
152      </postal>
153      <email></email>
154      <uri></uri>
155    </address>
156  </author>
158  <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
159    <organization abbrev="W3C">World Wide Web Consortium</organization>
160    <address>
161      <postal>
162        <street>W3C / ERCIM</street>
163        <street>2004, rte des Lucioles</street>
164        <city>Sophia-Antipolis</city>
165        <region>AM</region>
166        <code>06902</code>
167        <country>France</country>
168      </postal>
169      <email></email>
170      <uri></uri>
171    </address>
172  </author>
174  <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
175    <organization abbrev="greenbytes">greenbytes GmbH</organization>
176    <address>
177      <postal>
178        <street>Hafenweg 16</street>
179        <city>Muenster</city><region>NW</region><code>48155</code>
180        <country>Germany</country>
181      </postal>
182      <phone>+49 251 2807760</phone>   
183      <facsimile>+49 251 2807761</facsimile>   
184      <email></email>       
185      <uri></uri>     
186    </address>
187  </author>
189  <date month="&ID-MONTH;" year="&ID-YEAR;"/>
193   The Hypertext Transfer Protocol (HTTP) is an application-level
194   protocol for distributed, collaborative, hypermedia information
195   systems. HTTP has been in use by the World Wide Web global information
196   initiative since 1990. This document is Part 3 of the seven-part specification
197   that defines the protocol referred to as "HTTP/1.1" and, taken together,
198   obsoletes RFC 2616.  Part 3 defines HTTP message content,
199   metadata, and content negotiation.
203<note title="Editorial Note (To be removed by RFC Editor)">
204  <t>
205    Discussion of this draft should take place on the HTTPBIS working group
206    mailing list ( The current issues list is
207    at <eref target=""/>
208    and related documents (including fancy diffs) can be found at
209    <eref target=""/>.
210  </t>
211  <t>
212    This draft incorporates those issue resolutions that were either
213    collected in the original RFC2616 errata list (<eref target=""/>),
214    or which were agreed upon on the mailing list between October 2006 and
215    November 2007 (as published in "draft-lafon-rfc2616bis-03").
216  </t>
220<section title="Introduction" anchor="introduction">
222   This document defines HTTP/1.1 message payloads (a.k.a., content), the
223   associated metadata header fields that define how the payload is intended
224   to be interpreted by a recipient, the request header fields that
225   may influence content selection, and the various selection algorithms
226   that are collectively referred to as HTTP content negotiation.
229   This document is currently disorganized in order to minimize the changes
230   between drafts and enable reviewers to see the smaller errata changes.
231   The next draft will reorganize the sections to better reflect the content.
232   In particular, the sections on entities will be renamed payload and moved
233   to the first half of the document, while the sections on content negotiation
234   and associated request header fields will be moved to the second half.  The
235   current mess reflects how widely dispersed these topics and associated
236   requirements had become in <xref target="RFC2616"/>.
239<section title="Requirements" anchor="intro.requirements">
241   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
242   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
243   document are to be interpreted as described in <xref target="RFC2119"/>.
246   An implementation is not compliant if it fails to satisfy one or more
247   of the &MUST; or &REQUIRED; level requirements for the protocols it
248   implements. An implementation that satisfies all the &MUST; or &REQUIRED;
249   level and all the &SHOULD; level requirements for its protocols is said
250   to be "unconditionally compliant"; one that satisfies all the &MUST;
251   level requirements but not all the &SHOULD; level requirements for its
252   protocols is said to be "conditionally compliant."
257<section title="Notational Conventions and Generic Grammar" anchor="notation">
259  This specification uses the ABNF syntax defined in &notation-abnf; and
260  the core rules defined in &basic-rules;:
261  <cref anchor="abnf.dep">ABNF syntax and basic rules will be adopted from RFC 5234, see
262  <eref target=""/>.</cref>
264<figure><artwork type="abnf2616">
265  ALPHA          = &lt;ALPHA, defined in &basic-rules;&gt;
266  DIGIT          = &lt;DIGIT, defined in &basic-rules;&gt;
267  OCTET          = &lt;OCTET, defined in &basic-rules;&gt;
269<figure><artwork type="abnf2616">
270  quoted-string  = &lt;quoted-string, defined in &basic-rules;&gt;
271  token          = &lt;token, defined in &basic-rules;&gt;
273<t anchor="abnf.dependencies">
274  The ABNF rules below are defined in other parts:
276<figure><!--Part1--><artwork type="abnf2616">
277  absoluteURI    = &lt;absoluteURI, defined in &general-syntax;&gt;
278  Content-Length = &lt;Content-Length, defined in &header-content-length;&gt;
279  relativeURI    = &lt;relativeURI, defined in &general-syntax;&gt;
280  message-header = &lt;message-header, defined in &message-headers;&gt;
282<figure><!--Part2--><artwork type="abnf2616">
283  Allow          = &lt;Allow, defined in &header-allow;&gt;
285<figure><!--Part4--><artwork type="abnf2616">
286  Last-Modified  = &lt;Last-Modified, defined in &header-last-modified;&gt;
288<figure><!--Part5--><artwork type="abnf2616">
289  Content-Range  = &lt;Content-Range, defined in &header-content-range;&gt;
291<figure><!--Part6--><artwork type="abnf2616">
292  Expires        = &lt;Expires, defined in &header-expires;&gt;
296<section title="Protocol Parameters" anchor="protocol.parameters">
298<section title="Character Sets" anchor="character.sets">
300   HTTP uses the same definition of the term "character set" as that
301   described for MIME:
304   The term "character set" is used in this document to refer to a
305   method used with one or more tables to convert a sequence of octets
306   into a sequence of characters. Note that unconditional conversion in
307   the other direction is not required, in that not all characters may
308   be available in a given character set and a character set may provide
309   more than one sequence of octets to represent a particular character.
310   This definition is intended to allow various kinds of character
311   encoding, from simple single-table mappings such as US-ASCII to
312   complex table switching methods such as those that use ISO-2022's
313   techniques. However, the definition associated with a MIME character
314   set name &MUST; fully specify the mapping to be performed from octets
315   to characters. In particular, use of external profiling information
316   to determine the exact mapping is not permitted.
319      <x:h>Note:</x:h> This use of the term "character set" is more commonly
320      referred to as a "character encoding." However, since HTTP and
321      MIME share the same registry, it is important that the terminology
322      also be shared.
325   HTTP character sets are identified by case-insensitive tokens. The
326   complete set of tokens is defined by the IANA Character Set registry
327   (<eref target=""/>).
329<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="charset"/>
330  charset = token
333   Although HTTP allows an arbitrary token to be used as a charset
334   value, any token that has a predefined value within the IANA
335   Character Set registry &MUST; represent the character set defined
336   by that registry. Applications &SHOULD; limit their use of character
337   sets to those defined by the IANA registry.
340   HTTP uses charset in two contexts: within an Accept-Charset request
341   header (in which the charset value is an unquoted token) and as the
342   value of a parameter in a Content-Type header (within a request or
343   response), in which case the parameter value of the charset parameter
344   may be quoted.
347   Implementors should be aware of IETF character set requirements <xref target="RFC3629"/>
348   <xref target="RFC2277"/>.
352<section title="Content Codings" anchor="content.codings">
354   Content coding values indicate an encoding transformation that has
355   been or can be applied to an entity. Content codings are primarily
356   used to allow a document to be compressed or otherwise usefully
357   transformed without losing the identity of its underlying media type
358   and without loss of information. Frequently, the entity is stored in
359   coded form, transmitted directly, and only decoded by the recipient.
361<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="content-coding"/>
362  content-coding   = token
365   All content-coding values are case-insensitive. HTTP/1.1 uses
366   content-coding values in the Accept-Encoding (<xref target="header.accept-encoding"/>) and
367   Content-Encoding (<xref target="header.content-encoding"/>) header fields. Although the value
368   describes the content-coding, what is more important is that it
369   indicates what decoding mechanism will be required to remove the
370   encoding.
373   The Internet Assigned Numbers Authority (IANA) acts as a registry for
374   content-coding value tokens. Initially, the registry contains the
375   following tokens:
378   gzip<iref item="gzip"/>
379  <list>
380    <t>
381        An encoding format produced by the file compression program
382        "gzip" (GNU zip) as described in <xref target="RFC1952"/>. This format is a
383        Lempel-Ziv coding (LZ77) with a 32 bit CRC.
384    </t>
385  </list>
388   compress<iref item="compress"/>
389  <list><t>
390        The encoding format produced by the common UNIX file compression
391        program "compress". This format is an adaptive Lempel-Ziv-Welch
392        coding (LZW).
394        Use of program names for the identification of encoding formats
395        is not desirable and is discouraged for future encodings. Their
396        use here is representative of historical practice, not good
397        design. For compatibility with previous implementations of HTTP,
398        applications &SHOULD; consider "x-gzip" and "x-compress" to be
399        equivalent to "gzip" and "compress" respectively.
400  </t></list>
403   deflate<iref item="deflate"/>
404  <list><t>
405        The "zlib" format defined in <xref target="RFC1950"/> in combination with
406        the "deflate" compression mechanism described in <xref target="RFC1951"/>.
407  </t></list>
410   identity<iref item="identity"/>
411  <list><t>
412        The default (identity) encoding; the use of no transformation
413        whatsoever. This content-coding is used only in the Accept-Encoding
414        header, and &SHOULD-NOT;  be used in the Content-Encoding
415        header.
416  </t></list>
419   New content-coding value tokens &SHOULD; be registered; to allow
420   interoperability between clients and servers, specifications of the
421   content coding algorithms needed to implement a new value &SHOULD; be
422   publicly available and adequate for independent implementation, and
423   conform to the purpose of content coding defined in this section.
427<section title="Media Types" anchor="media.types">
429   HTTP uses Internet Media Types <xref target="RFC2046"/> in the Content-Type (<xref target="header.content-type"/>)
430   and Accept (<xref target="header.accept"/>) header fields in order to provide
431   open and extensible data typing and type negotiation.
433<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"/>
434  media-type     = type "/" subtype *( ";" parameter )
435  type           = token
436  subtype        = token
439   Parameters &MAY; follow the type/subtype in the form of attribute/value
440   pairs.
442<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"/>
443  parameter               = attribute "=" value
444  attribute               = token
445  value                   = token | quoted-string
448   The type, subtype, and parameter attribute names are case-insensitive.
449   Parameter values might or might not be case-sensitive,
450   depending on the semantics of the parameter name. Linear white space
451   (LWS) &MUST-NOT; be used between the type and subtype, nor between an
452   attribute and its value. The presence or absence of a parameter might
453   be significant to the processing of a media-type, depending on its
454   definition within the media type registry.
457   Note that some older HTTP applications do not recognize media type
458   parameters. When sending data to older HTTP applications,
459   implementations &SHOULD; only use media type parameters when they are
460   required by that type/subtype definition.
463   Media-type values are registered with the Internet Assigned Number
464   Authority (IANA). The media type registration process is
465   outlined in <xref target="RFC4288"/>. Use of non-registered media types is
466   discouraged.
469<section title="Canonicalization and Text Defaults" anchor="canonicalization.and.text.defaults">
471   Internet media types are registered with a canonical form. An
472   entity-body transferred via HTTP messages &MUST; be represented in the
473   appropriate canonical form prior to its transmission except for
474   "text" types, as defined in the next paragraph.
477   When in canonical form, media subtypes of the "text" type use CRLF as
478   the text line break. HTTP relaxes this requirement and allows the
479   transport of text media with plain CR or LF alone representing a line
480   break when it is done consistently for an entire entity-body. HTTP
481   applications &MUST; accept CRLF, bare CR, and bare LF as being
482   representative of a line break in text media received via HTTP. In
483   addition, if the text is represented in a character set that does not
484   use octets 13 and 10 for CR and LF respectively, as is the case for
485   some multi-byte character sets, HTTP allows the use of whatever octet
486   sequences are defined by that character set to represent the
487   equivalent of CR and LF for line breaks. This flexibility regarding
488   line breaks applies only to text media in the entity-body; a bare CR
489   or LF &MUST-NOT; be substituted for CRLF within any of the HTTP control
490   structures (such as header fields and multipart boundaries).
493   If an entity-body is encoded with a content-coding, the underlying
494   data &MUST; be in a form defined above prior to being encoded.
497   HTTP/1.1 recipients &MUST; respect the    charset label provided by the
498   sender; and those user agents that have a provision to "guess" a charset
499   &MUST; use the charset from the content-type field if they support that
500   charset, rather than the recipient's preference, when initially displaying
501   a document.
505<section title="Multipart Types" anchor="multipart.types">
507   MIME provides for a number of "multipart" types -- encapsulations of
508   one or more entities within a single message-body. All multipart
509   types share a common syntax, as defined in <xref target="RFC2046" x:sec="5.1.1" x:fmt="of"/>,
510   and &MUST; include a boundary parameter as part of the media type
511   value. The message body is itself a protocol element and &MUST;
512   therefore use only CRLF to represent line breaks between body-parts.
513   Unlike in RFC 2046, the epilogue of any multipart message &MUST; be
514   empty; HTTP applications &MUST-NOT; transmit the epilogue (even if the
515   original multipart contains an epilogue). These restrictions exist in
516   order to preserve the self-delimiting nature of a multipart message-body,
517   wherein the "end" of the message-body is indicated by the
518   ending multipart boundary.
521   In general, HTTP treats a multipart message-body no differently than
522   any other media type: strictly as payload. The one exception is the
523   "multipart/byteranges" type (&multipart-byteranges;) when it appears in a 206
524   (Partial Content) response.
525   <!-- jre: re-insert removed text pointing to caching? -->
526   In all
527   other cases, an HTTP user agent &SHOULD; follow the same or similar
528   behavior as a MIME user agent would upon receipt of a multipart type.
529   The MIME header fields within each body-part of a multipart message-body
530   do not have any significance to HTTP beyond that defined by
531   their MIME semantics.
534   In general, an HTTP user agent &SHOULD; follow the same or similar
535   behavior as a MIME user agent would upon receipt of a multipart type.
536   If an application receives an unrecognized multipart subtype, the
537   application &MUST; treat it as being equivalent to "multipart/mixed".
540      <x:h>Note:</x:h> The "multipart/form-data" type has been specifically defined
541      for carrying form data suitable for processing via the POST
542      request method, as described in <xref target="RFC2388"/>.
547<section title="Quality Values" anchor="quality.values">
549   HTTP content negotiation (<xref target="content.negotiation"/>) uses short "floating point"
550   numbers to indicate the relative importance ("weight") of various
551   negotiable parameters.  A weight is normalized to a real number in
552   the range 0 through 1, where 0 is the minimum and 1 the maximum
553   value. If a parameter has a quality value of 0, then content with
554   this parameter is `not acceptable' for the client. HTTP/1.1
555   applications &MUST-NOT; generate more than three digits after the
556   decimal point. User configuration of these values &SHOULD; also be
557   limited in this fashion.
559<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="qvalue"/>
560  qvalue         = ( "0" [ "." 0*3DIGIT ] )
561                 | ( "1" [ "." 0*3("0") ] )
564   "Quality values" is a misnomer, since these values merely represent
565   relative degradation in desired quality.
569<section title="Language Tags" anchor="language.tags">
571   A language tag identifies a natural language spoken, written, or
572   otherwise conveyed by human beings for communication of information
573   to other human beings. Computer languages are explicitly excluded.
574   HTTP uses language tags within the Accept-Language and Content-Language
575   fields.
578   The syntax and registry of HTTP language tags is the same as that
579   defined by <xref target="RFC1766"/>. In summary, a language tag is composed of 1
580   or more parts: A primary language tag and a possibly empty series of
581   subtags:
583<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"/>
584  language-tag  = primary-tag *( "-" subtag )
585  primary-tag   = 1*8ALPHA
586  subtag        = 1*8ALPHA
589   White space is not allowed within the tag and all tags are case-insensitive.
590   The name space of language tags is administered by the
591   IANA. Example tags include:
593<figure><artwork type="example">
594    en, en-US, en-cockney, i-cherokee, x-pig-latin
597   where any two-letter primary-tag is an ISO-639 language abbreviation
598   and any two-letter initial subtag is an ISO-3166 country code. (The
599   last three tags above are not registered tags; all but the last are
600   examples of tags which could be registered in future.)
605<section title="Entity" anchor="entity">
607   Request and Response messages &MAY; transfer an entity if not otherwise
608   restricted by the request method or response status code. An entity
609   consists of entity-header fields and an entity-body, although some
610   responses will only include the entity-headers.
613   In this section, both sender and recipient refer to either the client
614   or the server, depending on who sends and who receives the entity.
617<section title="Entity Header Fields" anchor="entity.header.fields">
619   Entity-header fields define metainformation about the entity-body or,
620   if no body is present, about the resource identified by the request.
622<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="entity-header"/><iref primary="true" item="Grammar" subitem="extension-header"/>
623  entity-header  = Allow                    ; &header-allow;
624                 | Content-Encoding         ; <xref target="header.content-encoding"/>
625                 | Content-Language         ; <xref target="header.content-language"/>
626                 | Content-Length           ; &header-content-length;
627                 | Content-Location         ; <xref target="header.content-location"/>
628                 | Content-MD5              ; <xref target="header.content-md5"/>
629                 | Content-Range            ; &header-content-range;
630                 | Content-Type             ; <xref target="header.content-type"/>
631                 | Expires                  ; &header-expires;
632                 | Last-Modified            ; &header-last-modified;
633                 | extension-header
635  extension-header = message-header
638   The extension-header mechanism allows additional entity-header fields
639   to be defined without changing the protocol, but these fields cannot
640   be assumed to be recognizable by the recipient. Unrecognized header
641   fields &SHOULD; be ignored by the recipient and &MUST; be forwarded by
642   transparent proxies.
646<section title="Entity Body" anchor="entity.body">
648   The entity-body (if any) sent with an HTTP request or response is in
649   a format and encoding defined by the entity-header fields.
651<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="entity-body"/>
652  entity-body    = *OCTET
655   An entity-body is only present in a message when a message-body is
656   present, as described in &message-body;. The entity-body is obtained
657   from the message-body by decoding any Transfer-Encoding that might
658   have been applied to ensure safe and proper transfer of the message.
661<section title="Type" anchor="type">
663   When an entity-body is included with a message, the data type of that
664   body is determined via the header fields Content-Type and Content-Encoding.
665   These define a two-layer, ordered encoding model:
667<figure><artwork type="example">
668    entity-body := Content-Encoding( Content-Type( data ) )
671   Content-Type specifies the media type of the underlying data.
672   Content-Encoding may be used to indicate any additional content
673   codings applied to the data, usually for the purpose of data
674   compression, that are a property of the requested resource. There is
675   no default encoding.
678   Any HTTP/1.1 message containing an entity-body &SHOULD; include a
679   Content-Type header field defining the media type of that body. If
680   and only if the media type is not given by a Content-Type field, the
681   recipient &MAY; attempt to guess the media type via inspection of its
682   content and/or the name extension(s) of the URI used to identify the
683   resource. If the media type remains unknown, the recipient &SHOULD;
684   treat it as type "application/octet-stream".
688<section title="Entity Length" anchor="entity.length">
690   The entity-length of a message is the length of the message-body
691   before any transfer-codings have been applied. &message-length; defines
692   how the transfer-length of a message-body is determined.
698<section title="Content Negotiation" anchor="content.negotiation">
700   Most HTTP responses include an entity which contains information for
701   interpretation by a human user. Naturally, it is desirable to supply
702   the user with the "best available" entity corresponding to the
703   request. Unfortunately for servers and caches, not all users have the
704   same preferences for what is "best," and not all user agents are
705   equally capable of rendering all entity types. For that reason, HTTP
706   has provisions for several mechanisms for "content negotiation" --
707   the process of selecting the best representation for a given response
708   when there are multiple representations available.
709  <list><t>
710      <x:h>Note:</x:h> This is not called "format negotiation" because the
711      alternate representations may be of the same media type, but use
712      different capabilities of that type, be in different languages,
713      etc.
714  </t></list>
717   Any response containing an entity-body &MAY; be subject to negotiation,
718   including error responses.
721   There are two kinds of content negotiation which are possible in
722   HTTP: server-driven and agent-driven negotiation. These two kinds of
723   negotiation are orthogonal and thus may be used separately or in
724   combination. One method of combination, referred to as transparent
725   negotiation, occurs when a cache uses the agent-driven negotiation
726   information provided by the origin server in order to provide
727   server-driven negotiation for subsequent requests.
730<section title="Server-driven Negotiation" anchor="server-driven.negotiation">
732   If the selection of the best representation for a response is made by
733   an algorithm located at the server, it is called server-driven
734   negotiation. Selection is based on the available representations of
735   the response (the dimensions over which it can vary; e.g. language,
736   content-coding, etc.) and the contents of particular header fields in
737   the request message or on other information pertaining to the request
738   (such as the network address of the client).
741   Server-driven negotiation is advantageous when the algorithm for
742   selecting from among the available representations is difficult to
743   describe to the user agent, or when the server desires to send its
744   "best guess" to the client along with the first response (hoping to
745   avoid the round-trip delay of a subsequent request if the "best
746   guess" is good enough for the user). In order to improve the server's
747   guess, the user agent &MAY; include request header fields (Accept,
748   Accept-Language, Accept-Encoding, etc.) which describe its
749   preferences for such a response.
752   Server-driven negotiation has disadvantages:
753  <list style="numbers">
754    <t>
755         It is impossible for the server to accurately determine what
756         might be "best" for any given user, since that would require
757         complete knowledge of both the capabilities of the user agent
758         and the intended use for the response (e.g., does the user want
759         to view it on screen or print it on paper?).
760    </t>
761    <t>
762         Having the user agent describe its capabilities in every
763         request can be both very inefficient (given that only a small
764         percentage of responses have multiple representations) and a
765         potential violation of the user's privacy.
766    </t>
767    <t>
768         It complicates the implementation of an origin server and the
769         algorithms for generating responses to a request.
770    </t>
771    <t>
772         It may limit a public cache's ability to use the same response
773         for multiple user's requests.
774    </t>
775  </list>
778   HTTP/1.1 includes the following request-header fields for enabling
779   server-driven negotiation through description of user agent
780   capabilities and user preferences: Accept (<xref target="header.accept"/>), Accept-Charset
781   (<xref target="header.accept-charset"/>), Accept-Encoding (<xref target="header.accept-encoding"/>), Accept-Language
782   (<xref target="header.accept-language"/>), and User-Agent (&header-user-agent;). However, an
783   origin server is not limited to these dimensions and &MAY; vary the
784   response based on any aspect of the request, including information
785   outside the request-header fields or within extension header fields
786   not defined by this specification.
789   The Vary header field (&header-vary;) can be used to express the parameters the
790   server uses to select a representation that is subject to server-driven
791   negotiation.
795<section title="Agent-driven Negotiation" anchor="agent-driven.negotiation">
797   With agent-driven negotiation, selection of the best representation
798   for a response is performed by the user agent after receiving an
799   initial response from the origin server. Selection is based on a list
800   of the available representations of the response included within the
801   header fields or entity-body of the initial response, with each
802   representation identified by its own URI. Selection from among the
803   representations may be performed automatically (if the user agent is
804   capable of doing so) or manually by the user selecting from a
805   generated (possibly hypertext) menu.
808   Agent-driven negotiation is advantageous when the response would vary
809   over commonly-used dimensions (such as type, language, or encoding),
810   when the origin server is unable to determine a user agent's
811   capabilities from examining the request, and generally when public
812   caches are used to distribute server load and reduce network usage.
815   Agent-driven negotiation suffers from the disadvantage of needing a
816   second request to obtain the best alternate representation. This
817   second request is only efficient when caching is used. In addition,
818   this specification does not define any mechanism for supporting
819   automatic selection, though it also does not prevent any such
820   mechanism from being developed as an extension and used within
821   HTTP/1.1.
824   HTTP/1.1 defines the 300 (Multiple Choices) and 406 (Not Acceptable)
825   status codes for enabling agent-driven negotiation when the server is
826   unwilling or unable to provide a varying response using server-driven
827   negotiation.
831<section title="Transparent Negotiation" anchor="transparent.negotiation">
833   Transparent negotiation is a combination of both server-driven and
834   agent-driven negotiation. When a cache is supplied with a form of the
835   list of available representations of the response (as in agent-driven
836   negotiation) and the dimensions of variance are completely understood
837   by the cache, then the cache becomes capable of performing server-driven
838   negotiation on behalf of the origin server for subsequent
839   requests on that resource.
842   Transparent negotiation has the advantage of distributing the
843   negotiation work that would otherwise be required of the origin
844   server and also removing the second request delay of agent-driven
845   negotiation when the cache is able to correctly guess the right
846   response.
849   This specification does not define any mechanism for transparent
850   negotiation, though it also does not prevent any such mechanism from
851   being developed as an extension that could be used within HTTP/1.1.
856<section title="Header Field Definitions" anchor="header.fields">
858   This section defines the syntax and semantics of HTTP/1.1 header fields
859   related to the payload of messages.
862   For entity-header fields, both sender and recipient refer to either the
863   client or the server, depending on who sends and who receives the entity.
866<section title="Accept" anchor="header.accept">
867  <iref primary="true" item="Accept header" x:for-anchor=""/>
868  <iref primary="true" item="Headers" subitem="Accept" x:for-anchor=""/>
870   The Accept request-header field can be used to specify certain media
871   types which are acceptable for the response. Accept headers can be
872   used to indicate that the request is specifically limited to a small
873   set of desired types, as in the case of a request for an in-line
874   image.
876<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"/>
877  Accept         = "Accept" ":"
878                   #( media-range [ accept-params ] )
880  media-range    = ( "*/*"
881                   | ( type "/" "*" )
882                   | ( type "/" subtype )
883                   ) *( ";" parameter )
884  accept-params  = ";" "q" "=" qvalue *( accept-extension )
885  accept-extension = ";" token [ "=" ( token | quoted-string ) ]
888   The asterisk "*" character is used to group media types into ranges,
889   with "*/*" indicating all media types and "type/*" indicating all
890   subtypes of that type. The media-range &MAY; include media type
891   parameters that are applicable to that range.
894   Each media-range &MAY; be followed by one or more accept-params,
895   beginning with the "q" parameter for indicating a relative quality
896   factor. The first "q" parameter (if any) separates the media-range
897   parameter(s) from the accept-params. Quality factors allow the user
898   or user agent to indicate the relative degree of preference for that
899   media-range, using the qvalue scale from 0 to 1 (<xref target="quality.values"/>). The
900   default value is q=1.
901  <list><t>
902      <x:h>Note:</x:h> Use of the "q" parameter name to separate media type
903      parameters from Accept extension parameters is due to historical
904      practice. Although this prevents any media type parameter named
905      "q" from being used with a media range, such an event is believed
906      to be unlikely given the lack of any "q" parameters in the IANA
907      media type registry and the rare usage of any media type
908      parameters in Accept. Future media types are discouraged from
909      registering any parameter named "q".
910  </t></list>
913   The example
915<figure><artwork type="example">
916    Accept: audio/*; q=0.2, audio/basic
919   &SHOULD; be interpreted as "I prefer audio/basic, but send me any audio
920   type if it is the best available after an 80% mark-down in quality."
923   If no Accept header field is present, then it is assumed that the
924   client accepts all media types. If an Accept header field is present,
925   and if the server cannot send a response which is acceptable
926   according to the combined Accept field value, then the server &SHOULD;
927   send a 406 (Not Acceptable) response.
930   A more elaborate example is
932<figure><artwork type="example">
933    Accept: text/plain; q=0.5, text/html,
934            text/x-dvi; q=0.8, text/x-c
937   Verbally, this would be interpreted as "text/html and text/x-c are
938   the preferred media types, but if they do not exist, then send the
939   text/x-dvi entity, and if that does not exist, send the text/plain
940   entity."
943   Media ranges can be overridden by more specific media ranges or
944   specific media types. If more than one media range applies to a given
945   type, the most specific reference has precedence. For example,
947<figure><artwork type="example">
948    Accept: text/*, text/html, text/html;level=1, */*
951   have the following precedence:
953<figure><artwork type="example">
954    1) text/html;level=1
955    2) text/html
956    3) text/*
957    4) */*
960   The media type quality factor associated with a given type is
961   determined by finding the media range with the highest precedence
962   which matches that type. For example,
964<figure><artwork type="example">
965    Accept: text/*;q=0.3, text/html;q=0.7, text/html;level=1,
966            text/html;level=2;q=0.4, */*;q=0.5
969   would cause the following values to be associated:
971<figure><artwork type="example">
972    text/html;level=1         = 1
973    text/html                 = 0.7
974    text/plain                = 0.3
975    image/jpeg                = 0.5
976    text/html;level=2         = 0.4
977    text/html;level=3         = 0.7
980      <x:h>Note:</x:h> A user agent might be provided with a default set of quality
981      values for certain media ranges. However, unless the user agent is
982      a closed system which cannot interact with other rendering agents,
983      this default set ought to be configurable by the user.
987<section title="Accept-Charset" anchor="header.accept-charset">
988  <iref primary="true" item="Accept-Charset header" x:for-anchor=""/>
989  <iref primary="true" item="Headers" subitem="Accept-Charset" x:for-anchor=""/>
991   The Accept-Charset request-header field can be used to indicate what
992   character sets are acceptable for the response. This field allows
993   clients capable of understanding more comprehensive or special-purpose
994   character sets to signal that capability to a server which is
995   capable of representing documents in those character sets.
997<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Accept-Charset"/>
998  Accept-Charset = "Accept-Charset" ":"
999          1#( ( charset | "*" ) [ ";" "q" "=" qvalue ] )
1002   Character set values are described in <xref target="character.sets"/>. Each charset &MAY;
1003   be given an associated quality value which represents the user's
1004   preference for that charset. The default value is q=1. An example is
1006<figure><artwork type="example">
1007   Accept-Charset: iso-8859-5, unicode-1-1;q=0.8
1010   The special value "*", if present in the Accept-Charset field,
1011   matches every character set (including ISO-8859-1) which is not
1012   mentioned elsewhere in the Accept-Charset field. If no "*" is present
1013   in an Accept-Charset field, then all character sets not explicitly
1014   mentioned get a quality value of 0, except for ISO-8859-1, which gets
1015   a quality value of 1 if not explicitly mentioned.
1018   If no Accept-Charset header is present, the default is that any
1019   character set is acceptable. If an Accept-Charset header is present,
1020   and if the server cannot send a response which is acceptable
1021   according to the Accept-Charset header, then the server &SHOULD; send
1022   an error response with the 406 (Not Acceptable) status code, though
1023   the sending of an unacceptable response is also allowed.
1027<section title="Accept-Encoding" anchor="header.accept-encoding">
1028  <iref primary="true" item="Accept-Encoding header" x:for-anchor=""/>
1029  <iref primary="true" item="Headers" subitem="Accept-Encoding" x:for-anchor=""/>
1031   The Accept-Encoding request-header field is similar to Accept, but
1032   restricts the content-codings (<xref target="content.codings"/>) that are acceptable in
1033   the response.
1035<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Accept-Encoding"/><iref primary="true" item="Grammar" subitem="codings"/>
1036  Accept-Encoding  = "Accept-Encoding" ":"
1037                     #( codings [ ";" "q" "=" qvalue ] )
1038  codings          = ( content-coding | "*" )
1041   Examples of its use are:
1043<figure><artwork type="example">
1044    Accept-Encoding: compress, gzip
1045    Accept-Encoding:
1046    Accept-Encoding: *
1047    Accept-Encoding: compress;q=0.5, gzip;q=1.0
1048    Accept-Encoding: gzip;q=1.0, identity; q=0.5, *;q=0
1051   A server tests whether a content-coding is acceptable, according to
1052   an Accept-Encoding field, using these rules:
1053  <list style="numbers">
1054      <t>If the content-coding is one of the content-codings listed in
1055         the Accept-Encoding field, then it is acceptable, unless it is
1056         accompanied by a qvalue of 0. (As defined in <xref target="quality.values"/>, a
1057         qvalue of 0 means "not acceptable.")</t>
1059      <t>The special "*" symbol in an Accept-Encoding field matches any
1060         available content-coding not explicitly listed in the header
1061         field.</t>
1063      <t>If multiple content-codings are acceptable, then the acceptable
1064         content-coding with the highest non-zero qvalue is preferred.</t>
1066      <t>The "identity" content-coding is always acceptable, unless
1067         specifically refused because the Accept-Encoding field includes
1068         "identity;q=0", or because the field includes "*;q=0" and does
1069         not explicitly include the "identity" content-coding. If the
1070         Accept-Encoding field-value is empty, then only the "identity"
1071         encoding is acceptable.</t>
1072  </list>
1075   If an Accept-Encoding field is present in a request, and if the
1076   server cannot send a response which is acceptable according to the
1077   Accept-Encoding header, then the server &SHOULD; send an error response
1078   with the 406 (Not Acceptable) status code.
1081   If no Accept-Encoding field is present in a request, the server &MAY;
1082   assume that the client will accept any content coding. In this case,
1083   if "identity" is one of the available content-codings, then the
1084   server &SHOULD; use the "identity" content-coding, unless it has
1085   additional information that a different content-coding is meaningful
1086   to the client.
1087  <list><t>
1088      <x:h>Note:</x:h> If the request does not include an Accept-Encoding field,
1089      and if the "identity" content-coding is unavailable, then
1090      content-codings commonly understood by HTTP/1.0 clients (i.e.,
1091      "gzip" and "compress") are preferred; some older clients
1092      improperly display messages sent with other content-codings.  The
1093      server might also make this decision based on information about
1094      the particular user-agent or client.
1095    </t><t>
1096      <x:h>Note:</x:h> Most HTTP/1.0 applications do not recognize or obey qvalues
1097      associated with content-codings. This means that qvalues will not
1098      work and are not permitted with x-gzip or x-compress.
1099    </t></list>
1103<section title="Accept-Language" anchor="header.accept-language">
1104  <iref primary="true" item="Accept-Language header" x:for-anchor=""/>
1105  <iref primary="true" item="Headers" subitem="Accept-Language" x:for-anchor=""/>
1107   The Accept-Language request-header field is similar to Accept, but
1108   restricts the set of natural languages that are preferred as a
1109   response to the request. Language tags are defined in <xref target="language.tags"/>.
1111<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Accept-Language"/><iref primary="true" item="Grammar" subitem="language-range"/>
1112  Accept-Language = "Accept-Language" ":"
1113                    1#( language-range [ ";" "q" "=" qvalue ] )
1114  language-range  = ( ( 1*8ALPHA *( "-" 1*8ALPHA ) ) | "*" )
1117   Each language-range &MAY; be given an associated quality value which
1118   represents an estimate of the user's preference for the languages
1119   specified by that range. The quality value defaults to "q=1". For
1120   example,
1122<figure><artwork type="example">
1123    Accept-Language: da, en-gb;q=0.8, en;q=0.7
1126   would mean: "I prefer Danish, but will accept British English and
1127   other types of English." A language-range matches a language-tag if
1128   it exactly equals the tag, or if it exactly equals a prefix of the
1129   tag such that the first tag character following the prefix is "-".
1130   The special range "*", if present in the Accept-Language field,
1131   matches every tag not matched by any other range present in the
1132   Accept-Language field.
1133  <list><t>
1134      <x:h>Note:</x:h> This use of a prefix matching rule does not imply that
1135      language tags are assigned to languages in such a way that it is
1136      always true that if a user understands a language with a certain
1137      tag, then this user will also understand all languages with tags
1138      for which this tag is a prefix. The prefix rule simply allows the
1139      use of prefix tags if this is the case.
1140  </t></list>
1143   The language quality factor assigned to a language-tag by the
1144   Accept-Language field is the quality value of the longest language-range
1145   in the field that matches the language-tag. If no language-range
1146   in the field matches the tag, the language quality factor
1147   assigned is 0. If no Accept-Language header is present in the
1148   request, the server
1149   &SHOULD; assume that all languages are equally acceptable. If an
1150   Accept-Language header is present, then all languages which are
1151   assigned a quality factor greater than 0 are acceptable.
1154   It might be contrary to the privacy expectations of the user to send
1155   an Accept-Language header with the complete linguistic preferences of
1156   the user in every request. For a discussion of this issue, see
1157   <xref target=""/>.
1160   As intelligibility is highly dependent on the individual user, it is
1161   recommended that client applications make the choice of linguistic
1162   preference available to the user. If the choice is not made
1163   available, then the Accept-Language header field &MUST-NOT; be given in
1164   the request.
1165  <list><t>
1166      <x:h>Note:</x:h> When making the choice of linguistic preference available to
1167      the user, we remind implementors of  the fact that users are not
1168      familiar with the details of language matching as described above,
1169      and should provide appropriate guidance. As an example, users
1170      might assume that on selecting "en-gb", they will be served any
1171      kind of English document if British English is not available. A
1172      user agent might suggest in such a case to add "en" to get the
1173      best matching behavior.
1174  </t></list>
1178<section title="Content-Encoding" anchor="header.content-encoding">
1179  <iref primary="true" item="Content-Encoding header" x:for-anchor=""/>
1180  <iref primary="true" item="Headers" subitem="Content-Encoding" x:for-anchor=""/>
1182   The Content-Encoding entity-header field is used as a modifier to the
1183   media-type. When present, its value indicates what additional content
1184   codings have been applied to the entity-body, and thus what decoding
1185   mechanisms must be applied in order to obtain the media-type
1186   referenced by the Content-Type header field. Content-Encoding is
1187   primarily used to allow a document to be compressed without losing
1188   the identity of its underlying media type.
1190<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Encoding"/>
1191  Content-Encoding  = "Content-Encoding" ":" 1#content-coding
1194   Content codings are defined in <xref target="content.codings"/>. An example of its use is
1196<figure><artwork type="example">
1197    Content-Encoding: gzip
1200   The content-coding is a characteristic of the entity identified by
1201   the Request-URI. Typically, the entity-body is stored with this
1202   encoding and is only decoded before rendering or analogous usage.
1203   However, a non-transparent proxy &MAY; modify the content-coding if the
1204   new coding is known to be acceptable to the recipient, unless the
1205   "no-transform" cache-control directive is present in the message.
1208   If the content-coding of an entity is not "identity", then the
1209   response &MUST; include a Content-Encoding entity-header (<xref target="header.content-encoding"/>)
1210   that lists the non-identity content-coding(s) used.
1213   If the content-coding of an entity in a request message is not
1214   acceptable to the origin server, the server &SHOULD; respond with a
1215   status code of 415 (Unsupported Media Type).
1218   If multiple encodings have been applied to an entity, the content
1219   codings &MUST; be listed in the order in which they were applied.
1220   Additional information about the encoding parameters &MAY; be provided
1221   by other entity-header fields not defined by this specification.
1225<section title="Content-Language" anchor="header.content-language">
1226  <iref primary="true" item="Content-Language header" x:for-anchor=""/>
1227  <iref primary="true" item="Headers" subitem="Content-Language" x:for-anchor=""/>
1229   The Content-Language entity-header field describes the natural
1230   language(s) of the intended audience for the enclosed entity. Note
1231   that this might not be equivalent to all the languages used within
1232   the entity-body.
1234<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Language"/>
1235  Content-Language  = "Content-Language" ":" 1#language-tag
1238   Language tags are defined in <xref target="language.tags"/>. The primary purpose of
1239   Content-Language is to allow a user to identify and differentiate
1240   entities according to the user's own preferred language. Thus, if the
1241   body content is intended only for a Danish-literate audience, the
1242   appropriate field is
1244<figure><artwork type="example">
1245    Content-Language: da
1248   If no Content-Language is specified, the default is that the content
1249   is intended for all language audiences. This might mean that the
1250   sender does not consider it to be specific to any natural language,
1251   or that the sender does not know for which language it is intended.
1254   Multiple languages &MAY; be listed for content that is intended for
1255   multiple audiences. For example, a rendition of the "Treaty of
1256   Waitangi," presented simultaneously in the original Maori and English
1257   versions, would call for
1259<figure><artwork type="example">
1260    Content-Language: mi, en
1263   However, just because multiple languages are present within an entity
1264   does not mean that it is intended for multiple linguistic audiences.
1265   An example would be a beginner's language primer, such as "A First
1266   Lesson in Latin," which is clearly intended to be used by an
1267   English-literate audience. In this case, the Content-Language would
1268   properly only include "en".
1271   Content-Language &MAY; be applied to any media type -- it is not
1272   limited to textual documents.
1276<section title="Content-Location" anchor="header.content-location">
1277  <iref primary="true" item="Content-Location header" x:for-anchor=""/>
1278  <iref primary="true" item="Headers" subitem="Content-Location" x:for-anchor=""/>
1280   The Content-Location entity-header field &MAY; be used to supply the
1281   resource location for the entity enclosed in the message when that
1282   entity is accessible from a location separate from the requested
1283   resource's URI. A server &SHOULD; provide a Content-Location for the
1284   variant corresponding to the response entity; especially in the case
1285   where a resource has multiple entities associated with it, and those
1286   entities actually have separate locations by which they might be
1287   individually accessed, the server &SHOULD; provide a Content-Location
1288   for the particular variant which is returned.
1290<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Location"/>
1291  Content-Location = "Content-Location" ":"
1292                    ( absoluteURI | relativeURI )
1295   The value of Content-Location also defines the base URI for the
1296   entity.
1299   The Content-Location value is not a replacement for the original
1300   requested URI; it is only a statement of the location of the resource
1301   corresponding to this particular entity at the time of the request.
1302   Future requests &MAY; specify the Content-Location URI as the request-URI
1303   if the desire is to identify the source of that particular
1304   entity.
1307   A cache cannot assume that an entity with a Content-Location
1308   different from the URI used to retrieve it can be used to respond to
1309   later requests on that Content-Location URI. However, the Content-Location
1310   can be used to differentiate between multiple entities
1311   retrieved from a single requested resource, as described in &caching-neg-resp;.
1314   If the Content-Location is a relative URI, the relative URI is
1315   interpreted relative to the Request-URI.
1318   The meaning of the Content-Location header in PUT or POST requests is
1319   undefined; servers are free to ignore it in those cases.
1323<section title="Content-MD5" anchor="header.content-md5">
1324  <iref primary="true" item="Content-MD5 header" x:for-anchor=""/>
1325  <iref primary="true" item="Headers" subitem="Content-MD5" x:for-anchor=""/>
1327   The Content-MD5 entity-header field, as defined in <xref target="RFC1864"/>, is
1328   an MD5 digest of the entity-body for the purpose of providing an
1329   end-to-end message integrity check (MIC) of the entity-body. (Note: a
1330   MIC is good for detecting accidental modification of the entity-body
1331   in transit, but is not proof against malicious attacks.)
1333<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-MD5"/><iref primary="true" item="Grammar" subitem="md5-digest"/>
1334  Content-MD5   = "Content-MD5" ":" md5-digest
1335  md5-digest    = &lt;base64 of 128 bit MD5 digest as per <xref target="RFC1864"/>&gt;
1338   The Content-MD5 header field &MAY; be generated by an origin server or
1339   client to function as an integrity check of the entity-body. Only
1340   origin servers or clients &MAY; generate the Content-MD5 header field;
1341   proxies and gateways &MUST-NOT; generate it, as this would defeat its
1342   value as an end-to-end integrity check. Any recipient of the entity-body,
1343   including gateways and proxies, &MAY; check that the digest value
1344   in this header field matches that of the entity-body as received.
1347   The MD5 digest is computed based on the content of the entity-body,
1348   including any content-coding that has been applied, but not including
1349   any transfer-encoding applied to the message-body. If the message is
1350   received with a transfer-encoding, that encoding &MUST; be removed
1351   prior to checking the Content-MD5 value against the received entity.
1354   This has the result that the digest is computed on the octets of the
1355   entity-body exactly as, and in the order that, they would be sent if
1356   no transfer-encoding were being applied.
1359   HTTP extends RFC 1864 to permit the digest to be computed for MIME
1360   composite media-types (e.g., multipart/* and message/rfc822), but
1361   this does not change how the digest is computed as defined in the
1362   preceding paragraph.
1365   There are several consequences of this. The entity-body for composite
1366   types &MAY; contain many body-parts, each with its own MIME and HTTP
1367   headers (including Content-MD5, Content-Transfer-Encoding, and
1368   Content-Encoding headers). If a body-part has a Content-Transfer-Encoding
1369   or Content-Encoding header, it is assumed that the content
1370   of the body-part has had the encoding applied, and the body-part is
1371   included in the Content-MD5 digest as is -- i.e., after the
1372   application. The Transfer-Encoding header field is not allowed within
1373   body-parts.
1376   Conversion of all line breaks to CRLF &MUST-NOT; be done before
1377   computing or checking the digest: the line break convention used in
1378   the text actually transmitted &MUST; be left unaltered when computing
1379   the digest.
1380  <list><t>
1381      <x:h>Note:</x:h> while the definition of Content-MD5 is exactly the same for
1382      HTTP as in RFC 1864 for MIME entity-bodies, there are several ways
1383      in which the application of Content-MD5 to HTTP entity-bodies
1384      differs from its application to MIME entity-bodies. One is that
1385      HTTP, unlike MIME, does not use Content-Transfer-Encoding, and
1386      does use Transfer-Encoding and Content-Encoding. Another is that
1387      HTTP more frequently uses binary content types than MIME, so it is
1388      worth noting that, in such cases, the byte order used to compute
1389      the digest is the transmission byte order defined for the type.
1390      Lastly, HTTP allows transmission of text types with any of several
1391      line break conventions and not just the canonical form using CRLF.
1392  </t></list>
1396<section title="Content-Type" anchor="header.content-type">
1397  <iref primary="true" item="Content-Type header" x:for-anchor=""/>
1398  <iref primary="true" item="Headers" subitem="Content-Type" x:for-anchor=""/>
1400   The Content-Type entity-header field indicates the media type of the
1401   entity-body sent to the recipient or, in the case of the HEAD method,
1402   the media type that would have been sent had the request been a GET.
1404<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Type"/>
1405  Content-Type   = "Content-Type" ":" media-type
1408   Media types are defined in <xref target="media.types"/>. An example of the field is
1410<figure><artwork type="example">
1411    Content-Type: text/html; charset=ISO-8859-4
1414   Further discussion of methods for identifying the media type of an
1415   entity is provided in <xref target="type"/>.
1421<section title="IANA Considerations" anchor="IANA.considerations">
1423   <cref>TBD.</cref>
1427<section title="Security Considerations" anchor="security.considerations">
1429   This section is meant to inform application developers, information
1430   providers, and users of the security limitations in HTTP/1.1 as
1431   described by this document. The discussion does not include
1432   definitive solutions to the problems revealed, though it does make
1433   some suggestions for reducing security risks.
1436  <cref anchor="sec.charset.sniffing">
1437    Point out the risks related to character set sniffing, in particular for
1438    UTF-7. See <eref target=""/>.
1439  </cref>
1442<section title="Privacy Issues Connected to Accept Headers" anchor="">
1444   Accept request-headers can reveal information about the user to all
1445   servers which are accessed. The Accept-Language header in particular
1446   can reveal information the user would consider to be of a private
1447   nature, because the understanding of particular languages is often
1448   strongly correlated to the membership of a particular ethnic group.
1449   User agents which offer the option to configure the contents of an
1450   Accept-Language header to be sent in every request are strongly
1451   encouraged to let the configuration process include a message which
1452   makes the user aware of the loss of privacy involved.
1455   An approach that limits the loss of privacy would be for a user agent
1456   to omit the sending of Accept-Language headers by default, and to ask
1457   the user whether or not to start sending Accept-Language headers to a
1458   server if it detects, by looking for any Vary response-header fields
1459   generated by the server, that such sending could improve the quality
1460   of service.
1463   Elaborate user-customized accept header fields sent in every request,
1464   in particular if these include quality values, can be used by servers
1465   as relatively reliable and long-lived user identifiers. Such user
1466   identifiers would allow content providers to do click-trail tracking,
1467   and would allow collaborating content providers to match cross-server
1468   click-trails or form submissions of individual users. Note that for
1469   many users not behind a proxy, the network address of the host
1470   running the user agent will also serve as a long-lived user
1471   identifier. In environments where proxies are used to enhance
1472   privacy, user agents ought to be conservative in offering accept
1473   header configuration options to end users. As an extreme privacy
1474   measure, proxies could filter the accept headers in relayed requests.
1475   General purpose user agents which provide a high degree of header
1476   configurability &SHOULD; warn users about the loss of privacy which can
1477   be involved.
1481<section title="Content-Disposition Issues" anchor="content-disposition.issues">
1483   <xref target="RFC1806"/>, from which the often implemented Content-Disposition
1484   (see <xref target="content-disposition"/>) header in HTTP is derived, has a number of very
1485   serious security considerations. Content-Disposition is not part of
1486   the HTTP standard, but since it is widely implemented, we are
1487   documenting its use and risks for implementors. See <xref target="RFC2183"/>
1488   (which updates <xref target="RFC1806"/>) for details.
1494<section title="Acknowledgments" anchor="ack">
1499<references title="Normative References">
1501<reference anchor="ISO-8859-1">
1502  <front>
1503    <title>
1504     Information technology -- 8-bit single-byte coded graphic character sets -- Part 1: Latin alphabet No. 1
1505    </title>
1506    <author>
1507      <organization>International Organization for Standardization</organization>
1508    </author>
1509    <date year="1998"/>
1510  </front>
1511  <seriesInfo name="ISO/IEC" value="8859-1:1998"/>
1514<reference anchor="Part1">
1515  <front>
1516    <title abbrev="HTTP/1.1">HTTP/1.1, part 1: URIs, Connections, and Message Parsing</title>
1517    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
1518      <organization abbrev="Day Software">Day Software</organization>
1519      <address><email></email></address>
1520    </author>
1521    <author initials="J." surname="Gettys" fullname="Jim Gettys">
1522      <organization>One Laptop per Child</organization>
1523      <address><email></email></address>
1524    </author>
1525    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
1526      <organization abbrev="HP">Hewlett-Packard Company</organization>
1527      <address><email></email></address>
1528    </author>
1529    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
1530      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1531      <address><email></email></address>
1532    </author>
1533    <author initials="L." surname="Masinter" fullname="Larry Masinter">
1534      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
1535      <address><email></email></address>
1536    </author>
1537    <author initials="P." surname="Leach" fullname="Paul J. Leach">
1538      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1539      <address><email></email></address>
1540    </author>
1541    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1542      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
1543      <address><email></email></address>
1544    </author>
1545    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
1546      <organization abbrev="W3C">World Wide Web Consortium</organization>
1547      <address><email></email></address>
1548    </author>
1549    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1550      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1551      <address><email></email></address>
1552    </author>
1553    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
1554  </front>
1555  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p1-messaging-&ID-VERSION;"/>
1556  <x:source href="p1-messaging.xml" basename="p1-messaging"/>
1559<reference anchor="Part2">
1560  <front>
1561    <title abbrev="HTTP/1.1">HTTP/1.1, part 2: Message Semantics</title>
1562    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
1563      <organization abbrev="Day Software">Day Software</organization>
1564      <address><email></email></address>
1565    </author>
1566    <author initials="J." surname="Gettys" fullname="Jim Gettys">
1567      <organization>One Laptop per Child</organization>
1568      <address><email></email></address>
1569    </author>
1570    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
1571      <organization abbrev="HP">Hewlett-Packard Company</organization>
1572      <address><email></email></address>
1573    </author>
1574    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
1575      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1576      <address><email></email></address>
1577    </author>
1578    <author initials="L." surname="Masinter" fullname="Larry Masinter">
1579      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
1580      <address><email></email></address>
1581    </author>
1582    <author initials="P." surname="Leach" fullname="Paul J. Leach">
1583      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1584      <address><email></email></address>
1585    </author>
1586    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1587      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
1588      <address><email></email></address>
1589    </author>
1590    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
1591      <organization abbrev="W3C">World Wide Web Consortium</organization>
1592      <address><email></email></address>
1593    </author>
1594    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1595      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1596      <address><email></email></address>
1597    </author>
1598    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
1599  </front>
1600  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p2-semantics-&ID-VERSION;"/>
1601  <x:source href="p2-semantics.xml" basename="p2-semantics"/>
1604<reference anchor="Part4">
1605  <front>
1606    <title abbrev="HTTP/1.1">HTTP/1.1, part 4: Conditional Requests</title>
1607    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
1608      <organization abbrev="Day Software">Day Software</organization>
1609      <address><email></email></address>
1610    </author>
1611    <author initials="J." surname="Gettys" fullname="Jim Gettys">
1612      <organization>One Laptop per Child</organization>
1613      <address><email></email></address>
1614    </author>
1615    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
1616      <organization abbrev="HP">Hewlett-Packard Company</organization>
1617      <address><email></email></address>
1618    </author>
1619    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
1620      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1621      <address><email></email></address>
1622    </author>
1623    <author initials="L." surname="Masinter" fullname="Larry Masinter">
1624      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
1625      <address><email></email></address>
1626    </author>
1627    <author initials="P." surname="Leach" fullname="Paul J. Leach">
1628      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1629      <address><email></email></address>
1630    </author>
1631    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1632      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
1633      <address><email></email></address>
1634    </author>
1635    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
1636      <organization abbrev="W3C">World Wide Web Consortium</organization>
1637      <address><email></email></address>
1638    </author>
1639    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1640      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1641      <address><email></email></address>
1642    </author>
1643    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
1644  </front>
1645  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p4-conditional-&ID-VERSION;"/>
1646  <x:source href="p4-conditional.xml" basename="p4-conditional"/>
1649<reference anchor="Part5">
1650  <front>
1651    <title abbrev="HTTP/1.1">HTTP/1.1, part 5: Range Requests and Partial Responses</title>
1652    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
1653      <organization abbrev="Day Software">Day Software</organization>
1654      <address><email></email></address>
1655    </author>
1656    <author initials="J." surname="Gettys" fullname="Jim Gettys">
1657      <organization>One Laptop per Child</organization>
1658      <address><email></email></address>
1659    </author>
1660    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
1661      <organization abbrev="HP">Hewlett-Packard Company</organization>
1662      <address><email></email></address>
1663    </author>
1664    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
1665      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1666      <address><email></email></address>
1667    </author>
1668    <author initials="L." surname="Masinter" fullname="Larry Masinter">
1669      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
1670      <address><email></email></address>
1671    </author>
1672    <author initials="P." surname="Leach" fullname="Paul J. Leach">
1673      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1674      <address><email></email></address>
1675    </author>
1676    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1677      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
1678      <address><email></email></address>
1679    </author>
1680    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
1681      <organization abbrev="W3C">World Wide Web Consortium</organization>
1682      <address><email></email></address>
1683    </author>
1684    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1685      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1686      <address><email></email></address>
1687    </author>
1688    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
1689  </front>
1690  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p5-range-&ID-VERSION;"/>
1691  <x:source href="p5-range.xml" basename="p5-range"/>
1694<reference anchor="Part6">
1695  <front>
1696    <title abbrev="HTTP/1.1">HTTP/1.1, part 6: Caching</title>
1697    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
1698      <organization abbrev="Day Software">Day Software</organization>
1699      <address><email></email></address>
1700    </author>
1701    <author initials="J." surname="Gettys" fullname="Jim Gettys">
1702      <organization>One Laptop per Child</organization>
1703      <address><email></email></address>
1704    </author>
1705    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
1706      <organization abbrev="HP">Hewlett-Packard Company</organization>
1707      <address><email></email></address>
1708    </author>
1709    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
1710      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1711      <address><email></email></address>
1712    </author>
1713    <author initials="L." surname="Masinter" fullname="Larry Masinter">
1714      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
1715      <address><email></email></address>
1716    </author>
1717    <author initials="P." surname="Leach" fullname="Paul J. Leach">
1718      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1719      <address><email></email></address>
1720    </author>
1721    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1722      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
1723      <address><email></email></address>
1724    </author>
1725    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
1726      <organization abbrev="W3C">World Wide Web Consortium</organization>
1727      <address><email></email></address>
1728    </author>
1729    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1730      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1731      <address><email></email></address>
1732    </author>
1733    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
1734  </front>
1735  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p6-cache-&ID-VERSION;"/>
1736  <x:source href="p6-cache.xml" basename="p6-cache"/>
1739<reference anchor="RFC1766">
1740  <front>
1741    <title abbrev="Language Tag">Tags for the Identification of Languages</title>
1742    <author initials="H." surname="Alvestrand" fullname="Harald Tveit Alvestrand">
1743      <organization>UNINETT</organization>
1744      <address><email></email></address>
1745    </author>
1746    <date month="March" year="1995"/>
1747  </front>
1748  <seriesInfo name="RFC" value="1766"/>
1751<reference anchor="RFC1864">
1752  <front>
1753    <title abbrev="Content-MD5 Header Field">The Content-MD5 Header Field</title>
1754    <author initials="J." surname="Myers" fullname="John G. Myers">
1755      <organization>Carnegie Mellon University</organization>
1756      <address><email></email></address>
1757    </author>
1758    <author initials="M." surname="Rose" fullname="Marshall T. Rose">
1759      <organization>Dover Beach Consulting, Inc.</organization>
1760      <address><email></email></address>
1761    </author>
1762    <date month="October" year="1995"/>
1763  </front>
1764  <seriesInfo name="RFC" value="1864"/>
1767<reference anchor="RFC1950">
1768  <front>
1769    <title>ZLIB Compressed Data Format Specification version 3.3</title>
1770    <author initials="L.P." surname="Deutsch" fullname="L. Peter Deutsch">
1771      <organization>Aladdin Enterprises</organization>
1772      <address><email></email></address>
1773    </author>
1774    <author initials="J-L." surname="Gailly" fullname="Jean-Loup Gailly">
1775      <organization/>
1776    </author>
1777    <date month="May" year="1996"/>
1778  </front>
1779  <seriesInfo name="RFC" value="1950"/>
1780  <annotation>
1781    RFC1950 is an Informational RFC, thus it may be less stable than
1782    this specification. On the other hand, this downward reference was
1783    present since <xref target="RFC2068"/> (published in 1997), therefore it is unlikely
1784    to cause problems in practice.
1785  </annotation>
1788<reference anchor="RFC1951">
1789  <front>
1790    <title>DEFLATE Compressed Data Format Specification version 1.3</title>
1791    <author initials="P." surname="Deutsch" fullname="L. Peter Deutsch">
1792      <organization>Aladdin Enterprises</organization>
1793      <address><email></email></address>
1794    </author>
1795    <date month="May" year="1996"/>
1796  </front>
1797  <seriesInfo name="RFC" value="1951"/>
1798  <annotation>
1799    RFC1951 is an Informational RFC, thus it may be less stable than
1800    this specification. On the other hand, this downward reference was
1801    present since <xref target="RFC2068"/> (published in 1997), therefore it is unlikely
1802    to cause problems in practice.
1803  </annotation>
1806<reference anchor="RFC1952">
1807  <front>
1808    <title>GZIP file format specification version 4.3</title>
1809    <author initials="P." surname="Deutsch" fullname="L. Peter Deutsch">
1810      <organization>Aladdin Enterprises</organization>
1811      <address><email></email></address>
1812    </author>
1813    <author initials="J-L." surname="Gailly" fullname="Jean-Loup Gailly">
1814      <organization/>
1815      <address><email></email></address>
1816    </author>
1817    <author initials="M." surname="Adler" fullname="Mark Adler">
1818      <organization/>
1819      <address><email></email></address>
1820    </author>
1821    <author initials="L.P." surname="Deutsch" fullname="L. Peter Deutsch">
1822      <organization/>
1823      <address><email></email></address>
1824    </author>
1825    <author initials="G." surname="Randers-Pehrson" fullname="Glenn Randers-Pehrson">
1826      <organization/>
1827      <address><email></email></address>
1828    </author>
1829    <date month="May" year="1996"/>
1830  </front>
1831  <seriesInfo name="RFC" value="1952"/>
1832  <annotation>
1833    RFC1952 is an Informational RFC, thus it may be less stable than
1834    this specification. On the other hand, this downward reference was
1835    present since <xref target="RFC2068"/> (published in 1997), therefore it is unlikely
1836    to cause problems in practice.
1837  </annotation>
1840<reference anchor="RFC2045">
1841  <front>
1842    <title abbrev="Internet Message Bodies">Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies</title>
1843    <author initials="N." surname="Freed" fullname="Ned Freed">
1844      <organization>Innosoft International, Inc.</organization>
1845      <address><email></email></address>
1846    </author>
1847    <author initials="N.S." surname="Borenstein" fullname="Nathaniel S. Borenstein">
1848      <organization>First Virtual Holdings</organization>
1849      <address><email></email></address>
1850    </author>
1851    <date month="November" year="1996"/>
1852  </front>
1853  <seriesInfo name="RFC" value="2045"/>
1856<reference anchor="RFC2046">
1857  <front>
1858    <title abbrev="Media Types">Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types</title>
1859    <author initials="N." surname="Freed" fullname="Ned Freed">
1860      <organization>Innosoft International, Inc.</organization>
1861      <address><email></email></address>
1862    </author>
1863    <author initials="N." surname="Borenstein" fullname="Nathaniel S. Borenstein">
1864      <organization>First Virtual Holdings</organization>
1865      <address><email></email></address>
1866    </author>
1867    <date month="November" year="1996"/>
1868  </front>
1869  <seriesInfo name="RFC" value="2046"/>
1872<reference anchor="RFC2119">
1873  <front>
1874    <title>Key words for use in RFCs to Indicate Requirement Levels</title>
1875    <author initials="S." surname="Bradner" fullname="Scott Bradner">
1876      <organization>Harvard University</organization>
1877      <address><email></email></address>
1878    </author>
1879    <date month="March" year="1997"/>
1880  </front>
1881  <seriesInfo name="BCP" value="14"/>
1882  <seriesInfo name="RFC" value="2119"/>
1887<references title="Informative References">
1889<reference anchor="RFC1806">
1890  <front>
1891    <title abbrev="Content-Disposition">Communicating Presentation Information in Internet Messages: The Content-Disposition Header</title>
1892    <author initials="R." surname="Troost" fullname="Rens Troost">
1893      <organization>New Century Systems</organization>
1894      <address><email></email></address>
1895    </author>
1896    <author initials="S." surname="Dorner" fullname="Steve Dorner">
1897      <organization>QUALCOMM Incorporated</organization>
1898      <address><email></email></address>
1899    </author>
1900    <date month="June" year="1995"/>
1901  </front>
1902  <seriesInfo name="RFC" value="1806"/>
1905<reference anchor="RFC1945">
1906  <front>
1907    <title abbrev="HTTP/1.0">Hypertext Transfer Protocol -- HTTP/1.0</title>
1908    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1909      <organization>MIT, Laboratory for Computer Science</organization>
1910      <address><email></email></address>
1911    </author>
1912    <author initials="R.T." surname="Fielding" fullname="Roy T. Fielding">
1913      <organization>University of California, Irvine, Department of Information and Computer Science</organization>
1914      <address><email></email></address>
1915    </author>
1916    <author initials="H.F." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
1917      <organization>W3 Consortium, MIT Laboratory for Computer Science</organization>
1918      <address><email></email></address>
1919    </author>
1920    <date month="May" year="1996"/>
1921  </front>
1922  <seriesInfo name="RFC" value="1945"/>
1925<reference anchor="RFC2049">
1926  <front>
1927    <title abbrev="MIME Conformance">Multipurpose Internet Mail Extensions (MIME) Part Five: Conformance Criteria and Examples</title>
1928    <author initials="N." surname="Freed" fullname="Ned Freed">
1929      <organization>Innosoft International, Inc.</organization>
1930      <address><email></email></address>
1931    </author>
1932    <author initials="N.S." surname="Borenstein" fullname="Nathaniel S. Borenstein">
1933      <organization>First Virtual Holdings</organization>
1934      <address><email></email></address>
1935    </author>
1936    <date month="November" year="1996"/>
1937  </front>
1938  <seriesInfo name="RFC" value="2049"/>
1941<reference anchor="RFC2068">
1942  <front>
1943    <title abbrev="HTTP/1.1">Hypertext Transfer Protocol -- HTTP/1.1</title>
1944    <author initials="R." surname="Fielding" fullname="Roy T. Fielding">
1945      <organization>University of California, Irvine, Department of Information and Computer Science</organization>
1946      <address><email></email></address>
1947    </author>
1948    <author initials="J." surname="Gettys" fullname="Jim Gettys">
1949      <organization>MIT Laboratory for Computer Science</organization>
1950      <address><email></email></address>
1951    </author>
1952    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
1953      <organization>Digital Equipment Corporation, Western Research Laboratory</organization>
1954      <address><email></email></address>
1955    </author>
1956    <author initials="H." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
1957      <organization>MIT Laboratory for Computer Science</organization>
1958      <address><email></email></address>
1959    </author>
1960    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1961      <organization>MIT Laboratory for Computer Science</organization>
1962      <address><email></email></address>
1963    </author>
1964    <date month="January" year="1997"/>
1965  </front>
1966  <seriesInfo name="RFC" value="2068"/>
1969<reference anchor="RFC2076">
1970  <front>
1971    <title abbrev="Internet Message Headers">Common Internet Message Headers</title>
1972    <author initials="J." surname="Palme" fullname="Jacob Palme">
1973      <organization>Stockholm University/KTH</organization>
1974      <address><email></email></address>
1975    </author>
1976    <date month="February" year="1997"/>
1977  </front>
1978  <seriesInfo name="RFC" value="2076"/>
1981<reference anchor="RFC2183">
1982  <front>
1983    <title abbrev="Content-Disposition">Communicating Presentation Information in Internet Messages: The Content-Disposition Header Field</title>
1984    <author initials="R." surname="Troost" fullname="Rens Troost">
1985      <organization>New Century Systems</organization>
1986      <address><email></email></address>
1987    </author>
1988    <author initials="S." surname="Dorner" fullname="Steve Dorner">
1989      <organization>QUALCOMM Incorporated</organization>
1990      <address><email></email></address>
1991    </author>
1992    <author initials="K." surname="Moore" fullname="Keith Moore">
1993      <organization>Department of Computer Science</organization>
1994      <address><email></email></address>
1995    </author>
1996    <date month="August" year="1997"/>
1997  </front>
1998  <seriesInfo name="RFC" value="2183"/>
2001<reference anchor="RFC2277">
2002  <front>
2003    <title abbrev="Charset Policy">IETF Policy on Character Sets and Languages</title>
2004    <author initials="H.T." surname="Alvestrand" fullname="Harald Tveit Alvestrand">
2005      <organization>UNINETT</organization>
2006      <address><email></email></address>
2007    </author>
2008    <date month="January" year="1998"/>
2009  </front>
2010  <seriesInfo name="BCP" value="18"/>
2011  <seriesInfo name="RFC" value="2277"/>
2014<reference anchor="RFC2388">
2015  <front>
2016    <title abbrev="multipart/form-data">Returning Values from Forms:  multipart/form-data</title>
2017    <author initials="L." surname="Masinter" fullname="Larry Masinter">
2018      <organization>Xerox Palo Alto Research Center</organization>
2019      <address><email></email></address>
2020    </author>
2021    <date year="1998" month="August"/>
2022  </front>
2023  <seriesInfo name="RFC" value="2388"/>
2026<reference anchor="RFC2557">
2027  <front>
2028    <title abbrev="MIME Encapsulation of Aggregate Documents">MIME Encapsulation of Aggregate Documents, such as HTML (MHTML)</title>
2029    <author initials="F." surname="Palme" fullname="Jacob Palme">
2030      <organization>Stockholm University and KTH</organization>
2031      <address><email></email></address>
2032    </author>
2033    <author initials="A." surname="Hopmann" fullname="Alex Hopmann">
2034      <organization>Microsoft Corporation</organization>
2035      <address><email></email></address>
2036    </author>
2037    <author initials="N." surname="Shelness" fullname="Nick Shelness">
2038      <organization>Lotus Development Corporation</organization>
2039      <address><email></email></address>
2040    </author>
2041    <author initials="E." surname="Stefferud" fullname="Einar Stefferud">
2042      <organization/>
2043      <address><email></email></address>
2044    </author>
2045    <date year="1999" month="March"/>
2046  </front>
2047  <seriesInfo name="RFC" value="2557"/>
2050<reference anchor="RFC2616">
2051  <front>
2052    <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
2053    <author initials="R." surname="Fielding" fullname="R. Fielding">
2054      <organization>University of California, Irvine</organization>
2055      <address><email></email></address>
2056    </author>
2057    <author initials="J." surname="Gettys" fullname="J. Gettys">
2058      <organization>W3C</organization>
2059      <address><email></email></address>
2060    </author>
2061    <author initials="J." surname="Mogul" fullname="J. Mogul">
2062      <organization>Compaq Computer Corporation</organization>
2063      <address><email></email></address>
2064    </author>
2065    <author initials="H." surname="Frystyk" fullname="H. Frystyk">
2066      <organization>MIT Laboratory for Computer Science</organization>
2067      <address><email></email></address>
2068    </author>
2069    <author initials="L." surname="Masinter" fullname="L. Masinter">
2070      <organization>Xerox Corporation</organization>
2071      <address><email></email></address>
2072    </author>
2073    <author initials="P." surname="Leach" fullname="P. Leach">
2074      <organization>Microsoft Corporation</organization>
2075      <address><email></email></address>
2076    </author>
2077    <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
2078      <organization>W3C</organization>
2079      <address><email></email></address>
2080    </author>
2081    <date month="June" year="1999"/>
2082  </front>
2083  <seriesInfo name="RFC" value="2616"/>
2086<reference anchor="RFC2822">
2087  <front>
2088    <title>Internet Message Format</title>
2089    <author initials="P." surname="Resnick" fullname="P. Resnick">
2090      <organization>QUALCOMM Incorporated</organization>
2091    </author>
2092    <date year="2001" month="April"/>
2093  </front>
2094  <seriesInfo name="RFC" value="2822"/>
2097<reference anchor="RFC3629">
2098  <front>
2099    <title>UTF-8, a transformation format of ISO 10646</title>
2100    <author initials="F." surname="Yergeau" fullname="F. Yergeau">
2101      <organization>Alis Technologies</organization>
2102      <address><email></email></address>
2103    </author>
2104    <date month="November" year="2003"/>
2105  </front>
2106  <seriesInfo name="RFC" value="3629"/>
2107  <seriesInfo name="STD" value="63"/>
2110<reference anchor="RFC4288">
2111  <front>
2112    <title>Media Type Specifications and Registration Procedures</title>
2113    <author initials="N." surname="Freed" fullname="N. Freed">
2114      <organization>Sun Microsystems</organization>
2115      <address>
2116        <email></email>
2117      </address>
2118    </author>
2119    <author initials="J." surname="Klensin" fullname="J. Klensin">
2120      <organization/>
2121      <address>
2122        <email></email>
2123      </address>
2124    </author>
2125    <date year="2005" month="December"/>
2126  </front>
2127  <seriesInfo name="BCP" value="13"/>
2128  <seriesInfo name="RFC" value="4288"/>
2133<section title="Differences Between HTTP Entities and RFC 2045 Entities" anchor="differences.between.http.entities.and.rfc.2045.entities">
2135   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
2136   allow entities to be transmitted in an open variety of
2137   representations and with extensible mechanisms. However, RFC 2045
2138   discusses mail, and HTTP has a few features that are different from
2139   those described in RFC 2045. These differences were carefully chosen
2140   to optimize performance over binary connections, to allow greater
2141   freedom in the use of new media types, to make date comparisons
2142   easier, and to acknowledge the practice of some early HTTP servers
2143   and clients.
2146   This appendix describes specific areas where HTTP differs from RFC
2147   2045. Proxies and gateways to strict MIME environments &SHOULD; be
2148   aware of these differences and provide the appropriate conversions
2149   where necessary. Proxies and gateways from MIME environments to HTTP
2150   also need to be aware of the differences because some conversions
2151   might be required.
2153<section title="MIME-Version" anchor="mime-version">
2155   HTTP is not a MIME-compliant protocol. However, HTTP/1.1 messages &MAY;
2156   include a single MIME-Version general-header field to indicate what
2157   version of the MIME protocol was used to construct the message. Use
2158   of the MIME-Version header field indicates that the message is in
2159   full compliance with the MIME protocol (as defined in <xref target="RFC2045"/>).
2160   Proxies/gateways are responsible for ensuring full compliance (where
2161   possible) when exporting HTTP messages to strict MIME environments.
2163<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="MIME-Version"/>
2164  MIME-Version   = "MIME-Version" ":" 1*DIGIT "." 1*DIGIT
2167   MIME version "1.0" is the default for use in HTTP/1.1. However,
2168   HTTP/1.1 message parsing and semantics are defined by this document
2169   and not the MIME specification.
2173<section title="Conversion to Canonical Form" anchor="">
2175   <xref target="RFC2045"/> requires that an Internet mail entity be converted to
2176   canonical form prior to being transferred, as described in <xref target="RFC2049" x:fmt="of" x:sec="4"/>.
2177   <xref target="canonicalization.and.text.defaults"/> of this document describes the forms
2178   allowed for subtypes of the "text" media type when transmitted over
2179   HTTP. <xref target="RFC2046"/> requires that content with a type of "text" represent
2180   line breaks as CRLF and forbids the use of CR or LF outside of line
2181   break sequences. HTTP allows CRLF, bare CR, and bare LF to indicate a
2182   line break within text content when a message is transmitted over
2183   HTTP.
2186   Where it is possible, a proxy or gateway from HTTP to a strict MIME
2187   environment &SHOULD; translate all line breaks within the text media
2188   types described in <xref target="canonicalization.and.text.defaults"/> of this document to the RFC 2049
2189   canonical form of CRLF. Note, however, that this might be complicated
2190   by the presence of a Content-Encoding and by the fact that HTTP
2191   allows the use of some character sets which do not use octets 13 and
2192   10 to represent CR and LF, as is the case for some multi-byte
2193   character sets.
2196   Implementors should note that conversion will break any cryptographic
2197   checksums applied to the original content unless the original content
2198   is already in canonical form. Therefore, the canonical form is
2199   recommended for any content that uses such checksums in HTTP.
2203<section title="Introduction of Content-Encoding" anchor="introduction.of.content-encoding">
2205   RFC 2045 does not include any concept equivalent to HTTP/1.1's
2206   Content-Encoding header field. Since this acts as a modifier on the
2207   media type, proxies and gateways from HTTP to MIME-compliant
2208   protocols &MUST; either change the value of the Content-Type header
2209   field or decode the entity-body before forwarding the message. (Some
2210   experimental applications of Content-Type for Internet mail have used
2211   a media-type parameter of ";conversions=&lt;content-coding&gt;" to perform
2212   a function equivalent to Content-Encoding. However, this parameter is
2213   not part of RFC 2045).
2217<section title="No Content-Transfer-Encoding" anchor="no.content-transfer-encoding">
2219   HTTP does not use the Content-Transfer-Encoding field of RFC
2220   2045. Proxies and gateways from MIME-compliant protocols to HTTP &MUST;
2221   remove any Content-Transfer-Encoding
2222   prior to delivering the response message to an HTTP client.
2225   Proxies and gateways from HTTP to MIME-compliant protocols are
2226   responsible for ensuring that the message is in the correct format
2227   and encoding for safe transport on that protocol, where "safe
2228   transport" is defined by the limitations of the protocol being used.
2229   Such a proxy or gateway &SHOULD; label the data with an appropriate
2230   Content-Transfer-Encoding if doing so will improve the likelihood of
2231   safe transport over the destination protocol.
2235<section title="Introduction of Transfer-Encoding" anchor="introduction.of.transfer-encoding">
2237   HTTP/1.1 introduces the Transfer-Encoding header field (&header-transfer-encoding;).
2238   Proxies/gateways &MUST; remove any transfer-coding prior to
2239   forwarding a message via a MIME-compliant protocol.
2243<section title="MHTML and Line Length Limitations" anchor="mhtml.line.length">
2245   HTTP implementations which share code with MHTML <xref target="RFC2557"/> implementations
2246   need to be aware of MIME line length limitations. Since HTTP does not
2247   have this limitation, HTTP does not fold long lines. MHTML messages
2248   being transported by HTTP follow all conventions of MHTML, including
2249   line length limitations and folding, canonicalization, etc., since
2250   HTTP transports all message-bodies as payload (see <xref target="multipart.types"/>) and
2251   does not interpret the content or any MIME header lines that might be
2252   contained therein.
2257<section title="Additional Features" anchor="additional.features">
2259   <xref target="RFC1945"/> and <xref target="RFC2068"/> document protocol elements used by some
2260   existing HTTP implementations, but not consistently and correctly
2261   across most HTTP/1.1 applications. Implementors are advised to be
2262   aware of these features, but cannot rely upon their presence in, or
2263   interoperability with, other HTTP/1.1 applications. Some of these
2264   describe proposed experimental features, and some describe features
2265   that experimental deployment found lacking that are now addressed in
2266   the base HTTP/1.1 specification.
2269   A number of other headers, such as Content-Disposition and Title,
2270   from SMTP and MIME are also often implemented (see <xref target="RFC2076"/>).
2273<section title="Content-Disposition" anchor="content-disposition">
2274<iref item="Headers" subitem="Content-Disposition" primary="true" x:for-anchor=""/>
2275<iref item="Content-Disposition header" primary="true" x:for-anchor=""/>
2277   The Content-Disposition response-header field has been proposed as a
2278   means for the origin server to suggest a default filename if the user
2279   requests that the content is saved to a file. This usage is derived
2280   from the definition of Content-Disposition in <xref target="RFC1806"/>.
2282<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"/>
2283  content-disposition = "Content-Disposition" ":"
2284                        disposition-type *( ";" disposition-parm )
2285  disposition-type = "attachment" | disp-extension-token
2286  disposition-parm = filename-parm | disp-extension-parm
2287  filename-parm = "filename" "=" quoted-string
2288  disp-extension-token = token
2289  disp-extension-parm = token "=" ( token | quoted-string )
2292   An example is
2294<figure><artwork type="example">
2295     Content-Disposition: attachment; filename="fname.ext"
2298   The receiving user agent &SHOULD-NOT;  respect any directory path
2299   information present in the filename-parm parameter, which is the only
2300   parameter believed to apply to HTTP implementations at this time. The
2301   filename &SHOULD; be treated as a terminal component only.
2304   If this header is used in a response with the application/octet-stream
2305   content-type, the implied suggestion is that the user agent
2306   should not display the response, but directly enter a `save response
2307   as...' dialog.
2310   See <xref target="content-disposition.issues"/> for Content-Disposition security issues.
2315<section title="Compatibility with Previous Versions" anchor="compatibility">
2316<section title="Changes from RFC 2068" anchor="changes.from.rfc.2068">
2318   Transfer-coding and message lengths all interact in ways that
2319   required fixing exactly when chunked encoding is used (to allow for
2320   transfer encoding that may not be self delimiting); it was important
2321   to straighten out exactly how message lengths are computed.
2322   (<xref target="entity.length"/>, see also <xref target="Part1"/>,
2323   <xref target="Part5"/> and <xref target="Part6"/>).
2326   Charset wildcarding is introduced to avoid explosion of character set
2327   names in accept headers. (<xref target="header.accept-charset"/>)
2330   Content-Base was deleted from the specification: it was not
2331   implemented widely, and there is no simple, safe way to introduce it
2332   without a robust extension mechanism. In addition, it is used in a
2333   similar, but not identical fashion in MHTML <xref target="RFC2557"/>.
2336   A content-coding of "identity" was introduced, to solve problems
2337   discovered in caching. (<xref target="content.codings"/>)
2340   Quality Values of zero should indicate that "I don't want something"
2341   to allow clients to refuse a representation. (<xref target="quality.values"/>)
2344   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
2345   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
2346   specification, but not commonly implemented. See <xref target="RFC2068"/>.
2350<section title="Changes from RFC 2616" anchor="changes.from.rfc.2616">
2352  Clarify contexts that charset is used in.
2353  (<xref target="character.sets"/>)
2356  Remove character set defaulting for text media types.
2357  (<xref target="canonicalization.and.text.defaults"/>)
2360  Remove reference to non-existant identity transfer-coding value tokens.
2361  (<xref target="no.content-transfer-encoding"/>)
2367<section title="Change Log (to be removed by RFC Editor before publication)">
2369<section title="Since RFC2616">
2371  Extracted relevant partitions from <xref target="RFC2616"/>.
2375<section title="Since draft-ietf-httpbis-p3-payload-00">
2377  Closed issues:
2378  <list style="symbols">
2379    <t>
2380      <eref target=""/>:
2381      "Media Type Registrations"
2382      (<eref target=""/>)
2383    </t>
2384    <t>
2385      <eref target=""/>:
2386      "Clarification regarding quoting of charset values"
2387      (<eref target=""/>)
2388    </t>
2389    <t>
2390      <eref target=""/>:
2391      "Remove 'identity' token references"
2392      (<eref target=""/>)
2393    </t>
2394    <t>
2395      <eref target=""/>:
2396      "Accept-Encoding BNF"
2397    </t>
2398    <t>
2399      <eref target=""/>:
2400      "Normative and Informative references"
2401    </t>
2402    <t>
2403      <eref target=""/>:
2404      "RFC1700 references"
2405    </t>
2406    <t>
2407      <eref target=""/>:
2408      "Updating to RFC4288"
2409    </t>
2410    <t>
2411      <eref target=""/>:
2412      "Informative references"
2413    </t>
2414    <t>
2415      <eref target=""/>:
2416      "ISO-8859-1 Reference"
2417    </t>
2418    <t>
2419      <eref target=""/>:
2420      "Encoding References Normative"
2421    </t>
2422    <t>
2423      <eref target=""/>:
2424      "Normative up-to-date references"
2425    </t>
2426  </list>
2430<section title="Since draft-ietf-httpbis-p3-payload-01">
2432  Ongoing work on text media type charset defaults (<eref target=""/>):
2433  <list style="symbols">
2434    <t>
2435      Remove the ISO-8859-1 default.
2436    </t>
2437  </list>
2440  Ongoing work on ABNF conversion (<eref target=""/>):
2441  <list style="symbols">
2442    <t>
2443      Add explicit references to BNF syntax and rules imported from other parts of the specification.
2444    </t>
2445  </list>
Note: See TracBrowser for help on using the repository browser.