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

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

Partition RFC 2616 into seven (mostly) independent documents.
No semantic changes. Some meaningless crossreferences to prior
editorial decisions have been removed from appendices.

Structural changes minimized to simplify diff versus rfc2616.
This was a lot harder than it looks.

Part 8 (Cookies) is for future specification based on RFC 2965.

  • Property svn:eol-style set to native
File size: 92.8 KB
Line 
1<?xml version="1.0" encoding="utf-8"?>
2<!DOCTYPE rfc [
3  <!ENTITY MAY "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MAY</bcp14>">
4  <!ENTITY MUST "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MUST</bcp14>">
5  <!ENTITY MUST-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MUST NOT</bcp14>">
6  <!ENTITY OPTIONAL "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>OPTIONAL</bcp14>">
7  <!ENTITY RECOMMENDED "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>RECOMMENDED</bcp14>">
8  <!ENTITY REQUIRED "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>REQUIRED</bcp14>">
9  <!ENTITY SHALL "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHALL</bcp14>">
10  <!ENTITY SHALL-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHALL NOT</bcp14>">
11  <!ENTITY SHOULD "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHOULD</bcp14>">
12  <!ENTITY SHOULD-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHOULD NOT</bcp14>">
13  <!ENTITY ID-VERSION "latest">
14  <!ENTITY caching                  "[Part 6]">
15  <!ENTITY header-transfer-encoding "[Part 1]">
16  <!ENTITY header-allow             "[Part 2]">
17  <!ENTITY header-content-length    "[Part 1]">
18  <!ENTITY header-content-range     "[Part 5]">
19  <!ENTITY header-expires           "[Part 6]">
20  <!ENTITY header-last-modified     "[Part 4]">
21  <!ENTITY header-user-agent        "[Part 2]">
22  <!ENTITY message-body             "[Part 1]">
23  <!ENTITY message-length           "[Part 1]">
24  <!ENTITY multipart-byteranges     "[Part 5]">
25]>
26<?rfc toc="yes" ?>
27<?rfc symrefs="yes" ?>
28<?rfc sortrefs="yes" ?>
29<?rfc compact="yes"?>
30<?rfc subcompact="no" ?>
31<?rfc linkmailto="no" ?>
32<?rfc editing="no" ?>
33<?rfc-ext allow-markup-in-artwork="yes" ?>
34<?rfc-ext include-references-in-index="yes" ?>
35<rfc obsoletes="2068, 2616, 2617" category="std"
36     ipr="full3978" docName="draft-ietf-httpbis-p3-payload-&ID-VERSION;"
37     xmlns:x='http://purl.org/net/xml2rfc/ext' xmlns:ed="http://greenbytes.de/2002/rfcedit">
38<front>
39
40  <title abbrev="HTTP/1.1">HTTP/1.1, part 3: Message Payload and Content Negotiation</title>
41
42  <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
43    <organization abbrev="Day Software">Day Software</organization>
44    <address>
45      <postal>
46        <street>23 Corporate Plaza DR, Suite 280</street>
47        <city>Newport Beach</city>
48        <region>CA</region>
49        <code>92660</code>
50        <country>USA</country>
51      </postal>
52      <phone>+1-949-706-5300</phone>
53      <facsimile>+1-949-706-5305</facsimile>
54      <email>fielding@gbiv.com</email>
55      <uri>http://roy.gbiv.com/</uri>
56    </address>
57  </author>
58
59  <author initials="J." surname="Gettys" fullname="Jim Gettys">
60    <organization>One Laptop per Child</organization>
61    <address>
62      <postal>
63        <street>21 Oak Knoll Road</street>
64        <city>Carlisle</city>
65        <region>MA</region>
66        <code>01741</code>
67        <country>USA</country>
68      </postal>
69      <email>jg@laptop.org</email>
70      <uri>http://www.laptop.org/</uri>
71    </address>
72  </author>
73 
74  <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
75    <organization abbrev="HP">Hewlett-Packard Company</organization>
76    <address>
77      <postal>
78        <street>HP Labs, Large Scale Systems Group</street>
79        <street>1501 Page Mill Road, MS 1177</street>
80        <city>Palo Alto</city>
81        <region>CA</region>
82        <code>94304</code>
83        <country>USA</country>
84      </postal>
85      <email>JeffMogul@acm.org</email>
86    </address>
87  </author>
88
89  <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
90    <organization abbrev="Microsoft">Microsoft Corporation</organization>
91    <address>
92      <postal>
93        <street>1 Microsoft Way</street>
94        <city>Redmond</city>
95        <region>WA</region>
96        <code>98052</code>
97        <country>USA</country>
98      </postal>
99      <email>henrikn@microsoft.com</email>
100    </address>
101  </author>
102
103  <author initials="L." surname="Masinter" fullname="Larry Masinter">
104    <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
105    <address>
106      <postal>
107        <street>345 Park Ave</street>
108        <city>San Jose</city>
109        <region>CA</region>
110        <code>95110</code>
111        <country>USA</country>
112      </postal>
113      <email>LMM@acm.org</email>
114      <uri>http://larry.masinter.net/</uri>
115    </address>
116  </author>
117 
118  <author initials="P." surname="Leach" fullname="Paul J. Leach">
119    <organization abbrev="Microsoft">Microsoft Corporation</organization>
120    <address>
121      <postal>
122        <street>1 Microsoft Way</street>
123        <city>Redmond</city>
124        <region>WA</region>
125        <code>98052</code>
126      </postal>
127      <email>paulle@microsoft.com</email>
128    </address>
129  </author>
130   
131  <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
132    <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
133    <address>
134      <postal>
135        <street>MIT Laboratory for Computer Science</street>
136        <street>545 Technology Square</street>
137        <city>Cambridge</city>
138        <region>MA</region>
139        <code>02139</code>
140        <country>USA</country>
141      </postal>
142      <facsimile>+1 (617) 258 8682</facsimile>
143      <email>timbl@w3.org</email>
144    </address>
145  </author>
146
147  <date month="December" year="2007"/>
148
149<abstract>
150<t>
151   The Hypertext Transfer Protocol (HTTP) is an application-level
152   protocol for distributed, collaborative, hypermedia information
153   systems. HTTP has been in use by the World Wide Web global information
154   initiative since 1990. This document is Part 3 of the eight-part specification
155   that defines the protocol referred to as "HTTP/1.1" and, taken together,
156   updates RFC 2616 and RFC 2617.  Part 3 defines HTTP message content,
157   metadata, and content negotiation.
158</t>
159</abstract>
160</front>
161<middle>
162<section title="Introduction" anchor="introduction">
163<t>
164   This document will define aspects of HTTP related to the payload of
165   messages (message content), including metadata and media types, along
166   with HTTP content negotiation.  Right now it only includes the extracted
167   relevant sections of RFC 2616 without edit.
168</t>
169</section>
170
171<section title="Protocol Parameters" anchor="protocol.parameters">
172
173<section title="Character Sets" anchor="character.sets">
174<t>
175   HTTP uses the same definition of the term "character set" as that
176   described for MIME:
177</t>
178<t>
179   The term "character set" is used in this document to refer to a
180   method used with one or more tables to convert a sequence of octets
181   into a sequence of characters. Note that unconditional conversion in
182   the other direction is not required, in that not all characters may
183   be available in a given character set and a character set may provide
184   more than one sequence of octets to represent a particular character.
185   This definition is intended to allow various kinds of character
186   encoding, from simple single-table mappings such as US-ASCII to
187   complex table switching methods such as those that use ISO-2022's
188   techniques. However, the definition associated with a MIME character
189   set name &MUST; fully specify the mapping to be performed from octets
190   to characters. In particular, use of external profiling information
191   to determine the exact mapping is not permitted.
192</t>
193<t><list><t>
194      <x:h>Note:</x:h> This use of the term "character set" is more commonly
195      referred to as a "character encoding." However, since HTTP and
196      MIME share the same registry, it is important that the terminology
197      also be shared.
198</t></list></t>
199<t>
200   HTTP character sets are identified by case-insensitive tokens. The
201   complete set of tokens is defined by the IANA Character Set registry
202   <xref target="RFC1700"/>.
203</t>
204<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="charset"/>
205    charset = token
206</artwork></figure>
207<t>
208   Although HTTP allows an arbitrary token to be used as a charset
209   value, any token that has a predefined value within the IANA
210   Character Set registry <xref target="RFC1700"/> &MUST; represent the character set defined
211   by that registry. Applications &SHOULD; limit their use of character
212   sets to those defined by the IANA registry.
213</t>
214<t>
215   Implementors should be aware of IETF character set requirements <xref target="RFC2279"/>
216   <xref target="RFC2277"/>.
217</t>
218
219<section title="Missing Charset" anchor="missing.charset">
220<t>
221   Some HTTP/1.0 software has interpreted a Content-Type header without
222   charset parameter incorrectly to mean "recipient should guess."
223   Senders wishing to defeat this behavior &MAY; include a charset
224   parameter even when the charset is ISO-8859-1 and &SHOULD; do so when
225   it is known that it will not confuse the recipient.
226</t>
227<t>
228   Unfortunately, some older HTTP/1.0 clients did not deal properly with
229   an explicit charset parameter. HTTP/1.1 recipients &MUST; respect the
230   charset label provided by the sender; and those user agents that have
231   a provision to "guess" a charset &MUST; use the charset from the
232   content-type field if they support that charset, rather than the
233   recipient's preference, when initially displaying a document. See
234   <xref target="canonicalization.and.text.defaults"/>.
235</t>
236</section>
237</section>
238
239<section title="Content Codings" anchor="content.codings">
240<t>
241   Content coding values indicate an encoding transformation that has
242   been or can be applied to an entity. Content codings are primarily
243   used to allow a document to be compressed or otherwise usefully
244   transformed without losing the identity of its underlying media type
245   and without loss of information. Frequently, the entity is stored in
246   coded form, transmitted directly, and only decoded by the recipient.
247</t>
248<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="content-coding"/>
249    content-coding   = token
250</artwork></figure>
251<t>
252   All content-coding values are case-insensitive. HTTP/1.1 uses
253   content-coding values in the Accept-Encoding (<xref target="header.accept-encoding"/>) and
254   Content-Encoding (<xref target="header.content-encoding"/>) header fields. Although the value
255   describes the content-coding, what is more important is that it
256   indicates what decoding mechanism will be required to remove the
257   encoding.
258</t>
259<t>
260   The Internet Assigned Numbers Authority (IANA) acts as a registry for
261   content-coding value tokens. Initially, the registry contains the
262   following tokens:
263</t>
264<t>
265   gzip<iref item="gzip"/>
266  <list>
267    <t>
268        An encoding format produced by the file compression program
269        "gzip" (GNU zip) as described in RFC 1952 <xref target="RFC1952"/>. This format is a
270        Lempel-Ziv coding (LZ77) with a 32 bit CRC.
271    </t>
272  </list>
273</t>
274<t>
275   compress<iref item="compress"/>
276  <list><t>
277        The encoding format produced by the common UNIX file compression
278        program "compress". This format is an adaptive Lempel-Ziv-Welch
279        coding (LZW).
280</t><t>
281        Use of program names for the identification of encoding formats
282        is not desirable and is discouraged for future encodings. Their
283        use here is representative of historical practice, not good
284        design. For compatibility with previous implementations of HTTP,
285        applications &SHOULD; consider "x-gzip" and "x-compress" to be
286        equivalent to "gzip" and "compress" respectively.
287  </t></list>
288</t>
289<t>
290   deflate<iref item="deflate"/>
291  <list><t>
292        The "zlib" format defined in RFC 1950 <xref target="RFC1950"/> in combination with
293        the "deflate" compression mechanism described in RFC 1951 <xref target="RFC1951"/>.
294  </t></list>
295</t>
296<t>
297   identity<iref item="identity"/>
298  <list><t>
299        The default (identity) encoding; the use of no transformation
300        whatsoever. This content-coding is used only in the Accept-Encoding
301        header, and &SHOULD-NOT;  be used in the Content-Encoding
302        header.
303  </t></list>
304</t>
305<t>
306   New content-coding value tokens &SHOULD; be registered; to allow
307   interoperability between clients and servers, specifications of the
308   content coding algorithms needed to implement a new value &SHOULD; be
309   publicly available and adequate for independent implementation, and
310   conform to the purpose of content coding defined in this section.
311</t>
312</section>
313
314<section title="Media Types" anchor="media.types">
315<t>
316   HTTP uses Internet Media Types <xref target="RFC1590"/> in the Content-Type (<xref target="header.content-type"/>)
317   and Accept (<xref target="header.accept"/>) header fields in order to provide
318   open and extensible data typing and type negotiation.
319</t>
320<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"/>
321    media-type     = type "/" subtype *( ";" parameter )
322    type           = token
323    subtype        = token
324</artwork></figure>
325<t>
326   Parameters &MAY; follow the type/subtype in the form of attribute/value
327   pairs.
328</t>
329<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"/>
330    parameter               = attribute "=" value
331    attribute               = token
332    value                   = token | quoted-string
333</artwork></figure>
334<t>
335   The type, subtype, and parameter attribute names are case-insensitive.
336   Parameter values might or might not be case-sensitive,
337   depending on the semantics of the parameter name. Linear white space
338   (LWS) &MUST-NOT; be used between the type and subtype, nor between an
339   attribute and its value. The presence or absence of a parameter might
340   be significant to the processing of a media-type, depending on its
341   definition within the media type registry.
342</t>
343<t>
344   Note that some older HTTP applications do not recognize media type
345   parameters. When sending data to older HTTP applications,
346   implementations &SHOULD; only use media type parameters when they are
347   required by that type/subtype definition.
348</t>
349<t>
350   Media-type values are registered with the Internet Assigned Number
351   Authority (IANA <xref target="RFC1700"/>). The media type registration process is
352   outlined in RFC 1590 <xref target="RFC1590"/>. Use of non-registered media types is
353   discouraged.
354</t>
355
356<section title="Canonicalization and Text Defaults" anchor="canonicalization.and.text.defaults">
357<t>
358   Internet media types are registered with a canonical form. An
359   entity-body transferred via HTTP messages &MUST; be represented in the
360   appropriate canonical form prior to its transmission except for
361   "text" types, as defined in the next paragraph.
362</t>
363<t>
364   When in canonical form, media subtypes of the "text" type use CRLF as
365   the text line break. HTTP relaxes this requirement and allows the
366   transport of text media with plain CR or LF alone representing a line
367   break when it is done consistently for an entire entity-body. HTTP
368   applications &MUST; accept CRLF, bare CR, and bare LF as being
369   representative of a line break in text media received via HTTP. In
370   addition, if the text is represented in a character set that does not
371   use octets 13 and 10 for CR and LF respectively, as is the case for
372   some multi-byte character sets, HTTP allows the use of whatever octet
373   sequences are defined by that character set to represent the
374   equivalent of CR and LF for line breaks. This flexibility regarding
375   line breaks applies only to text media in the entity-body; a bare CR
376   or LF &MUST-NOT; be substituted for CRLF within any of the HTTP control
377   structures (such as header fields and multipart boundaries).
378</t>
379<t>
380   If an entity-body is encoded with a content-coding, the underlying
381   data &MUST; be in a form defined above prior to being encoded.
382</t>
383<t>
384   The "charset" parameter is used with some media types to define the
385   character set (<xref target="character.sets"/>) of the data. When no explicit charset
386   parameter is provided by the sender, media subtypes of the "text"
387   type are defined to have a default charset value of "ISO-8859-1" when
388   received via HTTP. Data in character sets other than "ISO-8859-1" or
389   its subsets &MUST; be labeled with an appropriate charset value. See
390   <xref target="missing.charset"/> for compatibility problems.
391</t>
392</section>
393
394<section title="Multipart Types" anchor="multipart.types">
395<t>
396   MIME provides for a number of "multipart" types -- encapsulations of
397   one or more entities within a single message-body. All multipart
398   types share a common syntax, as defined in section <xref target="RFC2046" x:sec="5.1.1" x:fmt="number"/> of RFC 2046
399   <xref target="RFC2046"/>, and &MUST; include a boundary parameter as part of the media type
400   value. The message body is itself a protocol element and &MUST;
401   therefore use only CRLF to represent line breaks between body-parts.
402   Unlike in RFC 2046, the epilogue of any multipart message &MUST; be
403   empty; HTTP applications &MUST-NOT; transmit the epilogue (even if the
404   original multipart contains an epilogue). These restrictions exist in
405   order to preserve the self-delimiting nature of a multipart message-body,
406   wherein the "end" of the message-body is indicated by the
407   ending multipart boundary.
408</t>
409<t>
410   In general, HTTP treats a multipart message-body no differently than
411   any other media type: strictly as payload. The one exception is the
412   "multipart/byteranges" type (&multipart-byteranges;) when it appears in a 206
413   (Partial Content) response. In all
414   other cases, an HTTP user agent &SHOULD; follow the same or similar
415   behavior as a MIME user agent would upon receipt of a multipart type.
416   The MIME header fields within each body-part of a multipart message-body
417   do not have any significance to HTTP beyond that defined by
418   their MIME semantics.
419</t>
420<t>
421   In general, an HTTP user agent &SHOULD; follow the same or similar
422   behavior as a MIME user agent would upon receipt of a multipart type.
423   If an application receives an unrecognized multipart subtype, the
424   application &MUST; treat it as being equivalent to "multipart/mixed".
425</t>
426<t><list><t>
427      <x:h>Note:</x:h> The "multipart/form-data" type has been specifically defined
428      for carrying form data suitable for processing via the POST
429      request method, as described in RFC 1867 <xref target="RFC1867"/>.
430</t></list></t>
431</section>
432</section>
433
434<section title="Quality Values" anchor="quality.values">
435<t>
436   HTTP content negotiation (<xref target="content.negotiation"/>) uses short "floating point"
437   numbers to indicate the relative importance ("weight") of various
438   negotiable parameters.  A weight is normalized to a real number in
439   the range 0 through 1, where 0 is the minimum and 1 the maximum
440   value. If a parameter has a quality value of 0, then content with
441   this parameter is `not acceptable' for the client. HTTP/1.1
442   applications &MUST-NOT; generate more than three digits after the
443   decimal point. User configuration of these values &SHOULD; also be
444   limited in this fashion.
445</t>
446<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="qvalue"/>
447    qvalue         = ( "0" [ "." 0*3DIGIT ] )
448                   | ( "1" [ "." 0*3("0") ] )
449</artwork></figure>
450<t>
451   "Quality values" is a misnomer, since these values merely represent
452   relative degradation in desired quality.
453</t>
454</section>
455
456<section title="Language Tags" anchor="language.tags">
457<t>
458   A language tag identifies a natural language spoken, written, or
459   otherwise conveyed by human beings for communication of information
460   to other human beings. Computer languages are explicitly excluded.
461   HTTP uses language tags within the Accept-Language and Content-Language
462   fields.
463</t>
464<t>
465   The syntax and registry of HTTP language tags is the same as that
466   defined by RFC 1766 <xref target="RFC1766"/>. In summary, a language tag is composed of 1
467   or more parts: A primary language tag and a possibly empty series of
468   subtags:
469</t>
470<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"/>
471     language-tag  = primary-tag *( "-" subtag )
472     primary-tag   = 1*8ALPHA
473     subtag        = 1*8ALPHA
474</artwork></figure>
475<t>
476   White space is not allowed within the tag and all tags are case-insensitive.
477   The name space of language tags is administered by the
478   IANA. Example tags include:
479</t>
480<figure><artwork type="example">
481    en, en-US, en-cockney, i-cherokee, x-pig-latin
482</artwork></figure>
483<t>
484   where any two-letter primary-tag is an ISO-639 language abbreviation
485   and any two-letter initial subtag is an ISO-3166 country code. (The
486   last three tags above are not registered tags; all but the last are
487   examples of tags which could be registered in future.)
488</t>
489</section>
490</section>
491
492<section title="Entity" anchor="entity">
493<t>
494   Request and Response messages &MAY; transfer an entity if not otherwise
495   restricted by the request method or response status code. An entity
496   consists of entity-header fields and an entity-body, although some
497   responses will only include the entity-headers.
498</t>
499<t>
500   In this section, both sender and recipient refer to either the client
501   or the server, depending on who sends and who receives the entity.
502</t>
503
504<section title="Entity Header Fields" anchor="entity.header.fields">
505<t>
506   Entity-header fields define metainformation about the entity-body or,
507   if no body is present, about the resource identified by the request.
508   Some of this metainformation is &OPTIONAL;; some might be &REQUIRED; by
509   portions of this specification.
510</t>
511<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="entity-header"/><iref primary="true" item="Grammar" subitem="extension-header"/>
512    entity-header  = Allow                    ; &header-allow;
513                   | Content-Encoding         ; <xref target="header.content-encoding"/>
514                   | Content-Language         ; <xref target="header.content-language"/>
515                   | Content-Length           ; &header-content-length;
516                   | Content-Location         ; <xref target="header.content-location"/>
517                   | Content-MD5              ; <xref target="header.content-md5"/>
518                   | Content-Range            ; &header-content-range;
519                   | Content-Type             ; <xref target="header.content-type"/>
520                   | Expires                  ; &header-expires;
521                   | Last-Modified            ; &header-last-modified;
522                   | extension-header
523
524    extension-header = message-header
525</artwork></figure>
526<t>
527   The extension-header mechanism allows additional entity-header fields
528   to be defined without changing the protocol, but these fields cannot
529   be assumed to be recognizable by the recipient. Unrecognized header
530   fields &SHOULD; be ignored by the recipient and &MUST; be forwarded by
531   transparent proxies.
532</t>
533</section>
534
535<section title="Entity Body" anchor="entity.body">
536<t>
537   The entity-body (if any) sent with an HTTP request or response is in
538   a format and encoding defined by the entity-header fields.
539</t>
540<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="entity-body"/>
541    entity-body    = *OCTET
542</artwork></figure>
543<t>
544   An entity-body is only present in a message when a message-body is
545   present, as described in &message-body;. The entity-body is obtained
546   from the message-body by decoding any Transfer-Encoding that might
547   have been applied to ensure safe and proper transfer of the message.
548</t>
549
550<section title="Type" anchor="type">
551<t>
552   When an entity-body is included with a message, the data type of that
553   body is determined via the header fields Content-Type and Content-Encoding.
554   These define a two-layer, ordered encoding model:
555</t>
556<figure><artwork type="example">
557    entity-body := Content-Encoding( Content-Type( data ) )
558</artwork></figure>
559<t>
560   Content-Type specifies the media type of the underlying data.
561   Content-Encoding may be used to indicate any additional content
562   codings applied to the data, usually for the purpose of data
563   compression, that are a property of the requested resource. There is
564   no default encoding.
565</t>
566<t>
567   Any HTTP/1.1 message containing an entity-body &SHOULD; include a
568   Content-Type header field defining the media type of that body. If
569   and only if the media type is not given by a Content-Type field, the
570   recipient &MAY; attempt to guess the media type via inspection of its
571   content and/or the name extension(s) of the URI used to identify the
572   resource. If the media type remains unknown, the recipient &SHOULD;
573   treat it as type "application/octet-stream".
574</t>
575</section>
576   
577<section title="Entity Length" anchor="entity.length">
578<t>
579   The entity-length of a message is the length of the message-body
580   before any transfer-codings have been applied. &message-length; defines
581   how the transfer-length of a message-body is determined.
582</t>
583</section>
584</section>
585</section>
586
587<section title="Content Negotiation" anchor="content.negotiation">
588<t>
589   Most HTTP responses include an entity which contains information for
590   interpretation by a human user. Naturally, it is desirable to supply
591   the user with the "best available" entity corresponding to the
592   request. Unfortunately for servers and caches, not all users have the
593   same preferences for what is "best," and not all user agents are
594   equally capable of rendering all entity types. For that reason, HTTP
595   has provisions for several mechanisms for "content negotiation" --
596   the process of selecting the best representation for a given response
597   when there are multiple representations available.
598  <list><t>
599      <x:h>Note:</x:h> This is not called "format negotiation" because the
600      alternate representations may be of the same media type, but use
601      different capabilities of that type, be in different languages,
602      etc.
603  </t></list>
604</t>
605<t>
606   Any response containing an entity-body &MAY; be subject to negotiation,
607   including error responses.
608</t>
609<t>
610   There are two kinds of content negotiation which are possible in
611   HTTP: server-driven and agent-driven negotiation. These two kinds of
612   negotiation are orthogonal and thus may be used separately or in
613   combination. One method of combination, referred to as transparent
614   negotiation, occurs when a cache uses the agent-driven negotiation
615   information provided by the origin server in order to provide
616   server-driven negotiation for subsequent requests.
617</t>
618
619<section title="Server-driven Negotiation" anchor="server-driven.negotiation">
620<t>
621   If the selection of the best representation for a response is made by
622   an algorithm located at the server, it is called server-driven
623   negotiation. Selection is based on the available representations of
624   the response (the dimensions over which it can vary; e.g. language,
625   content-coding, etc.) and the contents of particular header fields in
626   the request message or on other information pertaining to the request
627   (such as the network address of the client).
628</t>
629<t>
630   Server-driven negotiation is advantageous when the algorithm for
631   selecting from among the available representations is difficult to
632   describe to the user agent, or when the server desires to send its
633   "best guess" to the client along with the first response (hoping to
634   avoid the round-trip delay of a subsequent request if the "best
635   guess" is good enough for the user). In order to improve the server's
636   guess, the user agent &MAY; include request header fields (Accept,
637   Accept-Language, Accept-Encoding, etc.) which describe its
638   preferences for such a response.
639</t>
640<t>
641   Server-driven negotiation has disadvantages:
642  <list style="numbers">
643    <t>
644         It is impossible for the server to accurately determine what
645         might be "best" for any given user, since that would require
646         complete knowledge of both the capabilities of the user agent
647         and the intended use for the response (e.g., does the user want
648         to view it on screen or print it on paper?).
649    </t>
650    <t>
651         Having the user agent describe its capabilities in every
652         request can be both very inefficient (given that only a small
653         percentage of responses have multiple representations) and a
654         potential violation of the user's privacy.
655    </t>
656    <t>
657         It complicates the implementation of an origin server and the
658         algorithms for generating responses to a request.
659    </t>
660    <t>
661         It may limit a public cache's ability to use the same response
662         for multiple user's requests.
663    </t>
664  </list>
665</t>
666<t>
667   HTTP/1.1 includes the following request-header fields for enabling
668   server-driven negotiation through description of user agent
669   capabilities and user preferences: Accept (<xref target="header.accept"/>), Accept-Charset
670   (<xref target="header.accept-charset"/>), Accept-Encoding (<xref target="header.accept-encoding"/>), Accept-Language
671   (<xref target="header.accept-language"/>), and User-Agent (&header-user-agent;). However, an
672   origin server is not limited to these dimensions and &MAY; vary the
673   response based on any aspect of the request, including information
674   outside the request-header fields or within extension header fields
675   not defined by this specification.
676</t>
677<t>
678   The Vary header field &caching; can be used to express the parameters the
679   server uses to select a representation that is subject to server-driven
680   negotiation.
681</t>
682</section>
683
684<section title="Agent-driven Negotiation" anchor="agent-driven.negotiation">
685<t>
686   With agent-driven negotiation, selection of the best representation
687   for a response is performed by the user agent after receiving an
688   initial response from the origin server. Selection is based on a list
689   of the available representations of the response included within the
690   header fields or entity-body of the initial response, with each
691   representation identified by its own URI. Selection from among the
692   representations may be performed automatically (if the user agent is
693   capable of doing so) or manually by the user selecting from a
694   generated (possibly hypertext) menu.
695</t>
696<t>
697   Agent-driven negotiation is advantageous when the response would vary
698   over commonly-used dimensions (such as type, language, or encoding),
699   when the origin server is unable to determine a user agent's
700   capabilities from examining the request, and generally when public
701   caches are used to distribute server load and reduce network usage.
702</t>
703<t>
704   Agent-driven negotiation suffers from the disadvantage of needing a
705   second request to obtain the best alternate representation. This
706   second request is only efficient when caching is used. In addition,
707   this specification does not define any mechanism for supporting
708   automatic selection, though it also does not prevent any such
709   mechanism from being developed as an extension and used within
710   HTTP/1.1.
711</t>
712<t>
713   HTTP/1.1 defines the 300 (Multiple Choices) and 406 (Not Acceptable)
714   status codes for enabling agent-driven negotiation when the server is
715   unwilling or unable to provide a varying response using server-driven
716   negotiation.
717</t>
718</section>
719
720<section title="Transparent Negotiation" anchor="transparent.negotiation">
721<t>
722   Transparent negotiation is a combination of both server-driven and
723   agent-driven negotiation. When a cache is supplied with a form of the
724   list of available representations of the response (as in agent-driven
725   negotiation) and the dimensions of variance are completely understood
726   by the cache, then the cache becomes capable of performing server-driven
727   negotiation on behalf of the origin server for subsequent
728   requests on that resource.
729</t>
730<t>
731   Transparent negotiation has the advantage of distributing the
732   negotiation work that would otherwise be required of the origin
733   server and also removing the second request delay of agent-driven
734   negotiation when the cache is able to correctly guess the right
735   response.
736</t>
737<t>
738   This specification does not define any mechanism for transparent
739   negotiation, though it also does not prevent any such mechanism from
740   being developed as an extension that could be used within HTTP/1.1.
741</t>
742</section>
743</section>
744<section title="Header Field Definitions" anchor="header.fields">
745<t>
746   This section defines the syntax and semantics of all standard
747   HTTP/1.1 header fields. For entity-header fields, both sender and
748   recipient refer to either the client or the server, depending on who
749   sends and who receives the entity.
750</t>
751<section title="Accept" anchor="header.accept">
752  <iref primary="true" item="Accept header" x:for-anchor=""/>
753  <iref primary="true" item="Headers" subitem="Accept" x:for-anchor=""/>
754<t>
755   The Accept request-header field can be used to specify certain media
756   types which are acceptable for the response. Accept headers can be
757   used to indicate that the request is specifically limited to a small
758   set of desired types, as in the case of a request for an in-line
759   image.
760</t>
761<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"/>
762    Accept         = "Accept" ":"
763                     #( media-range [ accept-params ] )
764
765    media-range    = ( "*/*"
766                     | ( type "/" "*" )
767                     | ( type "/" subtype )
768                     ) *( ";" parameter )
769    accept-params  = ";" "q" "=" qvalue *( accept-extension )
770    accept-extension = ";" token [ "=" ( token | quoted-string ) ]
771</artwork></figure>
772<t>
773   The asterisk "*" character is used to group media types into ranges,
774   with "*/*" indicating all media types and "type/*" indicating all
775   subtypes of that type. The media-range &MAY; include media type
776   parameters that are applicable to that range.
777</t>
778<t>
779   Each media-range &MAY; be followed by one or more accept-params,
780   beginning with the "q" parameter for indicating a relative quality
781   factor. The first "q" parameter (if any) separates the media-range
782   parameter(s) from the accept-params. Quality factors allow the user
783   or user agent to indicate the relative degree of preference for that
784   media-range, using the qvalue scale from 0 to 1 (<xref target="quality.values"/>). The
785   default value is q=1.
786  <list><t>
787      <x:h>Note:</x:h> Use of the "q" parameter name to separate media type
788      parameters from Accept extension parameters is due to historical
789      practice. Although this prevents any media type parameter named
790      "q" from being used with a media range, such an event is believed
791      to be unlikely given the lack of any "q" parameters in the IANA
792      media type registry and the rare usage of any media type
793      parameters in Accept. Future media types are discouraged from
794      registering any parameter named "q".
795  </t></list>
796</t>
797<t>
798   The example
799</t>
800<figure><artwork type="example">
801    Accept: audio/*; q=0.2, audio/basic
802</artwork></figure>
803<t>
804   &SHOULD; be interpreted as "I prefer audio/basic, but send me any audio
805   type if it is the best available after an 80% mark-down in quality."
806</t>
807<t>
808   If no Accept header field is present, then it is assumed that the
809   client accepts all media types. If an Accept header field is present,
810   and if the server cannot send a response which is acceptable
811   according to the combined Accept field value, then the server &SHOULD;
812   send a 406 (not acceptable) response.
813</t>
814<t>
815   A more elaborate example is
816</t>
817<figure><artwork type="example">
818    Accept: text/plain; q=0.5, text/html,
819            text/x-dvi; q=0.8, text/x-c
820</artwork></figure>
821<t>
822   Verbally, this would be interpreted as "text/html and text/x-c are
823   the preferred media types, but if they do not exist, then send the
824   text/x-dvi entity, and if that does not exist, send the text/plain
825   entity."
826</t>
827<t>
828   Media ranges can be overridden by more specific media ranges or
829   specific media types. If more than one media range applies to a given
830   type, the most specific reference has precedence. For example,
831</t>
832<figure><artwork type="example">
833    Accept: text/*, text/html, text/html;level=1, */*
834</artwork></figure>
835<t>
836   have the following precedence:
837</t>
838<figure><artwork type="example">
839    1) text/html;level=1
840    2) text/html
841    3) text/*
842    4) */*
843</artwork></figure>
844<t>
845   The media type quality factor associated with a given type is
846   determined by finding the media range with the highest precedence
847   which matches that type. For example,
848</t>
849<figure><artwork type="example">
850    Accept: text/*;q=0.3, text/html;q=0.7, text/html;level=1,
851            text/html;level=2;q=0.4, */*;q=0.5
852</artwork></figure>
853<t>
854   would cause the following values to be associated:
855</t>
856<figure><artwork type="example">
857    text/html;level=1         = 1
858    text/html                 = 0.7
859    text/plain                = 0.3
860    image/jpeg                = 0.5
861    text/html;level=2         = 0.4
862    text/html;level=3         = 0.7
863</artwork></figure>
864<t>
865      <x:h>Note:</x:h> A user agent might be provided with a default set of quality
866      values for certain media ranges. However, unless the user agent is
867      a closed system which cannot interact with other rendering agents,
868      this default set ought to be configurable by the user.
869</t>
870</section>
871
872<section title="Accept-Charset" anchor="header.accept-charset">
873  <iref primary="true" item="Accept-Charset header" x:for-anchor=""/>
874  <iref primary="true" item="Headers" subitem="Accept-Charset" x:for-anchor=""/>
875<t>
876   The Accept-Charset request-header field can be used to indicate what
877   character sets are acceptable for the response. This field allows
878   clients capable of understanding more comprehensive or special-purpose
879   character sets to signal that capability to a server which is
880   capable of representing documents in those character sets.
881</t>
882<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Accept-Charset"/>
883   Accept-Charset = "Accept-Charset" ":"
884           1#( ( charset | "*" )[ ";" "q" "=" qvalue ] )
885</artwork></figure>
886<t>
887   Character set values are described in <xref target="character.sets"/>. Each charset &MAY;
888   be given an associated quality value which represents the user's
889   preference for that charset. The default value is q=1. An example is
890</t>
891<figure><artwork type="example">
892   Accept-Charset: iso-8859-5, unicode-1-1;q=0.8
893</artwork></figure>
894<t>
895   The special value "*", if present in the Accept-Charset field,
896   matches every character set (including ISO-8859-1) which is not
897   mentioned elsewhere in the Accept-Charset field. If no "*" is present
898   in an Accept-Charset field, then all character sets not explicitly
899   mentioned get a quality value of 0, except for ISO-8859-1, which gets
900   a quality value of 1 if not explicitly mentioned.
901</t>
902<t>
903   If no Accept-Charset header is present, the default is that any
904   character set is acceptable. If an Accept-Charset header is present,
905   and if the server cannot send a response which is acceptable
906   according to the Accept-Charset header, then the server &SHOULD; send
907   an error response with the 406 (not acceptable) status code, though
908   the sending of an unacceptable response is also allowed.
909</t>
910</section>
911
912<section title="Accept-Encoding" anchor="header.accept-encoding">
913  <iref primary="true" item="Accept-Encoding header" x:for-anchor=""/>
914  <iref primary="true" item="Headers" subitem="Accept-Encoding" x:for-anchor=""/>
915<t>
916   The Accept-Encoding request-header field is similar to Accept, but
917   restricts the content-codings (<xref target="content.codings"/>) that are acceptable in
918   the response.
919</t>
920<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Accept-Encoding"/><iref primary="true" item="Grammar" subitem="codings"/>
921    Accept-Encoding  = "Accept-Encoding" ":"
922                       1#( codings [ ";" "q" "=" qvalue ] )
923    codings          = ( content-coding | "*" )
924</artwork></figure>
925<t>
926   Examples of its use are:
927</t>
928<figure><artwork type="example">
929    Accept-Encoding: compress, gzip
930    Accept-Encoding:
931    Accept-Encoding: *
932    Accept-Encoding: compress;q=0.5, gzip;q=1.0
933    Accept-Encoding: gzip;q=1.0, identity; q=0.5, *;q=0
934</artwork></figure>
935<t>
936   A server tests whether a content-coding is acceptable, according to
937   an Accept-Encoding field, using these rules:
938  <list style="numbers">
939      <t>If the content-coding is one of the content-codings listed in
940         the Accept-Encoding field, then it is acceptable, unless it is
941         accompanied by a qvalue of 0. (As defined in <xref target="quality.values"/>, a
942         qvalue of 0 means "not acceptable.")</t>
943
944      <t>The special "*" symbol in an Accept-Encoding field matches any
945         available content-coding not explicitly listed in the header
946         field.</t>
947
948      <t>If multiple content-codings are acceptable, then the acceptable
949         content-coding with the highest non-zero qvalue is preferred.</t>
950
951      <t>The "identity" content-coding is always acceptable, unless
952         specifically refused because the Accept-Encoding field includes
953         "identity;q=0", or because the field includes "*;q=0" and does
954         not explicitly include the "identity" content-coding. If the
955         Accept-Encoding field-value is empty, then only the "identity"
956         encoding is acceptable.</t>
957  </list>
958</t>
959<t>
960   If an Accept-Encoding field is present in a request, and if the
961   server cannot send a response which is acceptable according to the
962   Accept-Encoding header, then the server &SHOULD; send an error response
963   with the 406 (Not Acceptable) status code.
964</t>
965<t>
966   If no Accept-Encoding field is present in a request, the server &MAY;
967   assume that the client will accept any content coding. In this case,
968   if "identity" is one of the available content-codings, then the
969   server &SHOULD; use the "identity" content-coding, unless it has
970   additional information that a different content-coding is meaningful
971   to the client.
972  <list><t>
973      <x:h>Note:</x:h> If the request does not include an Accept-Encoding field,
974      and if the "identity" content-coding is unavailable, then
975      content-codings commonly understood by HTTP/1.0 clients (i.e.,
976      "gzip" and "compress") are preferred; some older clients
977      improperly display messages sent with other content-codings.  The
978      server might also make this decision based on information about
979      the particular user-agent or client.
980    </t><t>
981      <x:h>Note:</x:h> Most HTTP/1.0 applications do not recognize or obey qvalues
982      associated with content-codings. This means that qvalues will not
983      work and are not permitted with x-gzip or x-compress.
984    </t></list>
985</t>
986</section>
987
988<section title="Accept-Language" anchor="header.accept-language">
989  <iref primary="true" item="Accept-Language header" x:for-anchor=""/>
990  <iref primary="true" item="Headers" subitem="Accept-Language" x:for-anchor=""/>
991<t>
992   The Accept-Language request-header field is similar to Accept, but
993   restricts the set of natural languages that are preferred as a
994   response to the request. Language tags are defined in <xref target="language.tags"/>.
995</t>
996<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Accept-Language"/><iref primary="true" item="Grammar" subitem="language-range"/>
997    Accept-Language = "Accept-Language" ":"
998                      1#( language-range [ ";" "q" "=" qvalue ] )
999    language-range  = ( ( 1*8ALPHA *( "-" 1*8ALPHA ) ) | "*" )
1000</artwork></figure>
1001<t>
1002   Each language-range &MAY; be given an associated quality value which
1003   represents an estimate of the user's preference for the languages
1004   specified by that range. The quality value defaults to "q=1". For
1005   example,
1006</t>
1007<figure><artwork type="example">
1008    Accept-Language: da, en-gb;q=0.8, en;q=0.7
1009</artwork></figure>
1010<t>
1011   would mean: "I prefer Danish, but will accept British English and
1012   other types of English." A language-range matches a language-tag if
1013   it exactly equals the tag, or if it exactly equals a prefix of the
1014   tag such that the first tag character following the prefix is "-".
1015   The special range "*", if present in the Accept-Language field,
1016   matches every tag not matched by any other range present in the
1017   Accept-Language field.
1018  <list><t>
1019      <x:h>Note:</x:h> This use of a prefix matching rule does not imply that
1020      language tags are assigned to languages in such a way that it is
1021      always true that if a user understands a language with a certain
1022      tag, then this user will also understand all languages with tags
1023      for which this tag is a prefix. The prefix rule simply allows the
1024      use of prefix tags if this is the case.
1025  </t></list>
1026</t>
1027<t>
1028   The language quality factor assigned to a language-tag by the
1029   Accept-Language field is the quality value of the longest language-range
1030   in the field that matches the language-tag. If no language-range
1031   in the field matches the tag, the language quality factor
1032   assigned is 0. If no Accept-Language header is present in the
1033   request, the server
1034   &SHOULD; assume that all languages are equally acceptable. If an
1035   Accept-Language header is present, then all languages which are
1036   assigned a quality factor greater than 0 are acceptable.
1037</t>
1038<t>
1039   It might be contrary to the privacy expectations of the user to send
1040   an Accept-Language header with the complete linguistic preferences of
1041   the user in every request. For a discussion of this issue, see
1042   <xref target="privacy.issues.connected.to.accept.headers"/>.
1043</t>
1044<t>
1045   As intelligibility is highly dependent on the individual user, it is
1046   recommended that client applications make the choice of linguistic
1047   preference available to the user. If the choice is not made
1048   available, then the Accept-Language header field &MUST-NOT; be given in
1049   the request.
1050  <list><t>
1051      <x:h>Note:</x:h> When making the choice of linguistic preference available to
1052      the user, we remind implementors of  the fact that users are not
1053      familiar with the details of language matching as described above,
1054      and should provide appropriate guidance. As an example, users
1055      might assume that on selecting "en-gb", they will be served any
1056      kind of English document if British English is not available. A
1057      user agent might suggest in such a case to add "en" to get the
1058      best matching behavior.
1059  </t></list>
1060</t>
1061</section>
1062
1063<section title="Content-Encoding" anchor="header.content-encoding">
1064  <iref primary="true" item="Content-Encoding header" x:for-anchor=""/>
1065  <iref primary="true" item="Headers" subitem="Content-Encoding" x:for-anchor=""/>
1066<t>
1067   The Content-Encoding entity-header field is used as a modifier to the
1068   media-type. When present, its value indicates what additional content
1069   codings have been applied to the entity-body, and thus what decoding
1070   mechanisms must be applied in order to obtain the media-type
1071   referenced by the Content-Type header field. Content-Encoding is
1072   primarily used to allow a document to be compressed without losing
1073   the identity of its underlying media type.
1074</t>
1075<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Encoding"/>
1076    Content-Encoding  = "Content-Encoding" ":" 1#content-coding
1077</artwork></figure>
1078<t>
1079   Content codings are defined in <xref target="content.codings"/>. An example of its use is
1080</t>
1081<figure><artwork type="example">
1082    Content-Encoding: gzip
1083</artwork></figure>
1084<t>
1085   The content-coding is a characteristic of the entity identified by
1086   the Request-URI. Typically, the entity-body is stored with this
1087   encoding and is only decoded before rendering or analogous usage.
1088   However, a non-transparent proxy &MAY; modify the content-coding if the
1089   new coding is known to be acceptable to the recipient, unless the
1090   "no-transform" cache-control directive is present in the message.
1091</t>
1092<t>
1093   If the content-coding of an entity is not "identity", then the
1094   response &MUST; include a Content-Encoding entity-header (<xref target="header.content-encoding"/>)
1095   that lists the non-identity content-coding(s) used.
1096</t>
1097<t>
1098   If the content-coding of an entity in a request message is not
1099   acceptable to the origin server, the server &SHOULD; respond with a
1100   status code of 415 (Unsupported Media Type).
1101</t>
1102<t>
1103   If multiple encodings have been applied to an entity, the content
1104   codings &MUST; be listed in the order in which they were applied.
1105   Additional information about the encoding parameters &MAY; be provided
1106   by other entity-header fields not defined by this specification.
1107</t>
1108</section>
1109
1110<section title="Content-Language" anchor="header.content-language">
1111  <iref primary="true" item="Content-Language header" x:for-anchor=""/>
1112  <iref primary="true" item="Headers" subitem="Content-Language" x:for-anchor=""/>
1113<t>
1114   The Content-Language entity-header field describes the natural
1115   language(s) of the intended audience for the enclosed entity. Note
1116   that this might not be equivalent to all the languages used within
1117   the entity-body.
1118</t>
1119<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Language"/>
1120    Content-Language  = "Content-Language" ":" 1#language-tag
1121</artwork></figure>
1122<t>
1123   Language tags are defined in <xref target="language.tags"/>. The primary purpose of
1124   Content-Language is to allow a user to identify and differentiate
1125   entities according to the user's own preferred language. Thus, if the
1126   body content is intended only for a Danish-literate audience, the
1127   appropriate field is
1128</t>
1129<figure><artwork type="example">
1130    Content-Language: da
1131</artwork></figure>
1132<t>
1133   If no Content-Language is specified, the default is that the content
1134   is intended for all language audiences. This might mean that the
1135   sender does not consider it to be specific to any natural language,
1136   or that the sender does not know for which language it is intended.
1137</t>
1138<t>
1139   Multiple languages &MAY; be listed for content that is intended for
1140   multiple audiences. For example, a rendition of the "Treaty of
1141   Waitangi," presented simultaneously in the original Maori and English
1142   versions, would call for
1143</t>
1144<figure><artwork type="example">
1145    Content-Language: mi, en
1146</artwork></figure>
1147<t>
1148   However, just because multiple languages are present within an entity
1149   does not mean that it is intended for multiple linguistic audiences.
1150   An example would be a beginner's language primer, such as "A First
1151   Lesson in Latin," which is clearly intended to be used by an
1152   English-literate audience. In this case, the Content-Language would
1153   properly only include "en".
1154</t>
1155<t>
1156   Content-Language &MAY; be applied to any media type -- it is not
1157   limited to textual documents.
1158</t>
1159</section>
1160
1161<section title="Content-Location" anchor="header.content-location">
1162  <iref primary="true" item="Content-Location header" x:for-anchor=""/>
1163  <iref primary="true" item="Headers" subitem="Content-Location" x:for-anchor=""/>
1164<t>
1165   The Content-Location entity-header field &MAY; be used to supply the
1166   resource location for the entity enclosed in the message when that
1167   entity is accessible from a location separate from the requested
1168   resource's URI. A server &SHOULD; provide a Content-Location for the
1169   variant corresponding to the response entity; especially in the case
1170   where a resource has multiple entities associated with it, and those
1171   entities actually have separate locations by which they might be
1172   individually accessed, the server &SHOULD; provide a Content-Location
1173   for the particular variant which is returned.
1174</t>
1175<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Location"/>
1176    Content-Location = "Content-Location" ":"
1177                      ( absoluteURI | relativeURI )
1178</artwork></figure>
1179<t>
1180   The value of Content-Location also defines the base URI for the
1181   entity.
1182</t>
1183<t>
1184   The Content-Location value is not a replacement for the original
1185   requested URI; it is only a statement of the location of the resource
1186   corresponding to this particular entity at the time of the request.
1187   Future requests &MAY; specify the Content-Location URI as the request-URI
1188   if the desire is to identify the source of that particular
1189   entity.
1190</t>
1191<t>
1192   A cache cannot assume that an entity with a Content-Location
1193   different from the URI used to retrieve it can be used to respond to
1194   later requests on that Content-Location URI. However, the Content-Location
1195   can be used to differentiate between multiple entities
1196   retrieved from a single requested resource, as described in &caching;.
1197</t>
1198<t>
1199   If the Content-Location is a relative URI, the relative URI is
1200   interpreted relative to the Request-URI.
1201</t>
1202<t>
1203   The meaning of the Content-Location header in PUT or POST requests is
1204   undefined; servers are free to ignore it in those cases.
1205</t>
1206</section>
1207
1208<section title="Content-MD5" anchor="header.content-md5">
1209  <iref primary="true" item="Content-MD5 header" x:for-anchor=""/>
1210  <iref primary="true" item="Headers" subitem="Content-MD5" x:for-anchor=""/>
1211<t>
1212   The Content-MD5 entity-header field, as defined in RFC 1864 <xref target="RFC1864"/>, is
1213   an MD5 digest of the entity-body for the purpose of providing an
1214   end-to-end message integrity check (MIC) of the entity-body. (Note: a
1215   MIC is good for detecting accidental modification of the entity-body
1216   in transit, but is not proof against malicious attacks.)
1217</t>
1218<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-MD5"/><iref primary="true" item="Grammar" subitem="md5-digest"/>
1219     Content-MD5   = "Content-MD5" ":" md5-digest
1220     md5-digest   = &lt;base64 of 128 bit MD5 digest as per RFC 1864&gt;
1221</artwork></figure>
1222<t>
1223   The Content-MD5 header field &MAY; be generated by an origin server or
1224   client to function as an integrity check of the entity-body. Only
1225   origin servers or clients &MAY; generate the Content-MD5 header field;
1226   proxies and gateways &MUST-NOT; generate it, as this would defeat its
1227   value as an end-to-end integrity check. Any recipient of the entity-body,
1228   including gateways and proxies, &MAY; check that the digest value
1229   in this header field matches that of the entity-body as received.
1230</t>
1231<t>
1232   The MD5 digest is computed based on the content of the entity-body,
1233   including any content-coding that has been applied, but not including
1234   any transfer-encoding applied to the message-body. If the message is
1235   received with a transfer-encoding, that encoding &MUST; be removed
1236   prior to checking the Content-MD5 value against the received entity.
1237</t>
1238<t>
1239   This has the result that the digest is computed on the octets of the
1240   entity-body exactly as, and in the order that, they would be sent if
1241   no transfer-encoding were being applied.
1242</t>
1243<t>
1244   HTTP extends RFC 1864 to permit the digest to be computed for MIME
1245   composite media-types (e.g., multipart/* and message/rfc822), but
1246   this does not change how the digest is computed as defined in the
1247   preceding paragraph.
1248</t>
1249<t>
1250   There are several consequences of this. The entity-body for composite
1251   types &MAY; contain many body-parts, each with its own MIME and HTTP
1252   headers (including Content-MD5, Content-Transfer-Encoding, and
1253   Content-Encoding headers). If a body-part has a Content-Transfer-Encoding
1254   or Content-Encoding header, it is assumed that the content
1255   of the body-part has had the encoding applied, and the body-part is
1256   included in the Content-MD5 digest as is -- i.e., after the
1257   application. The Transfer-Encoding header field is not allowed within
1258   body-parts.
1259</t>
1260<t>
1261   Conversion of all line breaks to CRLF &MUST-NOT; be done before
1262   computing or checking the digest: the line break convention used in
1263   the text actually transmitted &MUST; be left unaltered when computing
1264   the digest.
1265  <list><t>
1266      <x:h>Note:</x:h> while the definition of Content-MD5 is exactly the same for
1267      HTTP as in RFC 1864 for MIME entity-bodies, there are several ways
1268      in which the application of Content-MD5 to HTTP entity-bodies
1269      differs from its application to MIME entity-bodies. One is that
1270      HTTP, unlike MIME, does not use Content-Transfer-Encoding, and
1271      does use Transfer-Encoding and Content-Encoding. Another is that
1272      HTTP more frequently uses binary content types than MIME, so it is
1273      worth noting that, in such cases, the byte order used to compute
1274      the digest is the transmission byte order defined for the type.
1275      Lastly, HTTP allows transmission of text types with any of several
1276      line break conventions and not just the canonical form using CRLF.
1277  </t></list>
1278</t>
1279</section>
1280
1281<section title="Content-Type" anchor="header.content-type">
1282  <iref primary="true" item="Content-Type header" x:for-anchor=""/>
1283  <iref primary="true" item="Headers" subitem="Content-Type" x:for-anchor=""/>
1284<t>
1285   The Content-Type entity-header field indicates the media type of the
1286   entity-body sent to the recipient or, in the case of the HEAD method,
1287   the media type that would have been sent had the request been a GET.
1288</t>
1289<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Type"/>
1290    Content-Type   = "Content-Type" ":" media-type
1291</artwork></figure>
1292<t>
1293   Media types are defined in <xref target="media.types"/>. An example of the field is
1294</t>
1295<figure><artwork type="example">
1296    Content-Type: text/html; charset=ISO-8859-4
1297</artwork></figure>
1298<t>
1299   Further discussion of methods for identifying the media type of an
1300   entity is provided in <xref target="type"/>.
1301</t>
1302</section>
1303
1304</section>
1305
1306<section title="IANA Considerations" anchor="IANA.considerations">
1307<t>
1308   TBD.
1309</t>
1310</section>
1311
1312<section title="Security Considerations" anchor="security.considerations">
1313<t>
1314   This section is meant to inform application developers, information
1315   providers, and users of the security limitations in HTTP/1.1 as
1316   described by this document. The discussion does not include
1317   definitive solutions to the problems revealed, though it does make
1318   some suggestions for reducing security risks.
1319</t>
1320
1321<section title="Privacy Issues Connected to Accept Headers" anchor="privacy.issues.connected.to.accept.headers">
1322<t>
1323   Accept request-headers can reveal information about the user to all
1324   servers which are accessed. The Accept-Language header in particular
1325   can reveal information the user would consider to be of a private
1326   nature, because the understanding of particular languages is often
1327   strongly correlated to the membership of a particular ethnic group.
1328   User agents which offer the option to configure the contents of an
1329   Accept-Language header to be sent in every request are strongly
1330   encouraged to let the configuration process include a message which
1331   makes the user aware of the loss of privacy involved.
1332</t>
1333<t>
1334   An approach that limits the loss of privacy would be for a user agent
1335   to omit the sending of Accept-Language headers by default, and to ask
1336   the user whether or not to start sending Accept-Language headers to a
1337   server if it detects, by looking for any Vary response-header fields
1338   generated by the server, that such sending could improve the quality
1339   of service.
1340</t>
1341<t>
1342   Elaborate user-customized accept header fields sent in every request,
1343   in particular if these include quality values, can be used by servers
1344   as relatively reliable and long-lived user identifiers. Such user
1345   identifiers would allow content providers to do click-trail tracking,
1346   and would allow collaborating content providers to match cross-server
1347   click-trails or form submissions of individual users. Note that for
1348   many users not behind a proxy, the network address of the host
1349   running the user agent will also serve as a long-lived user
1350   identifier. In environments where proxies are used to enhance
1351   privacy, user agents ought to be conservative in offering accept
1352   header configuration options to end users. As an extreme privacy
1353   measure, proxies could filter the accept headers in relayed requests.
1354   General purpose user agents which provide a high degree of header
1355   configurability &SHOULD; warn users about the loss of privacy which can
1356   be involved.
1357</t>
1358</section>
1359
1360<section title="Content-Disposition Issues" anchor="content-disposition.issues">
1361<t>
1362   RFC 1806 <xref target="RFC1806"/>, from which the often implemented Content-Disposition
1363   (see <xref target="content-disposition"/>) header in HTTP is derived, has a number of very
1364   serious security considerations. Content-Disposition is not part of
1365   the HTTP standard, but since it is widely implemented, we are
1366   documenting its use and risks for implementors. See RFC 2183 <xref target="RFC2183"/>
1367   (which updates RFC 1806) for details.
1368</t>
1369</section>
1370
1371</section>
1372
1373<section title="Acknowledgments" anchor="ack">
1374<t>
1375   Based on an XML translation of RFC 2616 by Julian Reschke.
1376</t>
1377</section>
1378</middle>
1379<back>
1380<references>
1381
1382<reference anchor="RFC1766">
1383<front>
1384<title abbrev="Language Tag">Tags for the Identification of Languages</title>
1385<author initials="H." surname="Alvestrand" fullname="Harald Tveit Alvestrand">
1386<organization>UNINETT</organization>
1387<address>
1388<postal>
1389<street>Pb. 6883 Elgeseter</street>
1390<city>Trondheim</city>
1391<region/>
1392<code>N-7002</code>
1393<country>NO</country></postal>
1394<phone>+47 73 597094</phone>
1395<email>Harald.T.Alvestrand@uninett.no</email></address></author>
1396<date month="March" year="1995"/>
1397</front>
1398<seriesInfo name="RFC" value="1766"/>
1399</reference>
1400
1401<reference anchor="RFC2045">
1402<front>
1403<title abbrev="Internet Message Bodies">Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies</title>
1404<author initials="N." surname="Freed" fullname="Ned Freed">
1405<organization>Innosoft International, Inc.</organization>
1406<address>
1407<postal>
1408<street>1050 East Garvey Avenue South</street>
1409<city>West Covina</city>
1410<region>CA</region>
1411<code>91790</code>
1412<country>US</country></postal>
1413<phone>+1 818 919 3600</phone>
1414<facsimile>+1 818 919 3614</facsimile>
1415<email>ned@innosoft.com</email></address></author>
1416<author initials="N.S." surname="Borenstein" fullname="Nathaniel S. Borenstein">
1417<organization>First Virtual Holdings</organization>
1418<address>
1419<postal>
1420<street>25 Washington Avenue</street>
1421<city>Morristown</city>
1422<region>NJ</region>
1423<code>07960</code>
1424<country>US</country></postal>
1425<phone>+1 201 540 8967</phone>
1426<facsimile>+1 201 993 3032</facsimile>
1427<email>nsb@nsb.fv.com</email></address></author>
1428<date month="November" year="1996"/>
1429</front>
1430<seriesInfo name="RFC" value="2045"/>
1431</reference>
1432
1433<reference anchor="RFC822">
1434<front>
1435<title abbrev="Standard for ARPA Internet Text Messages">Standard for the format of ARPA Internet text messages</title>
1436<author initials="D.H." surname="Crocker" fullname="David H. Crocker">
1437<organization>University of Delaware, Dept. of Electrical Engineering</organization>
1438<address>
1439<postal>
1440<street/>
1441<city>Newark</city>
1442<region>DE</region>
1443<code>19711</code>
1444<country>US</country></postal>
1445<email>DCrocker@UDel-Relay</email></address></author>
1446<date month="August" day="13" year="1982"/></front>
1447<seriesInfo name="STD" value="11"/>
1448<seriesInfo name="RFC" value="822"/>
1449</reference>
1450
1451<reference anchor="RFC1867">
1452<front>
1453<title>Form-based File Upload in HTML</title>
1454<author initials="L." surname="Masinter" fullname="Larry Masinter">
1455<organization>Xerox Palo Alto Research Center</organization>
1456<address>
1457<postal>
1458<street>3333 Coyote Hill Road</street>
1459<city>Palo Alto</city>
1460<region>CA</region>
1461<code>94304</code>
1462<country>US</country></postal>
1463<phone>+1 415 812 4365</phone>
1464<facsimile>+1 415 812 4333</facsimile>
1465<email>masinter@parc.xerox.com</email></address></author>
1466<author initials="E." surname="Nebel" fullname="Ernesto Nebel">
1467<organization>XSoft, Xerox Corporation</organization>
1468<address>
1469<postal>
1470<street>10875 Rancho Bernardo Road</street>
1471<street>Suite 200</street>
1472<city>San Diego</city>
1473<region>CA</region>
1474<code>92127-2116</code>
1475<country>US</country></postal>
1476<phone>+1 619 676 7817</phone>
1477<facsimile>+1 619 676 7865</facsimile>
1478<email>nebel@xsoft.sd.xerox.com</email></address></author>
1479<date month="November" year="1995"/>
1480</front>
1481<seriesInfo name="RFC" value="1867"/>
1482</reference>
1483
1484<reference anchor="RFC1590">
1485<front>
1486<title>Media Type Registration Procedure</title>
1487<author initials="J." surname="Postel" fullname="Jon Postel">
1488<organization>USC/Information Sciences Institute</organization>
1489<address>
1490<postal>
1491<street>4676 Admiralty Way</street>
1492<city>Marina del Rey</city>
1493<region>CA</region>
1494<code>90292</code>
1495<country>US</country></postal>
1496<phone>+1 310 822 1511</phone>
1497<facsimile>+1 310 823 6714</facsimile>
1498<email>Postel@ISI.EDU</email></address></author>
1499<date month="November" year="1996"/>
1500</front>
1501<seriesInfo name="RFC" value="1590"/>
1502</reference>
1503
1504<reference anchor="RFC1700">
1505<front>
1506<title abbrev="Assigned Numbers">Assigned Numbers</title>
1507<author initials="J." surname="Reynolds" fullname="Joyce K. Reynolds">
1508<organization>USC/Information Sciences Institute</organization>
1509<address>
1510<postal>
1511<street>4676 Admiralty Way</street>
1512<city>Marina del Rey</city>
1513<region>CA</region>
1514<code>90292-6695</code>
1515<country>US</country></postal>
1516<phone>+1 310 822 1511</phone>
1517<email>jkrey@isi.edu</email></address></author>
1518<author initials="J." surname="Postel" fullname="Jon Postel">
1519<organization>USC/Information Sciences Institute</organization>
1520<address>
1521<postal>
1522<street>4676 Admiralty Way</street>
1523<city>Marina del Rey</city>
1524<region>CA</region>
1525<code>90292-6695</code>
1526<country>US</country></postal>
1527<phone>+1 310 822 1511</phone>
1528<email>postel@isi.edu</email></address></author>
1529<date month="October" year="1994"/>
1530<abstract>
1531<t/></abstract></front>
1532<seriesInfo name="STD" value="2"/>
1533<seriesInfo name="RFC" value="1700"/>
1534</reference>
1535
1536<reference anchor="RFC1864">
1537<front>
1538<title abbrev="Content-MD5 Header Field">The Content-MD5 Header Field</title>
1539<author initials="J." surname="Myers" fullname="John G. Myers">
1540<organization>Carnegie Mellon University</organization>
1541<address>
1542<phone/>
1543<email>jgm+@cmu.edu</email></address></author>
1544<author initials="M." surname="Rose" fullname="Marshall T. Rose">
1545<organization>Dover Beach Consulting, Inc.</organization>
1546<address>
1547<phone/>
1548<email>mrose@dbc.mtview.ca.us</email></address></author>
1549<date month="October" year="1995"/>
1550</front>
1551<seriesInfo name="RFC" value="1864"/>
1552</reference>
1553
1554
1555<reference anchor="RFC1952">
1556<front>
1557<title>GZIP file format specification version 4.3</title>
1558<author initials="P." surname="Deutsch" fullname="L. Peter Deutsch">
1559<organization>Aladdin Enterprises</organization>
1560<address>
1561<postal>
1562<street>203 Santa Margarita Ave.</street>
1563<city>Menlo Park</city>
1564<region>CA</region>
1565<code>94025</code>
1566<country>US</country></postal>
1567<phone>+1 415 322 0103</phone>
1568<facsimile>+1 415 322 1734</facsimile>
1569<email>ghost@aladdin.com</email></address></author>
1570<author initials="J-L." surname="Gailly" fullname="Jean-Loup Gailly">
1571<organization/>
1572<address>
1573<postal>
1574<street/>
1575<city/>
1576<region/>
1577<code/>
1578<country/></postal>
1579<phone/>
1580<email>gzip@prep.ai.mit.edu</email></address></author>
1581<author initials="M." surname="Adler" fullname="Mark Adler">
1582<organization/>
1583<address>
1584<postal>
1585<street/>
1586<city/>
1587<region/>
1588<code/>
1589<country/></postal>
1590<phone/>
1591<email>madler@alumni.caltech.edu</email></address></author>
1592<author initials="L.P." surname="Deutsch" fullname="L. Peter Deutsch">
1593<organization/>
1594<address>
1595<postal>
1596<street/>
1597<city/>
1598<region/>
1599<code/>
1600<country/></postal>
1601<phone/>
1602<email>ghost@aladdin.com</email></address></author>
1603<author initials="G." surname="Randers-Pehrson" fullname="Glenn Randers-Pehrson">
1604<organization/>
1605<address>
1606<postal>
1607<street/>
1608<city/>
1609<region/>
1610<code/>
1611<country/></postal>
1612<phone/>
1613<email>randeg@alumni.rpi.edu</email></address></author>
1614<date month="May" year="1996"/>
1615</front>
1616<seriesInfo name="RFC" value="1952"/>
1617</reference>
1618
1619<reference anchor="RFC1951">
1620<front>
1621<title>DEFLATE Compressed Data Format Specification version 1.3</title>
1622<author initials="P." surname="Deutsch" fullname="L. Peter Deutsch">
1623<organization>Aladdin Enterprises</organization>
1624<address>
1625<postal>
1626<street>203 Santa Margarita Ave.</street>
1627<city>Menlo Park</city>
1628<region>CA</region>
1629<code>94025</code>
1630<country>US</country></postal>
1631<phone>+1 415 322 0103</phone>
1632<facsimile>+1 415 322 1734</facsimile>
1633<email>ghost@aladdin.com</email></address></author>
1634<date month="May" year="1996"/>
1635<abstract>
1636<t>This specification defines a lossless compressed data format that compresses data using a combination of the LZ77 algorithm and Huffman coding, with efficiency comparable to the best currently available general-purpose compression methods.  The data can be produced or consumed, even for an arbitrarily long sequentially presented input data stream, using only an a priori bounded amount of intermediate storage.  The format can be implemented readily in a manner not covered by patents.</t></abstract></front>
1637<seriesInfo name="RFC" value="1951"/>
1638</reference>
1639
1640<reference anchor="RFC1950">
1641<front>
1642<title>ZLIB Compressed Data Format Specification version 3.3</title>
1643<author initials="L.P." surname="Deutsch" fullname="L. Peter Deutsch">
1644<organization>Aladdin Enterprises</organization>
1645<address>
1646<postal>
1647<street>203 Santa Margarita Ave.</street>
1648<city>Menlo Park</city>
1649<region>CA</region>
1650<code>94025</code>
1651<country>US</country></postal>
1652<phone>+1 415 322 0103</phone>
1653<facsimile>+1 415 322 1734</facsimile>
1654<email>ghost@aladdin.com</email></address></author>
1655<author initials="J-L." surname="Gailly" fullname="Jean-Loup Gailly">
1656<organization/></author>
1657<date month="May" year="1996"/>
1658<abstract>
1659<t>This specification defines a lossless compressed data format.  The data can be produced or consumed, even for an arbitrarily long sequentially presented input data stream, using only an a priori bounded amount of intermediate storage.  The format presently uses the DEFLATE compression method but can be easily extended to use
1660   other compression methods.  It can be implemented readily in a manner not covered by patents.  This specification also defines the ADLER-32 checksum (an extension and improvement of the Fletcher checksum), used for detection of data corruption, and provides an algorithm for computing it.</t></abstract></front>
1661<seriesInfo name="RFC" value="1950"/>
1662</reference>
1663
1664<reference anchor="RFC2068">
1665<front>
1666<title abbrev="HTTP/1.1">Hypertext Transfer Protocol -- HTTP/1.1</title>
1667<author initials="R." surname="Fielding" fullname="Roy T. Fielding">
1668<organization>University of California, Irvine, Department of Information and Computer Science</organization>
1669<address>
1670<postal>
1671<street/>
1672<city>Irvine</city>
1673<region>CA</region>
1674<code>92717-3425</code>
1675<country>US</country></postal>
1676<facsimile>+1 714 824 4056</facsimile>
1677<email>fielding@ics.uci.edu</email></address></author>
1678<author initials="J." surname="Gettys" fullname="Jim Gettys">
1679<organization>MIT Laboratory for Computer Science</organization>
1680<address>
1681<postal>
1682<street>545 Technology Square</street>
1683<city>Cambridge</city>
1684<region>MA</region>
1685<code>02139</code>
1686<country>US</country></postal>
1687<facsimile>+1 617 258 8682</facsimile>
1688<email>jg@w3.org</email></address></author>
1689<author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
1690<organization>Digital Equipment Corporation, Western Research Laboratory</organization>
1691<address>
1692<postal>
1693<street>250 University Avenue</street>
1694<city>Palo Alto</city>
1695<region>CA</region>
1696<code>94301</code>
1697<country>US</country></postal>
1698<email>mogul@wrl.dec.com</email></address></author>
1699<author initials="H." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
1700<organization>MIT Laboratory for Computer Science</organization>
1701<address>
1702<postal>
1703<street>545 Technology Square</street>
1704<city>Cambridge</city>
1705<region>MA</region>
1706<code>02139</code>
1707<country>US</country></postal>
1708<facsimile>+1 617 258 8682</facsimile>
1709<email>frystyk@w3.org</email></address></author>
1710<author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1711<organization>MIT Laboratory for Computer Science</organization>
1712<address>
1713<postal>
1714<street>545 Technology Square</street>
1715<city>Cambridge</city>
1716<region>MA</region>
1717<code>02139</code>
1718<country>US</country></postal>
1719<facsimile>+1 617 258 8682</facsimile>
1720<email>timbl@w3.org</email></address></author>
1721<date month="January" year="1997"/>
1722<abstract>
1723<t>The Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed, collaborative, hypermedia information systems. It is a generic, stateless, object-oriented protocol which can be used for many tasks, such as name servers and distributed object management systems, through extension of its request methods. A feature of HTTP is the typing and negotiation of data representation, allowing systems to be built independently of the data being transferred.</t>
1724<t>HTTP has been in use by the World-Wide Web global information initiative since 1990. This specification defines the protocol referred to as "HTTP/1.1".</t></abstract></front>
1725<seriesInfo name="RFC" value="2068"/>
1726</reference>
1727
1728<reference anchor="RFC1806">
1729<front>
1730<title abbrev="Content-Disposition">Communicating Presentation Information in Internet Messages: The Content-Disposition Header</title>
1731<author initials="R." surname="Troost" fullname="Rens Troost">
1732<organization>New Century Systems</organization>
1733<address>
1734<postal>
1735<street>324 East 41st Street #804</street>
1736<city>New York</city>
1737<region>NY</region>
1738<code>10017</code>
1739<country>US</country></postal>
1740<phone>+1 212 557 2050</phone>
1741<facsimile>+1 212 557 2049</facsimile>
1742<email>rens@century.com</email></address></author>
1743<author initials="S." surname="Dorner" fullname="Steve Dorner">
1744<organization>QUALCOMM Incorporated</organization>
1745<address>
1746<postal>
1747<street>6455 Lusk Boulevard</street>
1748<city>San Diego</city>
1749<region>CA</region>
1750<code>92121</code>
1751<country>US</country></postal>
1752<email>sdorner@qualcomm.com</email></address></author>
1753<date month="June" year="1995"/>
1754<abstract>
1755<t>This memo provides a mechanism whereby messages conforming to the("MIME") specification can convey presentational information.  It specifies a new "Content-Disposition" header, optional and valid for anyentity ("message" or "body part"). Two values for this header are described in this memo; one for the ordinary linear presentation of the body part, and another to facilitate the use of mail to transfer files. It is expected that more values will be defined in the future, and procedures are defined for extending this set of values.</t>
1756<t>This document is intended as an extension to. As such, the reader is assumed to be familiar with, and. The information presented herein supplements but does not replace that found in those documents.</t></abstract></front>
1757<seriesInfo name="RFC" value="1806"/>
1758</reference>
1759
1760<reference anchor="RFC2076">
1761<front>
1762<title abbrev="Internet Message Headers">Common Internet Message Headers</title>
1763<author initials="J." surname="Palme" fullname="Jacob Palme">
1764<organization>Stockholm University/KTH</organization>
1765<address>
1766<postal>
1767<street>Electrum 230</street>
1768<street>S-164 40 Kista</street>
1769<country>SE</country></postal>
1770<phone>+46 8 161667</phone>
1771<facsimile>+46 8 7830829</facsimile>
1772<email>jpalme@dsv.su.se</email></address></author>
1773<date month="February" year="1997"/>
1774<abstract>
1775<t>This memo contains a table of commonly occurring headers in headings of e-mail messages. The document compiles information from other RFCs such as RFC 822, RFC 1036, RFC 1123, RFC 1327, RFC 1496, RFC 1521, RFC 1766, RFC 1806, RFC 1864 and RFC 1911. A few commonly occurring headers which are not defined in RFCs are also included. For each header, the memo gives a short description and a reference to the RFC in which the header is defined.</t></abstract></front>
1776<seriesInfo name="RFC" value="2076"/>
1777</reference>
1778
1779<reference anchor="RFC2279">
1780<front>
1781<title abbrev="UTF-8">UTF-8, a transformation format of ISO 10646</title>
1782<author initials="F." surname="Yergeau" fullname="Francois Yergeau">
1783<organization>Alis Technologies</organization>
1784<address>
1785<postal>
1786<street>100, boul. Alexis-Nihon</street>
1787<street>Suite 600</street>
1788<city>Montreal</city>
1789<region>Quebec</region>
1790<code>H4M 2P2</code>
1791<country>CA</country></postal>
1792<phone>+1 514 747 2547</phone>
1793<facsimile>+1 514 747 2561</facsimile>
1794<email>fyergeau@alis.com</email></address></author>
1795<date month="January" year="1998"/>
1796<abstract>
1797<t>ISO/IEC 10646-1 defines a multi-octet character set called the Universal Character Set (UCS) which encompasses most of the world's writing systems. Multi-octet characters, however, are not compatible with many current applications and protocols, and this has led to the development of a few so-called UCS transformation formats (UTF), each with different characteristics.  UTF-8, the object of this memo, has the characteristic of preserving the full US-ASCII range, providing compatibility with file systems, parsers and other software that rely on US-ASCII values but are transparent to other values. This memo updates and replaces RFC 2044, in particular addressing the question of versions of the relevant standards.</t></abstract></front>
1798<seriesInfo name="RFC" value="2279"/>
1799</reference>
1800
1801<reference anchor="RFC2046">
1802<front>
1803<title abbrev="Media Types">Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types</title>
1804<author initials="N." surname="Freed" fullname="Ned Freed">
1805<organization>Innosoft International, Inc.</organization>
1806<address>
1807<postal>
1808<street>1050 East Garvey Avenue South</street>
1809<city>West Covina</city>
1810<region>CA</region>
1811<code>91790</code>
1812<country>US</country></postal>
1813<phone>+1 818 919 3600</phone>
1814<facsimile>+1 818 919 3614</facsimile>
1815<email>ned@innosoft.com</email></address></author>
1816<author initials="N." surname="Borenstein" fullname="Nathaniel S. Borenstein">
1817<organization>First Virtual Holdings</organization>
1818<address>
1819<postal>
1820<street>25 Washington Avenue</street>
1821<city>Morristown</city>
1822<region>NJ</region>
1823<code>07960</code>
1824<country>US</country></postal>
1825<phone>+1 201 540 8967</phone>
1826<facsimile>+1 201 993 3032</facsimile>
1827<email>nsb@nsb.fv.com</email></address></author>
1828<date month="November" year="1996"/>
1829</front>
1830<seriesInfo name="RFC" value="2046"/>
1831</reference>
1832
1833<reference anchor="RFC2277">
1834<front>
1835<title abbrev="Charset Policy">IETF Policy on Character Sets and Languages</title>
1836<author initials="H.T." surname="Alvestrand" fullname="Harald Tveit Alvestrand">
1837<organization>UNINETT</organization>
1838<address>
1839<postal>
1840<street>P.O.Box 6883 Elgeseter</street>
1841<street>N-7002 TRONDHEIM</street>
1842<country>NORWAY</country></postal>
1843<phone>+47 73 59 70 94</phone>
1844<email>Harald.T.Alvestrand@uninett.no</email></address></author>
1845<date month="January" year="1998"/>
1846<area>Applications</area>
1847<keyword>Internet Engineering Task Force</keyword>
1848<keyword>character encoding</keyword></front>
1849<seriesInfo name="BCP" value="18"/>
1850<seriesInfo name="RFC" value="2277"/>
1851</reference>
1852
1853<reference anchor="RFC2110">
1854<front>
1855<title abbrev="MHTML">MIME E-mail Encapsulation of Aggregate Documents, such as HTML (MHTML)</title>
1856<author initials="J." surname="Palme" fullname="Jacob Palme">
1857<organization>Stockholm University and KTH</organization>
1858<address>
1859<postal>
1860<street>Electrum 230</street>
1861<street>S-164 40 Kista</street>
1862<country>Sweden</country></postal>
1863<phone>+46-8-16 16 67</phone>
1864<facsimile>+46-8-783 08 29</facsimile>
1865<email>jpalme@dsv.su.se</email></address></author>
1866<author initials="A." surname="Hopmann" fullname="Alex Hopmann">
1867<organization>Microsoft Corporation</organization>
1868<address>
1869<postal>
1870<street>3590 North First Street</street>
1871<street>Suite 300</street>
1872<street>San Jose</street>
1873<street>CA 95134</street>
1874<street>Working group chairman:</street></postal>
1875<email>alexhop@microsoft.com</email></address></author>
1876<date month="March" year="1997"/>
1877<area>Applications</area>
1878<keyword>encapsulate</keyword>
1879<keyword>hypertext markup language</keyword>
1880<keyword>mail</keyword>
1881<keyword>multipurpose internet mail extensions</keyword>
1882</front>
1883<seriesInfo name="RFC" value="2110"/>
1884</reference>
1885
1886<reference anchor="RFC2049">
1887<front>
1888<title abbrev="MIME Conformance">Multipurpose Internet Mail Extensions (MIME) Part Five: Conformance Criteria and Examples</title>
1889<author initials="N." surname="Freed" fullname="Ned Freed">
1890<organization>Innosoft International, Inc.</organization>
1891<address>
1892<postal>
1893<street>1050 East Garvey Avenue South</street>
1894<street>West Covina</street>
1895<street>CA 91790</street>
1896<country>USA</country></postal>
1897<phone>+1 818 919 3600</phone>
1898<facsimile>+1 818 919 3614</facsimile>
1899<email>ned@innosoft.com</email></address></author>
1900<author initials="N.S." surname="Borenstein" fullname="Nathaniel S. Borenstein">
1901<organization>First Virtual Holdings</organization>
1902<address>
1903<postal>
1904<street>25 Washington Avenue</street>
1905<street>Morristown</street>
1906<street>NJ 07960</street>
1907<country>USA</country></postal>
1908<phone>+1 201 540 8967</phone>
1909<facsimile>+1 201 993 3032</facsimile>
1910<email>nsb@nsb.fv.com</email></address></author>
1911<date month="November" year="1996"/>
1912<area>Applications</area>
1913<keyword>mail</keyword>
1914<keyword>multipurpose internet mail extensions</keyword>
1915</front>
1916<seriesInfo name="RFC" value="2049"/>
1917</reference>
1918
1919<reference anchor="RFC2183">
1920<front>
1921<title abbrev="Content-Disposition">Communicating Presentation Information in Internet Messages: The Content-Disposition Header Field</title>
1922<author initials="R." surname="Troost" fullname="Rens Troost">
1923<organization>New Century Systems</organization>
1924<address>
1925<postal>
1926<street>324 East 41st Street #804</street>
1927<street>New York</street>
1928<street>NY</street>
1929<street>10017</street>
1930<country>USA</country></postal>
1931<phone>+1 (212) 557-2050</phone>
1932<facsimile>+1 (212) 557-2049</facsimile>
1933<email>rens@century.com</email></address></author>
1934<author initials="S." surname="Dorner" fullname="Steve Dorner">
1935<organization>QUALCOMM Incorporated</organization>
1936<address>
1937<postal>
1938<street>6455 Lusk Boulevard</street>
1939<street>San Diego</street>
1940<street>CA 92121</street>
1941<country>USA</country></postal>
1942<email>sdorner@qualcomm.com</email></address></author>
1943<author initials="K." surname="Moore" fullname="Keith Moore">
1944<organization>Department of Computer Science</organization>
1945<address>
1946<postal>
1947<street>University of Tennessee</street>
1948<street>Knoxville</street>
1949<street>107 Ayres Hall</street>
1950<street>Knoxville TN  37996-1301</street>
1951<country>USA</country></postal>
1952<phone>+1 (423) 974-5067</phone>
1953<facsimile>+1 (423) 974-8296</facsimile>
1954<email>moore@cs.utk.edu</email></address></author>
1955<date month="August" year="1997"/>
1956<area>Applications</area>
1957<keyword>MIME</keyword>
1958<keyword>internet message</keyword>
1959<keyword>multipurpose internet mail extensions</keyword>
1960</front>
1961<seriesInfo name="RFC" value="2183"/>
1962</reference>
1963
1964</references>
1965
1966<section title="Differences Between HTTP Entities and RFC 2045 Entities" anchor="differences.between.http.entities.and.rfc.2045.entities">
1967<t>
1968   HTTP/1.1 uses many of the constructs defined for Internet Mail (RFC
1969   822 <xref target="RFC822"/>) and the Multipurpose Internet Mail Extensions (MIME <xref target="RFC2045"/>) to
1970   allow entities to be transmitted in an open variety of
1971   representations and with extensible mechanisms. However, RFC 2045
1972   discusses mail, and HTTP has a few features that are different from
1973   those described in RFC 2045. These differences were carefully chosen
1974   to optimize performance over binary connections, to allow greater
1975   freedom in the use of new media types, to make date comparisons
1976   easier, and to acknowledge the practice of some early HTTP servers
1977   and clients.
1978</t>
1979<t>
1980   This appendix describes specific areas where HTTP differs from RFC
1981   2045. Proxies and gateways to strict MIME environments &SHOULD; be
1982   aware of these differences and provide the appropriate conversions
1983   where necessary. Proxies and gateways from MIME environments to HTTP
1984   also need to be aware of the differences because some conversions
1985   might be required.
1986</t>
1987<section title="MIME-Version" anchor="mime-version">
1988<t>
1989   HTTP is not a MIME-compliant protocol. However, HTTP/1.1 messages &MAY;
1990   include a single MIME-Version general-header field to indicate what
1991   version of the MIME protocol was used to construct the message. Use
1992   of the MIME-Version header field indicates that the message is in
1993   full compliance with the MIME protocol (as defined in RFC 2045<xref target="RFC2045"/>).
1994   Proxies/gateways are responsible for ensuring full compliance (where
1995   possible) when exporting HTTP messages to strict MIME environments.
1996</t>
1997<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="MIME-Version"/>
1998    MIME-Version   = "MIME-Version" ":" 1*DIGIT "." 1*DIGIT
1999</artwork></figure>
2000<t>
2001   MIME version "1.0" is the default for use in HTTP/1.1. However,
2002   HTTP/1.1 message parsing and semantics are defined by this document
2003   and not the MIME specification.
2004</t>
2005</section>
2006
2007<section title="Conversion to Canonical Form" anchor="conversion.to.canonical.form">
2008<t>
2009   RFC 2045 <xref target="RFC2045"/> requires that an Internet mail entity be converted to
2010   canonical form prior to being transferred, as described in section <xref target="RFC2049" x:fmt="number" x:sec="4"/>
2011   of RFC 2049 <xref target="RFC2049"/>. <xref target="canonicalization.and.text.defaults"/> of this document describes the forms
2012   allowed for subtypes of the "text" media type when transmitted over
2013   HTTP. RFC 2046 requires that content with a type of "text" represent
2014   line breaks as CRLF and forbids the use of CR or LF outside of line
2015   break sequences. HTTP allows CRLF, bare CR, and bare LF to indicate a
2016   line break within text content when a message is transmitted over
2017   HTTP.
2018</t>
2019<t>
2020   Where it is possible, a proxy or gateway from HTTP to a strict MIME
2021   environment &SHOULD; translate all line breaks within the text media
2022   types described in <xref target="canonicalization.and.text.defaults"/> of this document to the RFC 2049
2023   canonical form of CRLF. Note, however, that this might be complicated
2024   by the presence of a Content-Encoding and by the fact that HTTP
2025   allows the use of some character sets which do not use octets 13 and
2026   10 to represent CR and LF, as is the case for some multi-byte
2027   character sets.
2028</t>
2029<t>
2030   Implementors should note that conversion will break any cryptographic
2031   checksums applied to the original content unless the original content
2032   is already in canonical form. Therefore, the canonical form is
2033   recommended for any content that uses such checksums in HTTP.
2034</t>
2035</section>
2036
2037<section title="Introduction of Content-Encoding" anchor="introduction.of.content-encoding">
2038<t>
2039   RFC 2045 does not include any concept equivalent to HTTP/1.1's
2040   Content-Encoding header field. Since this acts as a modifier on the
2041   media type, proxies and gateways from HTTP to MIME-compliant
2042   protocols &MUST; either change the value of the Content-Type header
2043   field or decode the entity-body before forwarding the message. (Some
2044   experimental applications of Content-Type for Internet mail have used
2045   a media-type parameter of ";conversions=&lt;content-coding&gt;" to perform
2046   a function equivalent to Content-Encoding. However, this parameter is
2047   not part of RFC 2045).
2048</t>
2049</section>
2050
2051<section title="No Content-Transfer-Encoding" anchor="no.content-transfer-encoding">
2052<t>
2053   HTTP does not use the Content-Transfer-Encoding (CTE) field of RFC
2054   2045. Proxies and gateways from MIME-compliant protocols to HTTP &MUST;
2055   remove any non-identity CTE ("quoted-printable" or "base64") encoding
2056   prior to delivering the response message to an HTTP client.
2057</t>
2058<t>
2059   Proxies and gateways from HTTP to MIME-compliant protocols are
2060   responsible for ensuring that the message is in the correct format
2061   and encoding for safe transport on that protocol, where "safe
2062   transport" is defined by the limitations of the protocol being used.
2063   Such a proxy or gateway &SHOULD; label the data with an appropriate
2064   Content-Transfer-Encoding if doing so will improve the likelihood of
2065   safe transport over the destination protocol.
2066</t>
2067</section>
2068
2069<section title="Introduction of Transfer-Encoding" anchor="introduction.of.transfer-encoding">
2070<t>
2071   HTTP/1.1 introduces the Transfer-Encoding header field (&header-transfer-encoding;).
2072   Proxies/gateways &MUST; remove any transfer-coding prior to
2073   forwarding a message via a MIME-compliant protocol.
2074</t>
2075</section>
2076
2077<section title="MHTML and Line Length Limitations" anchor="mhtml.line.length">
2078<t>
2079   HTTP implementations which share code with MHTML <xref target="RFC2110"/> implementations
2080   need to be aware of MIME line length limitations. Since HTTP does not
2081   have this limitation, HTTP does not fold long lines. MHTML messages
2082   being transported by HTTP follow all conventions of MHTML, including
2083   line length limitations and folding, canonicalization, etc., since
2084   HTTP transports all message-bodies as payload (see <xref target="multipart.types"/>) and
2085   does not interpret the content or any MIME header lines that might be
2086   contained therein.
2087</t>
2088</section>
2089</section>
2090
2091<section title="Additional Features" anchor="additional.features">
2092<t>
2093   RFC 1945 and RFC 2068 document protocol elements used by some
2094   existing HTTP implementations, but not consistently and correctly
2095   across most HTTP/1.1 applications. Implementors are advised to be
2096   aware of these features, but cannot rely upon their presence in, or
2097   interoperability with, other HTTP/1.1 applications. Some of these
2098   describe proposed experimental features, and some describe features
2099   that experimental deployment found lacking that are now addressed in
2100   the base HTTP/1.1 specification.
2101</t>
2102<t>
2103   A number of other headers, such as Content-Disposition and Title,
2104   from SMTP and MIME are also often implemented (see RFC 2076 <xref target="RFC2076"/>).
2105</t>
2106
2107<section title="Content-Disposition" anchor="content-disposition">
2108<iref item="Headers" subitem="Content-Disposition" primary="true" x:for-anchor=""/>
2109<iref item="Content-Disposition header" primary="true" x:for-anchor=""/>
2110<t>
2111   The Content-Disposition response-header field has been proposed as a
2112   means for the origin server to suggest a default filename if the user
2113   requests that the content is saved to a file. This usage is derived
2114   from the definition of Content-Disposition in RFC 1806 <xref target="RFC1806"/>.
2115</t>
2116<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"/>
2117     content-disposition = "Content-Disposition" ":"
2118                           disposition-type *( ";" disposition-parm )
2119     disposition-type = "attachment" | disp-extension-token
2120     disposition-parm = filename-parm | disp-extension-parm
2121     filename-parm = "filename" "=" quoted-string
2122     disp-extension-token = token
2123     disp-extension-parm = token "=" ( token | quoted-string )
2124</artwork></figure>
2125<t>
2126   An example is
2127</t>
2128<figure><artwork type="example">
2129     Content-Disposition: attachment; filename="fname.ext"
2130</artwork></figure>
2131<t>
2132   The receiving user agent &SHOULD-NOT;  respect any directory path
2133   information present in the filename-parm parameter, which is the only
2134   parameter believed to apply to HTTP implementations at this time. The
2135   filename &SHOULD; be treated as a terminal component only.
2136</t>
2137<t>
2138   If this header is used in a response with the application/octet-stream
2139   content-type, the implied suggestion is that the user agent
2140   should not display the response, but directly enter a `save response
2141   as...' dialog.
2142</t>
2143<t>
2144   See <xref target="content-disposition.issues"/> for Content-Disposition security issues.
2145</t>
2146</section>
2147</section>
2148
2149<section title="Changes from RFC 2068" anchor="changes.from.rfc.2068">
2150<t>
2151   Charset wildcarding is introduced to avoid explosion of character set
2152   names in accept headers. (<xref target="header.accept-charset"/>)
2153</t>
2154<t>
2155   Content-Base was deleted from the specification: it was not
2156   implemented widely, and there is no simple, safe way to introduce it
2157   without a robust extension mechanism. In addition, it is used in a
2158   similar, but not identical fashion in MHTML <xref target="RFC2110"/>.
2159</t>
2160<t>
2161   A content-coding of "identity" was introduced, to solve problems
2162   discovered in caching. (<xref target="content.codings"/>)
2163</t>
2164<t>
2165   Quality Values of zero should indicate that "I don't want something"
2166   to allow clients to refuse a representation. (<xref target="quality.values"/>)
2167</t>
2168<t>
2169   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
2170   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
2171   specification, but not commonly implemented. See RFC 2068 <xref target="RFC2068"/>.
2172</t>
2173</section>
2174</back>
2175</rfc>
Note: See TracBrowser for help on using the repository browser.