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

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

(editorial) clean up p5 intro and range units

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