source: draft-ietf-httpbis/latest/p5-range.xml @ 2142

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

(editorial) move header fields to where they are used; no text changes

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/xml
File size: 59.4 KB
Line 
1<?xml version="1.0" encoding="utf-8"?>
2<?xml-stylesheet type='text/xsl' href='../myxml2rfc.xslt'?>
3<!DOCTYPE rfc [
4  <!ENTITY MAY "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MAY</bcp14>">
5  <!ENTITY MUST "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MUST</bcp14>">
6  <!ENTITY MUST-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MUST NOT</bcp14>">
7  <!ENTITY OPTIONAL "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>OPTIONAL</bcp14>">
8  <!ENTITY RECOMMENDED "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>RECOMMENDED</bcp14>">
9  <!ENTITY REQUIRED "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>REQUIRED</bcp14>">
10  <!ENTITY SHALL "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHALL</bcp14>">
11  <!ENTITY SHALL-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHALL NOT</bcp14>">
12  <!ENTITY SHOULD "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHOULD</bcp14>">
13  <!ENTITY SHOULD-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHOULD NOT</bcp14>">
14  <!ENTITY ID-VERSION "latest">
15  <!ENTITY ID-MONTH "January">
16  <!ENTITY ID-YEAR "2013">
17  <!ENTITY Note "<x:h xmlns:x='http://purl.org/net/xml2rfc/ext'>Note:</x:h>">
18  <!ENTITY architecture               "<xref target='Part1' x:rel='#architecture' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
19  <!ENTITY conformance                "<xref target='Part1' x:rel='#conformance' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
20  <!ENTITY notation                   "<xref target='Part1' x:rel='#notation' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
21  <!ENTITY abnf-extension             "<xref target='Part1' x:rel='#abnf.extension' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
22  <!ENTITY acks                       "<xref target='Part1' x:rel='#acks' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
23  <!ENTITY whitespace                 "<xref target='Part1' x:rel='#whitespace' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
24  <!ENTITY field-components           "<xref target='Part1' x:rel='#field.components' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
25  <!ENTITY http-date                  "<xref target='Part2' x:rel='#http.date' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
26  <!ENTITY messaging                  "<xref target='Part1' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
27  <!ENTITY semantics                  "<xref target='Part2' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
28  <!ENTITY entity-tags                "<xref target='Part4' x:rel='#header.etag' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
29  <!ENTITY weak-and-strong-validators "<xref target='Part4' x:rel='#weak.and.strong.validators' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
30  <!ENTITY lastmod-comparison         "<xref target='Part4' x:rel='#lastmod.comparison' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
31  <!ENTITY p6-heuristic               "<xref target='Part6' x:rel='#heuristic.freshness' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
32]>
33<?rfc toc="yes" ?>
34<?rfc symrefs="yes" ?>
35<?rfc sortrefs="yes" ?>
36<?rfc compact="yes"?>
37<?rfc subcompact="no" ?>
38<?rfc linkmailto="no" ?>
39<?rfc editing="no" ?>
40<?rfc comments="yes"?>
41<?rfc inline="yes"?>
42<?rfc rfcedstyle="yes"?>
43<?rfc-ext allow-markup-in-artwork="yes" ?>
44<?rfc-ext include-references-in-index="yes" ?>
45<rfc obsoletes="2616" category="std" x:maturity-level="proposed"
46     ipr="pre5378Trust200902" docName="draft-ietf-httpbis-p5-range-&ID-VERSION;"
47     xmlns:x='http://purl.org/net/xml2rfc/ext'>
48<x:link rel="prev" basename="p4-conditional"/>
49<x:link rel="next" basename="p6-cache"/>
50<x:feedback template="mailto:ietf-http-wg@w3.org?subject={docname},%20%22{section}%22&amp;body=&lt;{ref}&gt;:"/>
51<front>
52
53  <title abbrev="HTTP/1.1 Range Requests">Hypertext Transfer Protocol (HTTP/1.1): Range Requests</title>
54
55  <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
56    <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
57    <address>
58      <postal>
59        <street>345 Park Ave</street>
60        <city>San Jose</city>
61        <region>CA</region>
62        <code>95110</code>
63        <country>USA</country>
64      </postal>
65      <email>fielding@gbiv.com</email>
66      <uri>http://roy.gbiv.com/</uri>
67    </address>
68  </author>
69
70  <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
71    <organization abbrev="W3C">World Wide Web Consortium</organization>
72    <address>
73      <postal>
74        <street>W3C / ERCIM</street>
75        <street>2004, rte des Lucioles</street>
76        <city>Sophia-Antipolis</city>
77        <region>AM</region>
78        <code>06902</code>
79        <country>France</country>
80      </postal>
81      <email>ylafon@w3.org</email>
82      <uri>http://www.raubacapeu.net/people/yves/</uri>
83    </address>
84  </author>
85
86  <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
87    <organization abbrev="greenbytes">greenbytes GmbH</organization>
88    <address>
89      <postal>
90        <street>Hafenweg 16</street>
91        <city>Muenster</city><region>NW</region><code>48155</code>
92        <country>Germany</country>
93      </postal>
94      <email>julian.reschke@greenbytes.de</email>
95      <uri>http://greenbytes.de/tech/webdav/</uri>
96    </address>
97  </author>
98
99  <date month="&ID-MONTH;" year="&ID-YEAR;"/>
100  <workgroup>HTTPbis Working Group</workgroup>
101
102<abstract>
103<t>
104   The Hypertext Transfer Protocol (HTTP) is an application-level protocol for
105   distributed, collaborative, hypertext information systems. This document
106   defines range requests and the rules for constructing and combining
107   responses to those requests.
108</t>
109</abstract>
110
111<note title="Editorial Note (To be removed by RFC Editor)">
112  <t>
113    Discussion of this draft takes place on the HTTPBIS working group
114    mailing list (ietf-http-wg@w3.org), which is archived at
115    <eref target="http://lists.w3.org/Archives/Public/ietf-http-wg/"/>.
116  </t>
117  <t>
118    The current issues list is at
119    <eref target="http://tools.ietf.org/wg/httpbis/trac/report/3"/> and related
120    documents (including fancy diffs) can be found at
121    <eref target="http://tools.ietf.org/wg/httpbis/"/>.
122  </t>
123  <t>
124    The changes in this draft are summarized in <xref target="changes.since.21"/>.
125  </t>
126</note>
127</front>
128<middle>
129<section title="Introduction" anchor="introduction">
130<t>
131   HTTP clients often encounter interrupted data transfers as a result
132   of canceled requests or dropped connections.  When a client has stored
133   a partial representation, it is desirable to request the remainder
134   of that representation in a subsequent request rather than transfer
135   the entire representation.
136   There are also a number of Web applications that benefit from being
137   able to request only a subset of a larger representation, such as a
138   single page of a very large document or only part of an image to be
139   rendered by a device with limited local storage.
140</t>
141<t>
142   This document defines HTTP/1.1 range requests,
143   partial responses, and the multipart/byteranges media type.
144   The protocol for range requests is an &OPTIONAL; feature of HTTP,
145   designed so resources or recipients that do not implement this feature
146   can respond as if it is a normal GET request without impacting
147   interoperability.  Partial responses are indicated by a distinct status
148   code to not be mistaken for full responses by intermediate caches
149   that might not implement the feature.
150</t>
151<t>
152   Although the HTTP range request mechanism is designed to allow for
153   extensible range types, this specification only defines requests for
154   byte ranges.
155</t>
156
157<section title="Conformance and Error Handling" anchor="conformance">
158<t>
159   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
160   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
161   document are to be interpreted as described in <xref target="RFC2119"/>.
162</t>
163<t>
164   Conformance criteria and considerations regarding error handling
165   are defined in &conformance;.
166</t>
167</section>
168
169<section title="Syntax Notation" anchor="notation">
170<t>
171   This specification uses the Augmented Backus-Naur Form (ABNF) notation
172   of <xref target="RFC5234"/> with the list rule extension defined in
173   &notation;. <xref target="imported.abnf"/> describes rules imported from
174   other documents. <xref target="collected.abnf"/> shows the collected ABNF
175   with the list rule expanded.
176</t>
177</section>
178</section>
179
180
181<section title="Range Units" anchor="range.units">
182  <x:anchor-alias value="bytes-unit"/>
183  <x:anchor-alias value="other-range-unit"/>
184  <x:anchor-alias value="range-unit"/>
185  <x:anchor-alias value="range unit"/>
186<t>
187   A representation can be partitioned into subranges according to various
188   structural units, depending on the structure inherent in the
189   representation's media type. Such a <x:dfn>range unit</x:dfn> can be used
190   in the <x:ref>Range</x:ref> (<xref target="header.range"/>) and
191   <x:ref>Content-Range</x:ref> (<xref target="header.content-range"/>)
192   header fields to delineate the parts of a representation that are
193   either requested or transferred, respectively.
194</t>
195<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="range-unit"/><iref primary="true" item="Grammar" subitem="bytes-unit"/><iref primary="true" item="Grammar" subitem="other-range-unit"/>
196  <x:ref>range-unit</x:ref>       = <x:ref>bytes-unit</x:ref> / <x:ref>other-range-unit</x:ref>
197  <x:ref>bytes-unit</x:ref>       = "bytes"
198  <x:ref>other-range-unit</x:ref> = <x:ref>token</x:ref>
199</artwork></figure>
200
201<section title="Byte Ranges" anchor="byte.ranges">
202<t>
203   Since all HTTP representations are transferred as sequences
204   of bytes, the concept of a byte range is meaningful for any HTTP
205   representation. (However, not all clients and servers need to support byte-range
206   operations.)
207</t>
208<t>
209   Byte range specifications in HTTP apply to the sequence of bytes in
210   the representation data (not necessarily the same as the message body).
211</t>
212<t anchor="rule.ranges-specifier">
213  <x:anchor-alias value="byte-range-set"/>
214  <x:anchor-alias value="byte-range-spec"/>
215  <x:anchor-alias value="byte-ranges-specifier"/>
216  <x:anchor-alias value="first-byte-pos"/>
217  <x:anchor-alias value="last-byte-pos"/>
218  <x:anchor-alias value="ranges-specifier"/>
219  <x:anchor-alias value="suffix-byte-range-spec"/>
220  <x:anchor-alias value="suffix-length"/>
221   A byte range operation &MAY; specify a single range of bytes, or a set
222   of ranges within a single representation.
223</t>
224<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="ranges-specifier"/><iref primary="true" item="Grammar" subitem="byte-ranges-specifier"/><iref primary="true" item="Grammar" subitem="byte-range-set"/><iref primary="true" item="Grammar" subitem="byte-range-spec"/><iref primary="true" item="Grammar" subitem="first-byte-pos"/><iref primary="true" item="Grammar" subitem="last-byte-pos"/>
225  <x:ref>byte-ranges-specifier</x:ref> = <x:ref>bytes-unit</x:ref> "=" <x:ref>byte-range-set</x:ref>
226  <x:ref>byte-range-set</x:ref>  = 1#( <x:ref>byte-range-spec</x:ref> / <x:ref>suffix-byte-range-spec</x:ref> )
227  <x:ref>byte-range-spec</x:ref> = <x:ref>first-byte-pos</x:ref> "-" [ <x:ref>last-byte-pos</x:ref> ]
228  <x:ref>first-byte-pos</x:ref>  = 1*<x:ref>DIGIT</x:ref>
229  <x:ref>last-byte-pos</x:ref>   = 1*<x:ref>DIGIT</x:ref>
230</artwork></figure>
231<t>
232   The first-byte-pos value in a byte-range-spec gives the byte-offset
233   of the first byte in a range. The last-byte-pos value gives the
234   byte-offset of the last byte in the range; that is, the byte
235   positions specified are inclusive. Byte offsets start at zero.
236</t>
237<t>
238   If the last-byte-pos value is present, it &MUST; be greater than or
239   equal to the first-byte-pos in that byte-range-spec, or the byte-range-spec
240   is syntactically invalid. The recipient of a byte-range-set
241   that includes one or more syntactically invalid byte-range-spec
242   values &MUST; ignore the header field that includes that byte-range-set.
243</t>
244<t>
245   If the last-byte-pos value is absent, or if the value is greater than
246   or equal to the current length of the representation data, last-byte-pos is
247   taken to be equal to one less than the current length of the representation
248   in bytes.
249</t>
250<t>
251   By its choice of last-byte-pos, a client can limit the number of
252   bytes retrieved without knowing the size of the representation.
253</t>
254<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="suffix-byte-range-spec"/><iref primary="true" item="Grammar" subitem="suffix-length"/>
255  <x:ref>suffix-byte-range-spec</x:ref> = "-" <x:ref>suffix-length</x:ref>
256  <x:ref>suffix-length</x:ref> = 1*<x:ref>DIGIT</x:ref>
257</artwork></figure>
258<t>
259   A suffix-byte-range-spec is used to specify the suffix of the
260   representation data, of a length given by the suffix-length value. (That is,
261   this form specifies the last N bytes of a representation.) If the
262   representation is shorter than the specified suffix-length, the entire
263   representation is used.
264</t>
265<t>
266   If a syntactically valid byte-range-set includes at least one byte-range-spec
267   whose first-byte-pos is less than the current length of
268   the representation, or at least one suffix-byte-range-spec with a non-zero
269   suffix-length, then the byte-range-set is satisfiable.
270   Otherwise, the byte-range-set is unsatisfiable. If the byte-range-set
271   is unsatisfiable, the server &SHOULD; send a response with a
272   <x:ref>416 (Range Not Satisfiable)</x:ref> status code. Otherwise, the server
273   &SHOULD; send a response with a <x:ref>206 (Partial Content)</x:ref> status code
274   containing the satisfiable ranges of the representation.
275</t>
276<t>
277   In the byte range syntax, <x:ref>first-byte-pos</x:ref>,
278   <x:ref>last-byte-pos</x:ref>, and <x:ref>suffix-length</x:ref> are
279   expressed as decimal number of octets.  Since there is no predefined limit
280   to the length of an HTTP payload, recipients &SHOULD; anticipate
281   potentially large decimal numerals and prevent parsing errors due to integer
282   conversion overflows.
283</t>
284<t>
285   Examples of byte-ranges-specifier values (assuming a representation of
286   length 10000):
287  <list style="symbols">
288     <t>The first 500 bytes (byte offsets 0-499, inclusive):
289<figure><artwork type="example" x:indent-with="   ">
290  bytes=0-499
291</artwork></figure>
292    </t>
293     <t>The second 500 bytes (byte offsets 500-999, inclusive):
294<figure><artwork type="example" x:indent-with="   ">
295  bytes=500-999
296</artwork></figure>
297    </t>
298     <t>The final 500 bytes (byte offsets 9500-9999, inclusive):
299<figure><artwork type="example" x:indent-with="   ">
300  bytes=-500
301</artwork></figure>
302    Or:
303<figure><artwork type="example" x:indent-with="   ">
304  bytes=9500-
305</artwork></figure>
306    </t>
307     <t>The first and last bytes only (bytes 0 and 9999):
308<figure><artwork type="example" x:indent-with="   ">
309  bytes=0-0,-1
310</artwork></figure>
311     </t>
312     <t>Several legal but not canonical specifications of the second 500
313        bytes (byte offsets 500-999, inclusive):
314<figure><artwork type="example" x:indent-with="   ">
315  bytes=500-600,601-999
316  bytes=500-700,601-999
317</artwork></figure>
318     </t>
319  </list>
320</t>
321</section>
322
323<section title="Other Range Units" anchor="range.units.other">
324<t>
325  The only range unit defined by HTTP/1.1 is "bytes"
326  (<xref target="byte.ranges"/>). Additional units can be defined as described
327  in <xref target="range.unit.registry"/>.
328</t>
329</section>
330<section title="Accept-Ranges" anchor="header.accept-ranges">
331  <iref primary="true" item="Accept-Ranges header field" x:for-anchor=""/>
332  <x:anchor-alias value="Accept-Ranges"/>
333  <x:anchor-alias value="acceptable-ranges"/>
334<t>
335   The "Accept-Ranges" header field allows a resource to indicate
336   its acceptance of range requests.
337</t>
338<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Accept-Ranges"/><iref primary="true" item="Grammar" subitem="acceptable-ranges"/>
339  <x:ref>Accept-Ranges</x:ref>     = <x:ref>acceptable-ranges</x:ref>
340  <x:ref>acceptable-ranges</x:ref> = 1#<x:ref>range-unit</x:ref> / "none"
341</artwork></figure>
342<t>
343   Origin servers that accept byte-range requests &MAY; send
344</t>
345<figure><artwork type="example">
346  Accept-Ranges: bytes
347</artwork></figure>
348<t>
349   but are not required to do so. Clients &MAY; generate range
350   requests without having received this header field for the resource
351   involved. Range units are defined in <xref target="range.units"/>.
352</t>
353<t>
354   Servers that do not accept any kind of range request for a
355   resource &MAY; send
356</t>
357<figure><artwork type="example">
358  Accept-Ranges: none
359</artwork></figure>
360<t>
361   to advise the client not to attempt a range request.
362</t>
363</section>
364</section>
365
366
367<section title="Range Requests" anchor="range.requests">
368<section title="Range" anchor="header.range">
369  <iref primary="true" item="Range header field" x:for-anchor=""/>
370  <x:anchor-alias value="Range"/>
371  <x:anchor-alias value="other-ranges-specifier"/>
372  <x:anchor-alias value="other-range-set"/>
373<t>
374   The "Range" header field on a GET request modifies the method semantics to
375   request transfer of only one or more sub-ranges of the selected
376   representation data in a successful response, rather than the entire
377   representation data.
378</t>
379<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Range"/>
380  <x:ref>Range</x:ref> = <x:ref>byte-ranges-specifier</x:ref> / <x:ref>other-ranges-specifier</x:ref>
381  <x:ref>other-ranges-specifier</x:ref> = <x:ref>other-range-unit</x:ref> "=" <x:ref>other-range-set</x:ref>
382  <x:ref>other-range-set</x:ref> = 1*<x:ref>CHAR</x:ref>
383</artwork></figure>
384<t>
385   A server &MAY; ignore the Range header field. However, origin servers and
386   intermediate caches ought to support byte ranges when possible, since Range
387   supports efficient recovery from partially failed transfers and partial
388   retrieval of large representations. A server &MUST; ignore a Range header
389   field received with a request method other than GET.
390</t>
391<t>
392   An origin server &MUST; ignore a <x:ref>Range</x:ref> header field that
393   contains a range unit it does not understand. A proxy &MAY; either discard
394   a <x:ref>Range</x:ref> header field that contains a range unit it does not
395   understand or pass it to the next inbound server when forwarding the
396   request.
397</t>
398<t>
399   The Range header field is evaluated after evaluating the preconditions of
400   <xref target="Part4"/> and only if the result of their evaluation is
401   leading toward a <x:ref>200 (OK)</x:ref> response. In other words, Range
402   is ignored when a conditional GET would result in a
403   <x:ref>304 (Not Modified)</x:ref> response.
404</t>
405<t>
406   The If-Range header field (<xref target="header.if-range"/>) can be used as
407   a precondition to applying the Range header field.
408</t>
409<t>
410   If all of the preconditions are true, the server supports the Range header
411   field for the target resource, the specified range(s) are syntactically
412   correct (as defined in <xref target="byte.ranges"/>), and at least one of
413   the ranges has a non-empty intersection with the current selected
414   representation extent, then the server &MAY; respond with a status code of
415   <x:ref>206 (Partial Content)</x:ref> and a payload containing one or more
416   partial representations that correspond to those requested, as defined in
417   <xref target="range.response"/>.
418</t>
419</section>
420
421<section title="If-Range" anchor="header.if-range">
422  <iref primary="true" item="If-Range header field" x:for-anchor=""/>
423  <x:anchor-alias value="If-Range"/>
424<t>
425   If a client has a partial copy of a representation and wishes
426   to have an up-to-date copy of the entire representation, it could use the
427   <x:ref>Range</x:ref> header field with a conditional GET (using
428   either or both of <x:ref>If-Unmodified-Since</x:ref> and
429   <x:ref>If-Match</x:ref>.) However, if the condition fails because the
430   representation has been modified, the client would then have to make a
431   second request to obtain the entire current representation.
432</t>
433<t>
434   The "If-Range" header field allows a client to "short-circuit" the second
435   request. Informally, its meaning is: if the representation is unchanged,
436   send me the part(s) that I am requesting in Range; otherwise, send me the
437   entire representation.
438</t>
439<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-Range"/>
440  <x:ref>If-Range</x:ref> = <x:ref>entity-tag</x:ref> / <x:ref>HTTP-date</x:ref>
441</artwork></figure>
442<t>
443   Clients &MUST-NOT; use an entity-tag marked as weak in an If-Range
444   field value and &MUST-NOT; use a <x:ref>Last-Modified</x:ref> date in an
445   If-Range field value unless it has no entity-tag for the representation and
446   the Last-Modified date it does have for the representation is strong
447   in the sense defined by &lastmod-comparison;.
448</t>
449<t>
450   A server that evaluates a conditional range request that is applicable
451   to one of its representations &MUST; evaluate the condition as false if
452   the entity-tag used as a validator is marked as weak or, when an HTTP-date
453   is used as the validator, if the date value is not strong in the sense
454   defined by &lastmod-comparison;. (A server can distinguish between a
455   valid HTTP-date and any form of entity-tag by examining the first
456   two characters.)
457</t>
458<t>
459   The If-Range header field &SHOULD; only be sent by clients together with
460   a Range header field.  The If-Range header field &MUST; be ignored if it
461   is received in a request that does not include a Range header field.
462   The If-Range header field &MUST; be ignored by a server that does not
463   support the sub-range operation.
464</t>
465<t>
466   If the validator given in the If-Range header field matches the current
467   validator for the selected representation of the target resource, then
468   the server &SHOULD; send the specified sub-range of the representation
469   using a <x:ref>206 (Partial Content)</x:ref> response. If the validator
470   does not match, then the server &SHOULD; send the entire representation
471   using a <x:ref>200 (OK)</x:ref> response.
472</t>
473</section>
474</section>
475
476
477<section title="Status Code Definitions" anchor="status.code.definitions">
478<section title="206 Partial Content" anchor="status.206">
479  <iref primary="true" item="206 Partial Content (status code)" x:for-anchor=""/>
480  <x:anchor-alias value="206"/>
481  <x:anchor-alias value="206 (Partial Content)"/>
482<t>
483   The <x:dfn>206 (Partial Content)</x:dfn> status code indicates that the
484   server has fulfilled the partial GET request for the resource.
485   The request &MUST; have included a <x:ref>Range</x:ref> header field
486   (<xref target="header.range"/>) indicating the desired range, and &MAY; have
487   included an <x:ref>If-Range</x:ref> header field
488   (<xref target="header.if-range"/>) to make the request conditional.
489</t>
490<t>
491   When a 206 response is generated, the sender &MUST; generate the following
492   header fields:
493  <list style="symbols">
494    <t>
495        Either a <x:ref>Content-Range</x:ref> header field
496        (<xref target="header.content-range"/>) indicating
497        the range included with this response, or a multipart/byteranges
498        <x:ref>Content-Type</x:ref> including Content-Range fields for each
499        part. If a <x:ref>Content-Length</x:ref> header field is present in the
500        response, its value &MUST; match the actual number of octets
501        transmitted in the message body.
502    </t>
503    <t>
504        Date
505    </t>
506    <t>
507        <x:ref>Cache-Control</x:ref>, <x:ref>ETag</x:ref>,
508        <x:ref>Expires</x:ref>, <x:ref>Content-Location</x:ref> and/or
509        <x:ref>Vary</x:ref>, if the header field would have been sent in a
510        <x:ref>200 (OK)</x:ref> response to the same request
511    </t>
512  </list>
513</t>
514<t>
515   If a 206 is generated in response to a request with an <x:ref>If-Range</x:ref>
516   header field, the sender &SHOULD-NOT; generate other representation header
517   fields beyond those described above.
518   Otherwise, the sender &MUST; generate all of the same representation header
519   fields that would have been sent in a <x:ref>200 (OK)</x:ref> response
520   to the same request.
521</t>
522<t>
523   Caches &MAY; use a heuristic (see &p6-heuristic;) to determine
524   freshness for 206 responses.
525</t>
526</section>
527
528<section title="416 Range Not Satisfiable" anchor="status.416">
529  <iref primary="true" item="416 Range Not Satisfiable (status code)" x:for-anchor=""/>
530  <x:anchor-alias value="416 (Range Not Satisfiable)"/>
531<t>
532   The <x:dfn>416 (Range Not Satisfiable)</x:dfn> status code
533   indicates that none of the ranges-specifier values in the request's
534   <x:ref>Range</x:ref> header field (<xref target="header.range"/>)
535   overlap the current
536   extent of the selected resource and the request did not include an
537   <x:ref>If-Range</x:ref> header field (<xref target="header.if-range"/>).
538   (For byte-ranges, this means that the first-byte-pos of all of the
539   byte-range-spec values were greater than the current length of the selected
540   representation.)
541</t>
542<t>
543   When this status code is sent in response to a byte-range request, the
544   sender &SHOULD; generate a <x:ref>Content-Range</x:ref> header field
545   specifying the current length of the selected representation
546   (see <xref target="header.content-range"/>).
547</t>
548<figure>
549<preamble>For example:</preamble>
550<artwork type="message/http; msgtype=&#34;response&#34;" x:indent-with="  ">
551HTTP/1.1 416 Range Not Satisfiable
552Date: Mon, 20 Jan 2012 15:41:54 GMT
553Content-Range: bytes */47022
554Content-Type: image/gif
555</artwork></figure>
556<x:note>
557  <t>
558    &Note; Clients cannot depend on servers to send a <x:ref>416 (Range Not
559    Satisfiable)</x:ref> response instead of a <x:ref>200 (OK)</x:ref>
560    response for an unsatisfiable <x:ref>Range</x:ref> header field, since not
561    all servers implement this header field.
562  </t>
563</x:note>
564</section>
565</section>
566
567<section title="Responses to a Range Request" anchor="range.response">
568<section title="Response to a Single and Multiple Ranges Request">
569<t>
570   When an HTTP message includes the content of a single range (for
571   example, a response to a request for a single range, or to a request
572   for a set of ranges that overlap without any holes), this content is
573   transmitted with a <x:ref>Content-Range</x:ref> header field, and a
574   <x:ref>Content-Length</x:ref> header field showing the number of bytes
575   actually transferred. For example,
576</t>
577<figure><artwork type="message/http; msgtype=&#34;response&#34;" x:indent-with="  ">
578HTTP/1.1 206 Partial Content
579Date: Wed, 15 Nov 1995 06:25:24 GMT
580Last-Modified: Wed, 15 Nov 1995 04:58:08 GMT
581Content-Range: bytes 21010-47021/47022
582Content-Length: 26012
583Content-Type: image/gif
584</artwork></figure>
585<t>
586   When an HTTP message includes the content of multiple ranges (for
587   example, a response to a request for multiple non-overlapping
588   ranges), these are transmitted as a multipart message. The multipart
589   media type used for this purpose is "multipart/byteranges" as defined
590   in <xref target="internet.media.type.multipart.byteranges"/>.
591</t>
592<t>
593   A server &MAY; combine requested ranges when those ranges are overlapping
594   (see <xref target="overlapping.ranges"/>).
595</t>
596<t>
597   A response to a request for a single range &MUST-NOT; be sent using the
598   multipart/byteranges media type.  A response to a request for
599   multiple ranges, whose result is a single range, &MAY; be sent as a
600   multipart/byteranges media type with one part. A client that cannot
601   decode a multipart/byteranges message &MUST-NOT; ask for multiple
602   ranges in a single request.
603</t>
604<t>
605   When a client asks for multiple ranges in one request, the
606   server &SHOULD; send them in the order that they appeared in the
607   request.
608</t>
609</section>
610
611<section title="Content-Range" anchor="header.content-range">
612  <iref primary="true" item="Content-Range header field" x:for-anchor=""/>
613  <x:anchor-alias value="Content-Range"/>
614  <x:anchor-alias value="byte-content-range"/>
615  <x:anchor-alias value="byte-range-resp"/>
616  <x:anchor-alias value="byte-range"/>
617  <x:anchor-alias value="unsatisfied-range"/>
618  <x:anchor-alias value="complete-length"/>
619  <x:anchor-alias value="other-content-range"/>
620  <x:anchor-alias value="other-range-resp"/>
621<t>
622   The "Content-Range" header field is sent with a partial representation to
623   specify where in the full representation the payload body is intended to be
624   applied.
625</t>
626<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Range"/><iref primary="true" item="Grammar" subitem="byte-content-range"/><iref primary="true" item="Grammar" subitem="byte-range-resp"/><iref primary="true" item="Grammar" subitem="byte-range"/><iref primary="true" item="Grammar" subitem="unsatisfied-range"/><iref primary="true" item="Grammar" subitem="other-content-range"/><iref primary="true" item="Grammar" subitem="other-range-resp"/><iref primary="true" item="Grammar" subitem="complete-length"/>
627  <x:ref>Content-Range</x:ref>       = <x:ref>byte-content-range</x:ref>
628                      / <x:ref>other-content-range</x:ref>
629                         
630  <x:ref>byte-content-range</x:ref>  = <x:ref>bytes-unit</x:ref> <x:ref>SP</x:ref>
631                        ( <x:ref>byte-range-resp</x:ref> / <x:ref>unsatisfied-range</x:ref> )
632
633  <x:ref>byte-range-resp</x:ref>     = <x:ref>byte-range</x:ref> "/" ( <x:ref>complete-length</x:ref> / "*" )
634  <x:ref>byte-range</x:ref>          = <x:ref>first-byte-pos</x:ref> "-" <x:ref>last-byte-pos</x:ref>
635  <x:ref>unsatisfied-range</x:ref>   = "*/" <x:ref>complete-length</x:ref>
636                         
637  <x:ref>complete-length</x:ref>     = 1*<x:ref>DIGIT</x:ref>
638 
639  <x:ref>other-content-range</x:ref> = <x:ref>other-range-unit</x:ref> <x:ref>SP</x:ref> <x:ref>other-range-resp</x:ref>
640  <x:ref>other-range-resp</x:ref>    = *<x:ref>CHAR</x:ref>
641</artwork></figure>
642<t>  
643   Range units are defined in <xref target="range.units"/>. A recipient of a
644   <x:ref>206 (Partial Content)</x:ref> response containing a
645   <x:ref>Content-Range</x:ref> header field with a <x:ref>range unit</x:ref>
646   that the recipient does not understand &MUST-NOT; attempt to recombine it
647   with a stored representation. A proxy that receives such a message
648   &SHOULD; forward it downstream.
649</t>
650<t>
651   For byte ranges, a sender &SHOULD; indicate the complete length of the
652   representation from which the range has been extracted unless the complete
653   length is unknown or difficult to determine. An asterisk character ("*") in
654   place of the complete-length indicates that the representation length was
655   unknown when the header field was generated.
656</t>
657<t>
658   A Content-Range field value with a <x:ref>byte-range-resp</x:ref> that has
659   a <x:ref>last-byte-pos</x:ref> value less than its
660   <x:ref>first-byte-pos</x:ref> value, or a <x:ref>complete-length</x:ref>
661   value less than or equal to its <x:ref>last-byte-pos</x:ref> value, is
662   invalid. The recipient of an invalid <x:ref>Content-Range</x:ref> &MUST-NOT;
663   attempt to recombine the received content with a stored representation.
664</t>
665<t>
666   A server generating a <x:ref>206 (Partial Content)</x:ref> response to a
667   byte range request &MUST; send, in each body-part of a multipart response
668   or in the header block of a single part response, a Content-Range header
669   field containing a <x:ref>byte-range-resp</x:ref> value that reflects the
670   corresponding range being sent. The following example would apply
671   when the complete length of the selected representation is known by the
672   sender to be 1234 bytes:
673</t>
674<figure><artwork type="example">
675  Content-Range: bytes 42-1233/1234
676</artwork></figure>
677<t>
678   or this second example would apply when the complete length is unknown:
679</t>
680<figure><artwork type="example">
681  Content-Range: bytes 42-1233/*
682</artwork></figure>
683<t>
684   A server generating a <x:ref>416 (Range Not Satisfiable)</x:ref> response
685   to a byte range request &SHOULD; send a Content-Range header field with an
686   <x:ref>unsatisfied-range</x:ref> value, as in the following example:
687</t>
688<figure><artwork type="example">
689  Content-Range: bytes */1234
690</artwork></figure>
691<t>
692   The complete-length in a 416 response indicates the current length of the
693   selected representation, which will be known by the server generating the
694   response because that is how it determined the range to be unsatisfiable.
695</t>
696<t>
697   The "Content-Range" header field has no meaning for status codes that do
698   not explicitly describe its semantic. For this specification, only the
699   <x:ref>206 (Partial Content)</x:ref> and
700   <x:ref>416 (Range Not Satisfiable)</x:ref> status codes describe a meaning
701   for Content-Range.
702</t>
703<t>
704   More examples of Content-Range values, assuming that the representation
705   contains a total of 1234 bytes:
706   <list style="symbols">
707      <t>
708        The first 500 bytes:
709<figure><artwork type="example" x:indent-with="   ">
710  Content-Range: bytes 0-499/1234
711</artwork></figure>
712      </t>   
713      <t>
714        The second 500 bytes:
715<figure><artwork type="example" x:indent-with="   ">
716  Content-Range: bytes 500-999/1234
717</artwork></figure>
718      </t>   
719      <t>
720        All except for the first 500 bytes:
721<figure><artwork type="example" x:indent-with="   ">
722  Content-Range: bytes 500-1233/1234
723</artwork></figure>
724      </t>   
725      <t>
726        The last 500 bytes:
727<figure><artwork type="example" x:indent-with="   ">
728  Content-Range: bytes 734-1233/1234
729</artwork></figure>
730      </t>   
731   </list>
732</t>
733</section>
734
735<section title="Combining Ranges" anchor="combining.byte.ranges">
736<t>
737   A response might transfer only a subrange of a representation if the
738   connection closed prematurely or if the request used one or more Range
739   specifications.  After several such transfers, a client might have
740   received several ranges of the same representation.  These ranges can only
741   be safely combined if they all have in common the same strong validator,
742   where "strong validator" is defined to be either an entity-tag that is
743   not marked as weak (&entity-tags;) or, if no entity-tag is provided, a
744   <x:ref>Last-Modified</x:ref> value that is strong in the sense defined by
745   &lastmod-comparison;.
746</t>
747<t>
748   When a client receives an incomplete <x:ref>200 (OK)</x:ref> response or a
749   <x:ref>206 (Partial Content)</x:ref> response, and already has one or more
750   partial responses for the same method and effective request URI that have
751   the same strong validator as present in the new response,
752   the recipient &MAY; combine some or all of those responses into a set of
753   continuous ranges. A client &MUST-NOT; combine responses that differ in the
754   strong validator or that do not have a strong validator.
755</t>
756<t>
757   If the new response is an incomplete <x:ref>200 (OK)</x:ref> response, then
758   the header fields of that new response are used for any combined response
759   and replace those of the matching stored responses.
760</t>
761<t>
762   If the new response is a <x:ref>206 (Partial Content)</x:ref> response and
763   at least one of the matching stored responses is a <x:ref>200 (OK)</x:ref>,
764   then the combined response header fields consist of the most recent 200
765   response's header fields. If all of the matching stored responses are 206
766   responses, then the stored response with the most recent header fields is
767   used as the source of header fields for the combined response, except that
768   the client &MUST; use other header fields provided in the new response,
769   aside from <x:ref>Content-Range</x:ref>, to replace all instances of the
770   corresponding header fields in the stored response.
771</t>
772<t>
773   The combined response message body consists of the union of partial
774   content ranges in the new response and each of the selected responses.
775   If the union consists of the entire range of the representation, then the
776   client &MUST; record the combined response as if it were a complete
777   <x:ref>200 (OK)</x:ref> response, including a <x:ref>Content-Length</x:ref>
778   header field that reflects the complete length.
779   Otherwise, the client &MUST; record the set of continuous ranges as one of
780   the following:
781   an incomplete <x:ref>200 (OK)</x:ref> response if the combined response is
782   a prefix of the representation,
783   a single <x:ref>206 (Partial Content)</x:ref> response containing a
784   multipart/byteranges body, or
785   multiple <x:ref>206 (Partial Content)</x:ref> responses, each with one
786   continuous range that is indicated by a <x:ref>Content-Range</x:ref> header
787   field.
788</t>
789</section>
790</section>
791
792<section title="IANA Considerations" anchor="IANA.considerations">
793
794<section title="Range Unit Registry" anchor="range.unit.registry">
795<t>
796   The HTTP Range Unit Registry defines the name space for the range
797   unit names and refers to their corresponding specifications.
798   The registry is maintained at
799   <eref target="http://www.iana.org/assignments/http-range-specifiers"/>.
800</t>
801
802<section title="Procedure" anchor="range.unit.registry.procedure">
803<t>
804   Registration of an HTTP Range Unit &MUST; include the following fields:
805   <list style="symbols">
806     <t>Name</t>
807     <t>Description</t>
808     <t>Pointer to specification text</t>
809   </list>
810</t>
811<t>
812  Values to be added to this name space require IETF Review
813  (see <xref target="RFC5226" x:fmt="," x:sec="4.1"/>).
814</t>
815</section>
816
817<section title="Registrations" anchor="range.unit.registration">
818<t>
819   The initial HTTP Range Unit Registry shall contain the registrations
820   below:
821</t>
822<texttable align="left" suppress-title="true" anchor="iana.range.units.table">
823   <ttcol>Range Specifier Name</ttcol>
824   <ttcol>Description</ttcol>
825   <ttcol>Reference</ttcol>
826
827   <c>bytes</c>
828   <c>a range of octets</c>
829   <c><xref target="range.units"/></c>
830
831   <c>none</c>
832   <c>reserved as keyword, indicating no ranges are supported</c>
833   <c><xref target="header.accept-ranges"/></c>
834</texttable>
835<t>
836   The change controller is: "IETF (iesg@ietf.org) - Internet Engineering Task Force".
837</t>
838</section>
839</section>
840
841<section title="Status Code Registration" anchor="status.code.registration">
842<t>
843   The HTTP Status Code Registry located at <eref target="http://www.iana.org/assignments/http-status-codes"/>
844   shall be updated with the registrations below:
845</t>
846<?BEGININC p5-range.iana-status-codes ?>
847<!--AUTOGENERATED FROM extract-status-code-defs.xslt, do not edit manually-->
848<texttable align="left" suppress-title="true" anchor="iana.status.code.registration.table">
849   <ttcol>Value</ttcol>
850   <ttcol>Description</ttcol>
851   <ttcol>Reference</ttcol>
852   <c>206</c>
853   <c>Partial Content</c>
854   <c>
855      <xref target="status.206"/>
856   </c>
857   <c>416</c>
858   <c>Range Not Satisfiable</c>
859   <c>
860      <xref target="status.416"/>
861   </c>
862</texttable>
863<!--(END)-->
864<?ENDINC p5-range.iana-status-codes ?>
865</section>
866
867<section title="Header Field Registration" anchor="header.field.registration">
868<t>
869   The Message Header Field Registry located at <eref target="http://www.iana.org/assignments/message-headers/message-header-index.html"/> shall be updated
870   with the permanent registrations below (see <xref target="BCP90"/>):
871</t>
872<?BEGININC p5-range.iana-headers ?>
873<!--AUTOGENERATED FROM extract-header-defs.xslt, do not edit manually-->
874<texttable align="left" suppress-title="true" anchor="iana.header.registration.table">
875   <ttcol>Header Field Name</ttcol>
876   <ttcol>Protocol</ttcol>
877   <ttcol>Status</ttcol>
878   <ttcol>Reference</ttcol>
879
880   <c>Accept-Ranges</c>
881   <c>http</c>
882   <c>standard</c>
883   <c>
884      <xref target="header.accept-ranges"/>
885   </c>
886   <c>Content-Range</c>
887   <c>http</c>
888   <c>standard</c>
889   <c>
890      <xref target="header.content-range"/>
891   </c>
892   <c>If-Range</c>
893   <c>http</c>
894   <c>standard</c>
895   <c>
896      <xref target="header.if-range"/>
897   </c>
898   <c>Range</c>
899   <c>http</c>
900   <c>standard</c>
901   <c>
902      <xref target="header.range"/>
903   </c>
904</texttable>
905<!--(END)-->
906<?ENDINC p5-range.iana-headers ?>
907<t>
908   The change controller is: "IETF (iesg@ietf.org) - Internet Engineering Task Force".
909</t>
910</section>
911
912</section>
913
914<section title="Security Considerations" anchor="security.considerations">
915<t>
916   This section is meant to inform developers, information providers, and
917   users of known security concerns specific to the HTTP/1.1 range
918   request mechanisms. More general security considerations are addressed
919   in HTTP messaging &messaging; and semantics &semantics;.
920</t>
921
922<section title="Overlapping Ranges" anchor="overlapping.ranges">
923<t>
924   Range requests containing overlapping ranges can lead to a situation
925   where the server is sending far more data than the size of the complete
926   resource representation.
927</t>
928</section>
929</section>
930
931<section title="Acknowledgments" anchor="acks">
932<t>
933  See &acks;.
934</t>
935</section>
936</middle>
937<back>
938
939<references title="Normative References">
940
941<reference anchor="Part1">
942  <front>
943    <title>Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing</title>
944    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
945      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
946      <address><email>fielding@gbiv.com</email></address>
947    </author>
948    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
949      <organization abbrev="greenbytes">greenbytes GmbH</organization>
950      <address><email>julian.reschke@greenbytes.de</email></address>
951    </author>
952    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
953  </front>
954  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p1-messaging-&ID-VERSION;"/>
955  <x:source href="p1-messaging.xml" basename="p1-messaging">
956    <x:defines>Content-Length</x:defines>
957  </x:source>
958</reference>
959
960<reference anchor="Part2">
961  <front>
962    <title>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</title>
963    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
964      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
965      <address><email>fielding@gbiv.com</email></address>
966    </author>
967    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
968      <organization abbrev="greenbytes">greenbytes GmbH</organization>
969      <address><email>julian.reschke@greenbytes.de</email></address>
970    </author>
971    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
972  </front>
973  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p2-semantics-&ID-VERSION;"/>
974  <x:source href="p2-semantics.xml" basename="p2-semantics">
975    <x:defines>200 (OK)</x:defines>
976    <x:defines>410 (Gone)</x:defines>
977    <x:defines>Content-Location</x:defines>
978    <x:defines>Content-Type</x:defines>
979    <x:defines>Location</x:defines>
980    <x:defines>Vary</x:defines>
981  </x:source>
982</reference>
983
984<reference anchor="Part4">
985  <front>
986    <title>Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests</title>
987    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
988      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
989      <address><email>fielding@gbiv.com</email></address>
990    </author>
991    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
992      <organization abbrev="greenbytes">greenbytes GmbH</organization>
993      <address><email>julian.reschke@greenbytes.de</email></address>
994    </author>
995    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
996  </front>
997  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p4-conditional-&ID-VERSION;"/>
998  <x:source href="p4-conditional.xml" basename="p4-conditional">
999    <x:defines>304 (Not Modified)</x:defines>
1000    <x:defines>ETag</x:defines>
1001    <x:defines>If-Match</x:defines>
1002    <x:defines>If-Modified-Since</x:defines>
1003    <x:defines>If-None-Match</x:defines>
1004    <x:defines>If-Unmodified-Since</x:defines>
1005    <x:defines>Last-Modified</x:defines>
1006  </x:source>
1007</reference>
1008
1009<reference anchor="Part6">
1010  <front>
1011    <title>Hypertext Transfer Protocol (HTTP/1.1): Caching</title>
1012    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
1013      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
1014      <address><email>fielding@gbiv.com</email></address>
1015    </author>
1016    <author initials="M." surname="Nottingham" fullname="Mark Nottingham" role="editor">
1017      <organization>Akamai</organization>
1018      <address><email>mnot@mnot.net</email></address>
1019    </author>
1020    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1021      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1022      <address><email>julian.reschke@greenbytes.de</email></address>
1023    </author>
1024    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
1025  </front>
1026  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p6-cache-&ID-VERSION;"/>
1027  <x:source href="p6-cache.xml" basename="p6-cache">
1028    <x:defines>Cache-Control</x:defines>
1029    <x:defines>Expires</x:defines>
1030  </x:source>
1031</reference>
1032
1033<reference anchor="RFC2046">
1034  <front>
1035    <title abbrev="Media Types">Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types</title>
1036    <author initials="N." surname="Freed" fullname="Ned Freed">
1037      <organization>Innosoft International, Inc.</organization>
1038      <address><email>ned@innosoft.com</email></address>
1039    </author>
1040    <author initials="N." surname="Borenstein" fullname="Nathaniel S. Borenstein">
1041      <organization>First Virtual Holdings</organization>
1042      <address><email>nsb@nsb.fv.com</email></address>
1043    </author>
1044    <date month="November" year="1996"/>
1045  </front>
1046  <seriesInfo name="RFC" value="2046"/>
1047</reference>
1048
1049<reference anchor="RFC2119">
1050  <front>
1051    <title>Key words for use in RFCs to Indicate Requirement Levels</title>
1052    <author initials="S." surname="Bradner" fullname="Scott Bradner">
1053      <organization>Harvard University</organization>
1054      <address><email>sob@harvard.edu</email></address>
1055    </author>
1056    <date month="March" year="1997"/>
1057  </front>
1058  <seriesInfo name="BCP" value="14"/>
1059  <seriesInfo name="RFC" value="2119"/>
1060</reference>
1061
1062<reference anchor="RFC5234">
1063  <front>
1064    <title abbrev="ABNF for Syntax Specifications">Augmented BNF for Syntax Specifications: ABNF</title>
1065    <author initials="D." surname="Crocker" fullname="Dave Crocker" role="editor">
1066      <organization>Brandenburg InternetWorking</organization>
1067      <address>
1068        <email>dcrocker@bbiw.net</email>
1069      </address> 
1070    </author>
1071    <author initials="P." surname="Overell" fullname="Paul Overell">
1072      <organization>THUS plc.</organization>
1073      <address>
1074        <email>paul.overell@thus.net</email>
1075      </address>
1076    </author>
1077    <date month="January" year="2008"/>
1078  </front>
1079  <seriesInfo name="STD" value="68"/>
1080  <seriesInfo name="RFC" value="5234"/>
1081</reference>
1082
1083</references>
1084
1085<references title="Informative References">
1086
1087<reference anchor="RFC2616">
1088  <front>
1089    <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
1090    <author initials="R." surname="Fielding" fullname="R. Fielding">
1091      <organization>University of California, Irvine</organization>
1092      <address><email>fielding@ics.uci.edu</email></address>
1093    </author>
1094    <author initials="J." surname="Gettys" fullname="J. Gettys">
1095      <organization>W3C</organization>
1096      <address><email>jg@w3.org</email></address>
1097    </author>
1098    <author initials="J." surname="Mogul" fullname="J. Mogul">
1099      <organization>Compaq Computer Corporation</organization>
1100      <address><email>mogul@wrl.dec.com</email></address>
1101    </author>
1102    <author initials="H." surname="Frystyk" fullname="H. Frystyk">
1103      <organization>MIT Laboratory for Computer Science</organization>
1104      <address><email>frystyk@w3.org</email></address>
1105    </author>
1106    <author initials="L." surname="Masinter" fullname="L. Masinter">
1107      <organization>Xerox Corporation</organization>
1108      <address><email>masinter@parc.xerox.com</email></address>
1109    </author>
1110    <author initials="P." surname="Leach" fullname="P. Leach">
1111      <organization>Microsoft Corporation</organization>
1112      <address><email>paulle@microsoft.com</email></address>
1113    </author>
1114    <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
1115      <organization>W3C</organization>
1116      <address><email>timbl@w3.org</email></address>
1117    </author>
1118    <date month="June" year="1999"/>
1119  </front>
1120  <seriesInfo name="RFC" value="2616"/>
1121</reference>
1122
1123<reference anchor='BCP90'>
1124  <front>
1125    <title>Registration Procedures for Message Header Fields</title>
1126    <author initials='G.' surname='Klyne' fullname='G. Klyne'>
1127      <organization>Nine by Nine</organization>
1128      <address><email>GK-IETF@ninebynine.org</email></address>
1129    </author>
1130    <author initials='M.' surname='Nottingham' fullname='M. Nottingham'>
1131      <organization>BEA Systems</organization>
1132      <address><email>mnot@pobox.com</email></address>
1133    </author>
1134    <author initials='J.' surname='Mogul' fullname='J. Mogul'>
1135      <organization>HP Labs</organization>
1136      <address><email>JeffMogul@acm.org</email></address>
1137    </author>
1138    <date year='2004' month='September' />
1139  </front>
1140  <seriesInfo name='BCP' value='90' />
1141  <seriesInfo name='RFC' value='3864' />
1142</reference>
1143
1144<reference anchor="BCP13">
1145  <front>
1146    <title>Media Type Specifications and Registration Procedures</title>
1147    <author initials="N." surname="Freed" fullname="N. Freed">
1148      <organization>Sun Microsystems</organization>
1149      <address>
1150        <email>ned.freed@mrochek.com</email>
1151      </address>
1152    </author>
1153    <author initials="J." surname="Klensin" fullname="J. Klensin">
1154      <address>
1155        <email>klensin+ietf@jck.com</email>
1156      </address>
1157    </author>
1158    <date year="2005" month="December"/>
1159  </front>
1160  <seriesInfo name="BCP" value="13"/>
1161  <seriesInfo name="RFC" value="4288"/>
1162</reference>
1163
1164<reference anchor='RFC5226'>
1165  <front>
1166    <title>Guidelines for Writing an IANA Considerations Section in RFCs</title>
1167    <author initials='T.' surname='Narten' fullname='T. Narten'>
1168      <organization>IBM</organization>
1169      <address><email>narten@us.ibm.com</email></address>
1170    </author>
1171    <author initials='H.' surname='Alvestrand' fullname='H. Alvestrand'>
1172      <organization>Google</organization>
1173      <address><email>Harald@Alvestrand.no</email></address>
1174    </author>
1175    <date year='2008' month='May' />
1176  </front>
1177  <seriesInfo name='BCP' value='26' />
1178  <seriesInfo name='RFC' value='5226' />
1179</reference>
1180
1181</references>
1182
1183<section title="Internet Media Type multipart/byteranges" anchor="internet.media.type.multipart.byteranges">
1184<iref item="Media Type" subitem="multipart/byteranges" primary="true"/>
1185<iref item="multipart/byteranges Media Type" primary="true"/>
1186<t>
1187   When an HTTP <x:ref>206 (Partial Content)</x:ref> response message includes the
1188   content of multiple ranges (a response to a request for multiple
1189   non-overlapping ranges), these are transmitted as a multipart
1190   message body (<xref target="RFC2046" x:fmt="," x:sec="5.1"/>). The media type for this purpose is called
1191   "multipart/byteranges".  The following is to be registered with IANA <xref target="BCP13"/>.
1192</t>
1193<t>
1194   The multipart/byteranges media type includes one or more parts, each
1195   with its own <x:ref>Content-Type</x:ref> and <x:ref>Content-Range</x:ref>
1196   fields. The required boundary parameter specifies the boundary string used
1197   to separate each body-part.
1198</t>
1199<t>
1200  <list style="hanging" x:indent="12em">
1201    <t hangText="Type name:">
1202      multipart
1203    </t>
1204    <t hangText="Subtype name:">
1205      byteranges
1206    </t>
1207    <t hangText="Required parameters:">
1208      boundary
1209    </t>
1210    <t hangText="Optional parameters:">
1211      none
1212    </t>
1213    <t hangText="Encoding considerations:">
1214      only "7bit", "8bit", or "binary" are permitted
1215    </t>
1216    <t hangText="Security considerations:">
1217      none
1218    </t>
1219    <t hangText="Interoperability considerations:">
1220      none
1221    </t>
1222    <t hangText="Published specification:">
1223      This specification (see <xref target="internet.media.type.multipart.byteranges"/>).
1224    </t>
1225    <t hangText="Applications that use this media type:">
1226      HTTP components supporting multiple ranges in a single request.
1227    </t>
1228    <t hangText="Additional information:">
1229      <list style="hanging">
1230        <t hangText="Magic number(s):">none</t>
1231        <t hangText="File extension(s):">none</t>
1232        <t hangText="Macintosh file type code(s):">none</t>
1233      </list>
1234    </t>
1235    <t hangText="Person and email address to contact for further information:">
1236      See Authors Section.
1237    </t>
1238    <t hangText="Intended usage:">
1239      COMMON
1240    </t>
1241    <t hangText="Restrictions on usage:">
1242      none
1243    </t>
1244    <t hangText="Author/Change controller:">
1245      IESG
1246    </t>
1247  </list>
1248</t>
1249<x:note>
1250  <t>
1251    &Note; Despite the name "multipart/byteranges" is not limited to the byte ranges only.
1252  </t>
1253</x:note>
1254<figure><preamble>
1255   For example:
1256</preamble><artwork type="example">
1257  HTTP/1.1 206 Partial Content
1258  Date: Wed, 15 Nov 1995 06:25:24 GMT
1259  Last-Modified: Wed, 15 Nov 1995 04:58:08 GMT
1260  Content-Length: 1741
1261  Content-Type: multipart/byteranges; boundary=THIS_STRING_SEPARATES
1262 
1263  --THIS_STRING_SEPARATES
1264  Content-Type: application/pdf
1265  Content-Range: bytes 500-999/8000
1266 
1267  ...the first range...
1268  --THIS_STRING_SEPARATES
1269  Content-Type: application/pdf
1270  Content-Range: bytes 7000-7999/8000
1271 
1272  ...the second range
1273  --THIS_STRING_SEPARATES--
1274</artwork></figure>
1275<figure><preamble>
1276   Another example, using the "exampleunit" range unit:
1277</preamble>
1278<artwork type="example">
1279  HTTP/1.1 206 Partial Content
1280  Date: Tue, 14 Nov 1995 06:25:24 GMT
1281  Last-Modified: Tue, 14 July 04:58:08 GMT
1282  Content-Length: 2331785
1283  Content-Type: multipart/byteranges; boundary=THIS_STRING_SEPARATES
1284 
1285  --THIS_STRING_SEPARATES
1286  Content-Type: video/example
1287  Content-Range: exampleunit 1.2-4.3/25
1288 
1289  ...the first range...
1290  --THIS_STRING_SEPARATES
1291  Content-Type: video/example
1292  Content-Range: exampleunit 11.2-14.3/25
1293 
1294  ...the second range
1295  --THIS_STRING_SEPARATES--
1296</artwork>
1297</figure>
1298<t>
1299  Notes:
1300  <list style="numbers">
1301      <t>Additional CRLFs &MAY; precede the first boundary string in the body.</t>
1302
1303      <t>Although <xref target="RFC2046"/> permits the boundary string to be
1304         quoted, some existing implementations handle a quoted boundary
1305         string incorrectly.</t>
1306
1307      <t>A number of clients and servers were coded to an early draft
1308         of the byteranges specification to use a media type of
1309         multipart/x-byteranges<iref item="multipart/x-byteranges Media Type"/><iref item="Media Type" subitem="multipart/x-byteranges"/>, which is almost, but not quite
1310         compatible with the version documented in HTTP/1.1.</t>
1311  </list>
1312</t>
1313</section>
1314
1315<section title="Changes from RFC 2616" anchor="changes.from.rfc.2616">
1316
1317<t>
1318  A weak validator cannot be used in a <x:ref>206</x:ref> response.
1319  (<xref target="status.206"/>)
1320</t>
1321<t>
1322  The Content-Range header field only has meaning when the status code
1323  explicitly defines its use.
1324  (<xref target="header.content-range" />)
1325</t>
1326<t>
1327  Servers are given more leeway in how they respond to a range request,
1328  in order to mitigate abuse by malicious (or just greedy) clients.
1329</t>
1330<t>
1331  multipart/byteranges can consist of a single part.
1332  (<xref target="internet.media.type.multipart.byteranges"/>)
1333</t>
1334<t>
1335  This specification introduces a Range Specifier Registry.
1336  (<xref target="range.unit.registry"/>)
1337</t>
1338</section>
1339
1340<section title="Imported ABNF" anchor="imported.abnf">
1341  <x:anchor-alias value="ALPHA"/>
1342  <x:anchor-alias value="CHAR"/>
1343  <x:anchor-alias value="CR"/>
1344  <x:anchor-alias value="DIGIT"/>
1345  <x:anchor-alias value="LF"/>
1346  <x:anchor-alias value="OCTET"/>
1347  <x:anchor-alias value="SP"/>
1348  <x:anchor-alias value="VCHAR"/>
1349  <x:anchor-alias value="token"/>
1350  <x:anchor-alias value="OWS"/>
1351  <x:anchor-alias value="HTTP-date"/>
1352  <x:anchor-alias value="entity-tag"/>
1353<t>
1354  The following core rules are included by
1355  reference, as defined in <xref target="RFC5234" x:fmt="of" x:sec="B.1"/>:
1356  ALPHA (letters), CR (carriage return), CRLF (CR LF), CTL (controls),
1357  DIGIT (decimal 0-9), DQUOTE (double quote),
1358  HEXDIG (hexadecimal 0-9/A-F/a-f), LF (line feed),
1359  OCTET (any 8-bit sequence of data), SP (space), and
1360  VCHAR (any visible US-ASCII character).
1361</t>
1362<t>
1363  Note that all rules derived from <x:ref>token</x:ref> are to
1364  be compared case-insensitively, like <x:ref>range-unit</x:ref> and
1365  <x:ref>acceptable-ranges</x:ref>.
1366</t>
1367<t>
1368  The rules below are defined in <xref target="Part1"/>:
1369</t>
1370<figure><artwork type="abnf2616">
1371  <x:ref>OWS</x:ref>        = &lt;OWS, defined in &whitespace;&gt;
1372  <x:ref>token</x:ref>      = &lt;token, defined in &field-components;&gt;
1373</artwork></figure>
1374<t>
1375  The rules below are defined in other parts:
1376</t>
1377<figure><artwork type="abnf2616">
1378  <x:ref>HTTP-date</x:ref>  = &lt;HTTP-date, defined in &http-date;&gt;
1379  <x:ref>entity-tag</x:ref> = &lt;entity-tag, defined in &entity-tags;&gt;
1380</artwork></figure>
1381</section>
1382
1383<?BEGININC p5-range.abnf-appendix ?>
1384<section xmlns:x="http://purl.org/net/xml2rfc/ext" title="Collected ABNF" anchor="collected.abnf">
1385<figure>
1386<artwork type="abnf" name="p5-range.parsed-abnf">
1387<x:ref>Accept-Ranges</x:ref> = acceptable-ranges
1388
1389<x:ref>Content-Range</x:ref> = byte-content-range / other-content-range
1390
1391<x:ref>HTTP-date</x:ref> = &lt;HTTP-date, defined in [Part2], Section 7.1.1.1&gt;
1392
1393<x:ref>If-Range</x:ref> = entity-tag / HTTP-date
1394
1395<x:ref>OWS</x:ref> = &lt;OWS, defined in [Part1], Section 3.2.3&gt;
1396
1397<x:ref>Range</x:ref> = byte-ranges-specifier / other-ranges-specifier
1398
1399<x:ref>acceptable-ranges</x:ref> = ( *( "," OWS ) range-unit *( OWS "," [ OWS
1400 range-unit ] ) ) / "none"
1401
1402<x:ref>byte-content-range</x:ref> = bytes-unit SP ( byte-range-resp /
1403 unsatisfied-range )
1404<x:ref>byte-range</x:ref> = first-byte-pos "-" last-byte-pos
1405<x:ref>byte-range-resp</x:ref> = byte-range "/" ( complete-length / "*" )
1406<x:ref>byte-range-set</x:ref> = *( "," OWS ) ( byte-range-spec /
1407 suffix-byte-range-spec ) *( OWS "," [ OWS ( byte-range-spec /
1408 suffix-byte-range-spec ) ] )
1409<x:ref>byte-range-spec</x:ref> = first-byte-pos "-" [ last-byte-pos ]
1410<x:ref>byte-ranges-specifier</x:ref> = bytes-unit "=" byte-range-set
1411<x:ref>bytes-unit</x:ref> = "bytes"
1412
1413<x:ref>complete-length</x:ref> = 1*DIGIT
1414
1415<x:ref>entity-tag</x:ref> = &lt;entity-tag, defined in [Part4], Section 2.3&gt;
1416
1417<x:ref>first-byte-pos</x:ref> = 1*DIGIT
1418
1419<x:ref>last-byte-pos</x:ref> = 1*DIGIT
1420
1421<x:ref>other-content-range</x:ref> = other-range-unit SP other-range-resp
1422<x:ref>other-range-resp</x:ref> = *CHAR
1423<x:ref>other-range-set</x:ref> = 1*CHAR
1424<x:ref>other-range-unit</x:ref> = token
1425<x:ref>other-ranges-specifier</x:ref> = other-range-unit "=" other-range-set
1426
1427<x:ref>range-unit</x:ref> = bytes-unit / other-range-unit
1428
1429<x:ref>suffix-byte-range-spec</x:ref> = "-" suffix-length
1430<x:ref>suffix-length</x:ref> = 1*DIGIT
1431
1432<x:ref>token</x:ref> = &lt;token, defined in [Part1], Section 3.2.6&gt;
1433
1434<x:ref>unsatisfied-range</x:ref> = "*/" complete-length
1435</artwork>
1436</figure>
1437</section>
1438<?ENDINC p5-range.abnf-appendix ?>
1439
1440
1441<section title="Change Log (to be removed by RFC Editor before publication)" anchor="change.log">
1442<t>
1443  Changes up to the first Working Group Last Call draft are summarized
1444  in <eref target="http://tools.ietf.org/html/draft-ietf-httpbis-p5-range-19#appendix-D"/>.
1445</t>
1446
1447<section title="Since draft-ietf-httpbis-p5-range-19" anchor="changes.since.19">
1448<t>
1449  Closed issues:
1450  <list style="symbols">
1451    <t>
1452      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/358"/>:
1453      "ABNF list expansion code problem"
1454    </t>
1455    <t>
1456      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/361"/>:
1457      "ABNF requirements for recipients"
1458    </t>
1459    <t>
1460      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/367"/>:
1461      "reserve 'none' as byte range unit"
1462    </t>
1463    <t>
1464      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/368"/>:
1465      "note introduction of new IANA registries as normative changes"
1466    </t>
1467    <t>
1468      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/369"/>:
1469      "range units vs leading zeroes vs size"
1470    </t>
1471  </list>
1472</t>
1473</section>
1474
1475<section title="Since draft-ietf-httpbis-p5-range-20" anchor="changes.since.20">
1476<t>
1477  <list style="symbols">
1478    <t>
1479      Conformance criteria and considerations regarding error handling are
1480      now defined in Part 1.
1481    </t>
1482  </list>
1483</t>
1484</section>
1485
1486<section title="Since draft-ietf-httpbis-p5-range-21" anchor="changes.since.21">
1487<t>
1488  None yet.
1489</t>
1490</section>
1491
1492</section>
1493
1494</back>
1495</rfc>
Note: See TracBrowser for help on using the repository browser.