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 "August"> |
---|
16 | <!ENTITY ID-YEAR "2011"> |
---|
17 | <!ENTITY notation "<xref target='Part1' x:rel='#notation' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> |
---|
18 | <!ENTITY notation-abnf "<xref target='Part1' x:rel='#notation.abnf' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> |
---|
19 | <!ENTITY acks "<xref target='Part1' x:rel='#acks' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> |
---|
20 | <!ENTITY basic-rules "<xref target='Part1' x:rel='#basic.rules' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> |
---|
21 | <!ENTITY full-date "<xref target='Part1' x:rel='#date.time.formats.full.date' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> |
---|
22 | <!ENTITY messaging "<xref target='Part1' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> |
---|
23 | <!ENTITY entity-tags "<xref target='Part4' x:rel='#header.etag' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> |
---|
24 | <!ENTITY weak-and-strong-validators "<xref target='Part4' x:rel='#weak.and.strong.validators' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> |
---|
25 | <!ENTITY lastmod-comparison "<xref target='Part4' x:rel='#lastmod.comparison' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> |
---|
26 | ]> |
---|
27 | <?rfc toc="yes" ?> |
---|
28 | <?rfc symrefs="yes" ?> |
---|
29 | <?rfc sortrefs="yes" ?> |
---|
30 | <?rfc compact="yes"?> |
---|
31 | <?rfc subcompact="no" ?> |
---|
32 | <?rfc linkmailto="no" ?> |
---|
33 | <?rfc editing="no" ?> |
---|
34 | <?rfc comments="yes"?> |
---|
35 | <?rfc inline="yes"?> |
---|
36 | <?rfc rfcedstyle="yes"?> |
---|
37 | <?rfc-ext allow-markup-in-artwork="yes" ?> |
---|
38 | <?rfc-ext include-references-in-index="yes" ?> |
---|
39 | <rfc obsoletes="2616" category="std" x:maturity-level="draft" |
---|
40 | ipr="pre5378Trust200902" docName="draft-ietf-httpbis-p5-range-&ID-VERSION;" xmlns:x='http://purl.org/net/xml2rfc/ext'> |
---|
41 | <front> |
---|
42 | |
---|
43 | <title abbrev="HTTP/1.1, Part 5">HTTP/1.1, part 5: Range Requests and Partial Responses</title> |
---|
44 | |
---|
45 | <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor"> |
---|
46 | <organization abbrev="Adobe">Adobe Systems Incorporated</organization> |
---|
47 | <address> |
---|
48 | <postal> |
---|
49 | <street>345 Park Ave</street> |
---|
50 | <city>San Jose</city> |
---|
51 | <region>CA</region> |
---|
52 | <code>95110</code> |
---|
53 | <country>USA</country> |
---|
54 | </postal> |
---|
55 | <email>fielding@gbiv.com</email> |
---|
56 | <uri>http://roy.gbiv.com/</uri> |
---|
57 | </address> |
---|
58 | </author> |
---|
59 | |
---|
60 | <author initials="J." surname="Gettys" fullname="Jim Gettys"> |
---|
61 | <organization abbrev="Alcatel-Lucent">Alcatel-Lucent Bell Labs</organization> |
---|
62 | <address> |
---|
63 | <postal> |
---|
64 | <street>21 Oak Knoll Road</street> |
---|
65 | <city>Carlisle</city> |
---|
66 | <region>MA</region> |
---|
67 | <code>01741</code> |
---|
68 | <country>USA</country> |
---|
69 | </postal> |
---|
70 | <email>jg@freedesktop.org</email> |
---|
71 | <uri>http://gettys.wordpress.com/</uri> |
---|
72 | </address> |
---|
73 | </author> |
---|
74 | |
---|
75 | <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul"> |
---|
76 | <organization abbrev="HP">Hewlett-Packard Company</organization> |
---|
77 | <address> |
---|
78 | <postal> |
---|
79 | <street>HP Labs, Large Scale Systems Group</street> |
---|
80 | <street>1501 Page Mill Road, MS 1177</street> |
---|
81 | <city>Palo Alto</city> |
---|
82 | <region>CA</region> |
---|
83 | <code>94304</code> |
---|
84 | <country>USA</country> |
---|
85 | </postal> |
---|
86 | <email>JeffMogul@acm.org</email> |
---|
87 | </address> |
---|
88 | </author> |
---|
89 | |
---|
90 | <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen"> |
---|
91 | <organization abbrev="Microsoft">Microsoft Corporation</organization> |
---|
92 | <address> |
---|
93 | <postal> |
---|
94 | <street>1 Microsoft Way</street> |
---|
95 | <city>Redmond</city> |
---|
96 | <region>WA</region> |
---|
97 | <code>98052</code> |
---|
98 | <country>USA</country> |
---|
99 | </postal> |
---|
100 | <email>henrikn@microsoft.com</email> |
---|
101 | </address> |
---|
102 | </author> |
---|
103 | |
---|
104 | <author initials="L." surname="Masinter" fullname="Larry Masinter"> |
---|
105 | <organization abbrev="Adobe">Adobe Systems Incorporated</organization> |
---|
106 | <address> |
---|
107 | <postal> |
---|
108 | <street>345 Park Ave</street> |
---|
109 | <city>San Jose</city> |
---|
110 | <region>CA</region> |
---|
111 | <code>95110</code> |
---|
112 | <country>USA</country> |
---|
113 | </postal> |
---|
114 | <email>LMM@acm.org</email> |
---|
115 | <uri>http://larry.masinter.net/</uri> |
---|
116 | </address> |
---|
117 | </author> |
---|
118 | |
---|
119 | <author initials="P." surname="Leach" fullname="Paul J. Leach"> |
---|
120 | <organization abbrev="Microsoft">Microsoft Corporation</organization> |
---|
121 | <address> |
---|
122 | <postal> |
---|
123 | <street>1 Microsoft Way</street> |
---|
124 | <city>Redmond</city> |
---|
125 | <region>WA</region> |
---|
126 | <code>98052</code> |
---|
127 | </postal> |
---|
128 | <email>paulle@microsoft.com</email> |
---|
129 | </address> |
---|
130 | </author> |
---|
131 | |
---|
132 | <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee"> |
---|
133 | <organization abbrev="W3C/MIT">World Wide Web Consortium</organization> |
---|
134 | <address> |
---|
135 | <postal> |
---|
136 | <street>MIT Computer Science and Artificial Intelligence Laboratory</street> |
---|
137 | <street>The Stata Center, Building 32</street> |
---|
138 | <street>32 Vassar Street</street> |
---|
139 | <city>Cambridge</city> |
---|
140 | <region>MA</region> |
---|
141 | <code>02139</code> |
---|
142 | <country>USA</country> |
---|
143 | </postal> |
---|
144 | <email>timbl@w3.org</email> |
---|
145 | <uri>http://www.w3.org/People/Berners-Lee/</uri> |
---|
146 | </address> |
---|
147 | </author> |
---|
148 | |
---|
149 | <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor"> |
---|
150 | <organization abbrev="W3C">World Wide Web Consortium</organization> |
---|
151 | <address> |
---|
152 | <postal> |
---|
153 | <street>W3C / ERCIM</street> |
---|
154 | <street>2004, rte des Lucioles</street> |
---|
155 | <city>Sophia-Antipolis</city> |
---|
156 | <region>AM</region> |
---|
157 | <code>06902</code> |
---|
158 | <country>France</country> |
---|
159 | </postal> |
---|
160 | <email>ylafon@w3.org</email> |
---|
161 | <uri>http://www.raubacapeu.net/people/yves/</uri> |
---|
162 | </address> |
---|
163 | </author> |
---|
164 | |
---|
165 | <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor"> |
---|
166 | <organization abbrev="greenbytes">greenbytes GmbH</organization> |
---|
167 | <address> |
---|
168 | <postal> |
---|
169 | <street>Hafenweg 16</street> |
---|
170 | <city>Muenster</city><region>NW</region><code>48155</code> |
---|
171 | <country>Germany</country> |
---|
172 | </postal> |
---|
173 | <phone>+49 251 2807760</phone> |
---|
174 | <facsimile>+49 251 2807761</facsimile> |
---|
175 | <email>julian.reschke@greenbytes.de</email> |
---|
176 | <uri>http://greenbytes.de/tech/webdav/</uri> |
---|
177 | </address> |
---|
178 | </author> |
---|
179 | |
---|
180 | <date month="&ID-MONTH;" year="&ID-YEAR;"/> |
---|
181 | <workgroup>HTTPbis Working Group</workgroup> |
---|
182 | |
---|
183 | <abstract> |
---|
184 | <t> |
---|
185 | The Hypertext Transfer Protocol (HTTP) is an application-level protocol for |
---|
186 | distributed, collaborative, hypertext information systems. HTTP has been in |
---|
187 | use by the World Wide Web global information initiative since 1990. This |
---|
188 | document is Part 5 of the seven-part specification that defines the protocol |
---|
189 | referred to as "HTTP/1.1" and, taken together, obsoletes RFC 2616. |
---|
190 | </t> |
---|
191 | <t> |
---|
192 | Part 5 defines range-specific requests and the rules for constructing and |
---|
193 | combining responses to those requests. |
---|
194 | </t> |
---|
195 | </abstract> |
---|
196 | |
---|
197 | <note title="Editorial Note (To be removed by RFC Editor)"> |
---|
198 | <t> |
---|
199 | Discussion of this draft should take place on the HTTPBIS working group |
---|
200 | mailing list (ietf-http-wg@w3.org), which is archived at |
---|
201 | <eref target="http://lists.w3.org/Archives/Public/ietf-http-wg/"/>. |
---|
202 | </t> |
---|
203 | <t> |
---|
204 | The current issues list is at |
---|
205 | <eref target="http://tools.ietf.org/wg/httpbis/trac/report/3"/> and related |
---|
206 | documents (including fancy diffs) can be found at |
---|
207 | <eref target="http://tools.ietf.org/wg/httpbis/"/>. |
---|
208 | </t> |
---|
209 | <t> |
---|
210 | The changes in this draft are summarized in <xref target="changes.since.15"/>. |
---|
211 | </t> |
---|
212 | </note> |
---|
213 | </front> |
---|
214 | <middle> |
---|
215 | <section title="Introduction" anchor="introduction"> |
---|
216 | <t> |
---|
217 | HTTP clients often encounter interrupted data transfers as a result |
---|
218 | of cancelled requests or dropped connections. When a client has stored |
---|
219 | a partial representation, it is desirable to request the remainder |
---|
220 | of that representation in a subsequent request rather than transfer |
---|
221 | the entire representation. |
---|
222 | There are also a number of Web applications that benefit from being |
---|
223 | able to request only a subset of a larger representation, such as a |
---|
224 | single page of a very large document or only part of an image to be |
---|
225 | rendered by a device with limited local storage. |
---|
226 | </t> |
---|
227 | <t> |
---|
228 | This document defines HTTP/1.1 range requests, |
---|
229 | partial responses, and the multipart/byteranges media type. |
---|
230 | The protocol for range requests is an &OPTIONAL; feature of HTTP, |
---|
231 | designed so resources or recipients that do not implement this feature |
---|
232 | can respond as if it is a normal GET request without impacting |
---|
233 | interoperability. Partial responses are indicated by a distinct status |
---|
234 | code to not be mistaken for full responses by intermediate caches |
---|
235 | that might not implement the feature. |
---|
236 | </t> |
---|
237 | <t> |
---|
238 | Although the HTTP range request mechanism is designed to allow for |
---|
239 | extensible range types, this specification only defines requests for |
---|
240 | byte ranges. |
---|
241 | </t> |
---|
242 | |
---|
243 | <section title="Requirements" anchor="intro.requirements"> |
---|
244 | <t> |
---|
245 | The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", |
---|
246 | "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this |
---|
247 | document are to be interpreted as described in <xref target="RFC2119"/>. |
---|
248 | </t> |
---|
249 | <t> |
---|
250 | An implementation is not compliant if it fails to satisfy one or more |
---|
251 | of the "MUST" or "REQUIRED" level requirements for the protocols it |
---|
252 | implements. An implementation that satisfies all the "MUST" or "REQUIRED" |
---|
253 | level and all the "SHOULD" level requirements for its protocols is said |
---|
254 | to be "unconditionally compliant"; one that satisfies all the "MUST" |
---|
255 | level requirements but not all the "SHOULD" level requirements for its |
---|
256 | protocols is said to be "conditionally compliant". |
---|
257 | </t> |
---|
258 | </section> |
---|
259 | |
---|
260 | <section title="Syntax Notation" anchor="notation"> |
---|
261 | <x:anchor-alias value="ALPHA"/> |
---|
262 | <x:anchor-alias value="CHAR"/> |
---|
263 | <x:anchor-alias value="CR"/> |
---|
264 | <x:anchor-alias value="DIGIT"/> |
---|
265 | <x:anchor-alias value="LF"/> |
---|
266 | <x:anchor-alias value="OCTET"/> |
---|
267 | <x:anchor-alias value="SP"/> |
---|
268 | <x:anchor-alias value="VCHAR"/> |
---|
269 | <x:anchor-alias value="WSP"/> |
---|
270 | <t> |
---|
271 | This specification uses the ABNF syntax defined in ¬ation; (which |
---|
272 | extends the syntax defined in <xref target="RFC5234"/> with a list rule). |
---|
273 | <xref target="collected.abnf"/> shows the collected ABNF, with the list |
---|
274 | rule expanded. |
---|
275 | </t> |
---|
276 | <t> |
---|
277 | The following core rules are included by |
---|
278 | reference, as defined in <xref target="RFC5234" x:fmt="," x:sec="B.1"/>: |
---|
279 | ALPHA (letters), CR (carriage return), CRLF (CR LF), CTL (controls), |
---|
280 | DIGIT (decimal 0-9), DQUOTE (double quote), |
---|
281 | HEXDIG (hexadecimal 0-9/A-F/a-f), LF (line feed), |
---|
282 | OCTET (any 8-bit sequence of data), SP (space), |
---|
283 | VCHAR (any visible USASCII character), |
---|
284 | and WSP (whitespace). |
---|
285 | </t> |
---|
286 | |
---|
287 | <section title="Core Rules" anchor="core.rules"> |
---|
288 | <x:anchor-alias value="token"/> |
---|
289 | <x:anchor-alias value="OWS"/> |
---|
290 | <t> |
---|
291 | The core rules below are defined in &basic-rules;: |
---|
292 | </t> |
---|
293 | <figure><artwork type="abnf2616"> |
---|
294 | <x:ref>token</x:ref> = <token, defined in &basic-rules;> |
---|
295 | <x:ref>OWS</x:ref> = <OWS, defined in &basic-rules;> |
---|
296 | </artwork></figure> |
---|
297 | </section> |
---|
298 | |
---|
299 | <section title="ABNF Rules defined in other Parts of the Specification" anchor="abnf.dependencies"> |
---|
300 | <x:anchor-alias value="entity-tag"/> |
---|
301 | <x:anchor-alias value="HTTP-date"/> |
---|
302 | <t> |
---|
303 | The ABNF rules below are defined in other parts: |
---|
304 | </t> |
---|
305 | <figure><!--Part1--><artwork type="abnf2616"> |
---|
306 | <x:ref>HTTP-date</x:ref> = <HTTP-date, defined in &full-date;> |
---|
307 | </artwork></figure> |
---|
308 | <figure><!--Part4--><artwork type="abnf2616"> |
---|
309 | <x:ref>entity-tag</x:ref> = <entity-tag, defined in &entity-tags;> |
---|
310 | </artwork></figure> |
---|
311 | </section> |
---|
312 | |
---|
313 | </section> |
---|
314 | |
---|
315 | </section> |
---|
316 | |
---|
317 | |
---|
318 | <section title="Range Units" anchor="range.units"> |
---|
319 | <x:anchor-alias value="bytes-unit"/> |
---|
320 | <x:anchor-alias value="other-range-unit"/> |
---|
321 | <x:anchor-alias value="range-unit"/> |
---|
322 | <t> |
---|
323 | HTTP/1.1 allows a client to request that only part (a range) of the |
---|
324 | representation be included within the response. HTTP/1.1 uses range |
---|
325 | units in the Range (<xref target="header.range"/>) and Content-Range (<xref target="header.content-range"/>) |
---|
326 | header fields. A representation can be broken down into subranges according |
---|
327 | to various structural units. |
---|
328 | </t> |
---|
329 | <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"/> |
---|
330 | <x:ref>range-unit</x:ref> = <x:ref>bytes-unit</x:ref> / <x:ref>other-range-unit</x:ref> |
---|
331 | <x:ref>bytes-unit</x:ref> = "bytes" |
---|
332 | <x:ref>other-range-unit</x:ref> = <x:ref>token</x:ref> |
---|
333 | </artwork></figure> |
---|
334 | <t> |
---|
335 | HTTP/1.1 has been designed to allow implementations of applications |
---|
336 | that do not depend on knowledge of ranges. The only range unit defined |
---|
337 | by HTTP/1.1 is "bytes". Additional specifiers can be defined as described |
---|
338 | in <xref target="range.specifier.registry"/>. |
---|
339 | </t> |
---|
340 | <t> |
---|
341 | If a range unit is not understood in a request, a server &MUST; ignore |
---|
342 | the whole Range header field (<xref target="header.range"/>). |
---|
343 | If a range unit is not understood in a response, an intermediary |
---|
344 | &SHOULD; pass the response to the client; a client &MUST; fail. |
---|
345 | </t> |
---|
346 | |
---|
347 | <section title="Range Specifier Registry" anchor="range.specifier.registry"> |
---|
348 | <t> |
---|
349 | The HTTP Range Specifier Registry defines the name space for the range |
---|
350 | specifier names. |
---|
351 | </t> |
---|
352 | <t> |
---|
353 | Registrations &MUST; include the following fields: |
---|
354 | <list style="symbols"> |
---|
355 | <t>Name</t> |
---|
356 | <t>Description</t> |
---|
357 | <t>Pointer to specification text</t> |
---|
358 | </list> |
---|
359 | </t> |
---|
360 | <t> |
---|
361 | Values to be added to this name space are subject to IETF review |
---|
362 | (<xref target="RFC5226" x:fmt="," x:sec="4.1"/>). |
---|
363 | </t> |
---|
364 | <t> |
---|
365 | The registry itself is maintained at |
---|
366 | <eref target="http://www.iana.org/assignments/http-range-specifiers"/>. |
---|
367 | </t> |
---|
368 | </section> |
---|
369 | |
---|
370 | </section> |
---|
371 | |
---|
372 | <section title="Status Code Definitions" anchor="status.code.definitions"> |
---|
373 | <section title="206 Partial Content" anchor="status.206"> |
---|
374 | <iref primary="true" item="206 Partial Content (status code)" x:for-anchor=""/> |
---|
375 | <iref primary="true" item="Status Codes" subitem="206 Partial Content" x:for-anchor=""/> |
---|
376 | <t> |
---|
377 | The server has fulfilled the partial GET request for the resource. |
---|
378 | The request &MUST; have included a Range header field (<xref target="header.range"/>) |
---|
379 | indicating the desired range, and &MAY; have included an If-Range |
---|
380 | header field (<xref target="header.if-range"/>) to make the request conditional. |
---|
381 | </t> |
---|
382 | <t> |
---|
383 | The response &MUST; include the following header fields: |
---|
384 | <list style="symbols"> |
---|
385 | <t> |
---|
386 | Either a Content-Range header field (<xref target="header.content-range"/>) indicating |
---|
387 | the range included with this response, or a multipart/byteranges |
---|
388 | Content-Type including Content-Range fields for each part. If a |
---|
389 | Content-Length header field is present in the response, its |
---|
390 | value &MUST; match the actual number of octets transmitted in the |
---|
391 | message-body. |
---|
392 | </t> |
---|
393 | <t> |
---|
394 | Date |
---|
395 | </t> |
---|
396 | <t> |
---|
397 | Cache-Control, ETag, Expires, Content-Location, Last-Modified, |
---|
398 | and/or Vary, if the header field would have been sent in a 200 |
---|
399 | response to the same request |
---|
400 | </t> |
---|
401 | </list> |
---|
402 | </t> |
---|
403 | <t> |
---|
404 | If the 206 response is the result of an If-Range request, the response |
---|
405 | &SHOULD-NOT; include other representation header fields. Otherwise, the response |
---|
406 | &MUST; include all of the representation header fields that would have been returned |
---|
407 | with a 200 (OK) response to the same request. |
---|
408 | </t> |
---|
409 | </section> |
---|
410 | |
---|
411 | <section title="416 Requested Range Not Satisfiable" anchor="status.416"> |
---|
412 | <iref primary="true" item="416 Requested Range Not Satisfiable (status code)" x:for-anchor=""/> |
---|
413 | <iref primary="true" item="Status Codes" subitem="416 Requested Range Not Satisfiable" x:for-anchor=""/> |
---|
414 | <t> |
---|
415 | A server &SHOULD; return a response with this status code if a request |
---|
416 | included a Range header field (<xref target="header.range"/>), and none of |
---|
417 | the ranges-specifier values in this field overlap the current extent |
---|
418 | of the selected resource, and the request did not include an If-Range |
---|
419 | header field (<xref target="header.if-range"/>). (For byte-ranges, |
---|
420 | this means that the first-byte-pos of all of the byte-range-spec values were |
---|
421 | greater than the current length of the selected resource.) |
---|
422 | </t> |
---|
423 | <t> |
---|
424 | When this status code is returned for a byte-range request, the |
---|
425 | response &SHOULD; include a Content-Range header field |
---|
426 | specifying the current length of the representation (see <xref target="header.content-range"/>). |
---|
427 | This response &MUST-NOT; use the multipart/byteranges content-type. |
---|
428 | </t> |
---|
429 | </section> |
---|
430 | </section> |
---|
431 | |
---|
432 | <section title="Combining Ranges" anchor="combining.byte.ranges"> |
---|
433 | <t> |
---|
434 | A response might transfer only a subrange of a representation if the |
---|
435 | connection closed prematurely or if the request used one or more Range |
---|
436 | specifications. After several such transfers, a client might have |
---|
437 | received several ranges of the same representation. These ranges can only |
---|
438 | be safely combined if they all have in common the same strong validator, |
---|
439 | where "strong validator" is defined to be either an entity-tag that is |
---|
440 | not marked as weak (&entity-tags;) or, if no entity-tag is provided, a |
---|
441 | Last-Modified value that is strong in the sense defined by |
---|
442 | &lastmod-comparison;. |
---|
443 | </t> |
---|
444 | <t> |
---|
445 | When a client receives an incomplete 200 (OK) or 206 (Partial Content) |
---|
446 | response and already has one or more stored responses for the same method |
---|
447 | and effective request URI, all of the stored responses with the same |
---|
448 | strong validator &MAY; be combined with the partial content in this new |
---|
449 | response. If none of the stored responses contain the same strong |
---|
450 | validator, then this new response corresponds to a new representation |
---|
451 | and &MUST-NOT; be combined with the existing stored responses. |
---|
452 | </t> |
---|
453 | <t> |
---|
454 | If the new response is an incomplete 200 (OK) response, then the header |
---|
455 | fields of that new response are used for any combined response and replace |
---|
456 | those of the matching stored responses. |
---|
457 | </t> |
---|
458 | <t> |
---|
459 | If the new response is a 206 (Partial Content) response and at least one |
---|
460 | of the matching stored responses is a 200 (OK), then the combined response |
---|
461 | header fields consist of the most recent 200 response's header fields. |
---|
462 | If all of the matching stored responses are 206 responses, then the |
---|
463 | stored response with the most header fields is used as the source of |
---|
464 | header fields for the combined response, except that the client &MUST; |
---|
465 | use other header fields provided in the new response, aside from |
---|
466 | Content-Range, to replace all instances of the corresponding header |
---|
467 | fields in the stored response. |
---|
468 | </t> |
---|
469 | <t> |
---|
470 | The combined response message-body consists of the union of partial |
---|
471 | content ranges in the new response and each of the selected responses. |
---|
472 | If the union consists of the entire range of the representation, then the |
---|
473 | combined response &MUST; be recorded as a complete 200 (OK) response |
---|
474 | with a Content-Length header field that reflects the complete length. |
---|
475 | Otherwise, the combined response(s) &MUST; include a Content-Range |
---|
476 | header field describing the included range(s) and be recorded as |
---|
477 | incomplete. If the union consists of a discontinuous range of the |
---|
478 | representation, then the client &MAY; store it as either a multipart range |
---|
479 | response or as multiple 206 responses with one continuous range each. |
---|
480 | </t> |
---|
481 | </section> |
---|
482 | |
---|
483 | <section title="Header Field Definitions" anchor="header.fields"> |
---|
484 | <t> |
---|
485 | This section defines the syntax and semantics of HTTP/1.1 header fields |
---|
486 | related to range requests and partial responses. |
---|
487 | </t> |
---|
488 | |
---|
489 | <section title="Accept-Ranges" anchor="header.accept-ranges"> |
---|
490 | <iref primary="true" item="Accept-Ranges header field" x:for-anchor=""/> |
---|
491 | <iref primary="true" item="Header Fields" subitem="Accept-Ranges" x:for-anchor=""/> |
---|
492 | <x:anchor-alias value="Accept-Ranges"/> |
---|
493 | <x:anchor-alias value="acceptable-ranges"/> |
---|
494 | <t> |
---|
495 | The "Accept-Ranges" header field allows a resource to indicate |
---|
496 | its acceptance of range requests. |
---|
497 | </t> |
---|
498 | <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Accept-Ranges"/><iref primary="true" item="Grammar" subitem="acceptable-ranges"/> |
---|
499 | <x:ref>Accept-Ranges</x:ref> = <x:ref>acceptable-ranges</x:ref> |
---|
500 | <x:ref>acceptable-ranges</x:ref> = 1#<x:ref>range-unit</x:ref> / "none" |
---|
501 | </artwork></figure> |
---|
502 | <t> |
---|
503 | Origin servers that accept byte-range requests &MAY; send |
---|
504 | </t> |
---|
505 | <figure><artwork type="example"> |
---|
506 | Accept-Ranges: bytes |
---|
507 | </artwork></figure> |
---|
508 | <t> |
---|
509 | but are not required to do so. Clients &MAY; generate range |
---|
510 | requests without having received this header field for the resource |
---|
511 | involved. Range units are defined in <xref target="range.units"/>. |
---|
512 | </t> |
---|
513 | <t> |
---|
514 | Servers that do not accept any kind of range request for a |
---|
515 | resource &MAY; send |
---|
516 | </t> |
---|
517 | <figure><artwork type="example"> |
---|
518 | Accept-Ranges: none |
---|
519 | </artwork></figure> |
---|
520 | <t> |
---|
521 | to advise the client not to attempt a range request. |
---|
522 | </t> |
---|
523 | </section> |
---|
524 | |
---|
525 | <section title="Content-Range" anchor="header.content-range"> |
---|
526 | <iref primary="true" item="Content-Range header field" x:for-anchor=""/> |
---|
527 | <iref primary="true" item="Header Fields" subitem="Content-Range" x:for-anchor=""/> |
---|
528 | <x:anchor-alias value="byte-content-range-spec"/> |
---|
529 | <x:anchor-alias value="byte-range-resp-spec"/> |
---|
530 | <x:anchor-alias value="Content-Range"/> |
---|
531 | <x:anchor-alias value="content-range-spec"/> |
---|
532 | <x:anchor-alias value="instance-length"/> |
---|
533 | <x:anchor-alias value="other-content-range-spec"/> |
---|
534 | <x:anchor-alias value="other-range-resp-spec"/> |
---|
535 | <t> |
---|
536 | The "Content-Range" header field is sent with a partial representation to |
---|
537 | specify where in the full representation the payload body is intended to be |
---|
538 | applied. |
---|
539 | </t> |
---|
540 | <t> |
---|
541 | Range units are defined in <xref target="range.units"/>. |
---|
542 | </t> |
---|
543 | <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Range"/><iref primary="true" item="Grammar" subitem="content-range-spec"/><iref primary="true" item="Grammar" subitem="byte-content-range-spec"/><iref primary="true" item="Grammar" subitem="byte-range-resp-spec"/><iref primary="true" item="Grammar" subitem="instance-length"/> |
---|
544 | <x:ref>Content-Range</x:ref> = <x:ref>content-range-spec</x:ref> |
---|
545 | |
---|
546 | <x:ref>content-range-spec</x:ref> = <x:ref>byte-content-range-spec</x:ref> |
---|
547 | / <x:ref>other-content-range-spec</x:ref> |
---|
548 | <x:ref>byte-content-range-spec</x:ref> = <x:ref>bytes-unit</x:ref> <x:ref>SP</x:ref> |
---|
549 | <x:ref>byte-range-resp-spec</x:ref> "/" |
---|
550 | ( <x:ref>instance-length</x:ref> / "*" ) |
---|
551 | |
---|
552 | <x:ref>byte-range-resp-spec</x:ref> = (<x:ref>first-byte-pos</x:ref> "-" <x:ref>last-byte-pos</x:ref>) |
---|
553 | / "*" |
---|
554 | |
---|
555 | <x:ref>instance-length</x:ref> = 1*<x:ref>DIGIT</x:ref> |
---|
556 | |
---|
557 | <x:ref>other-content-range-spec</x:ref> = <x:ref>other-range-unit</x:ref> <x:ref>SP</x:ref> |
---|
558 | <x:ref>other-range-resp-spec</x:ref> |
---|
559 | <x:ref>other-range-resp-spec</x:ref> = *<x:ref>CHAR</x:ref> |
---|
560 | </artwork></figure> |
---|
561 | <t> |
---|
562 | The header field &SHOULD; indicate the total length of the full representation, |
---|
563 | unless this length is unknown or difficult to determine. The asterisk |
---|
564 | "*" character means that the instance-length is unknown at the time |
---|
565 | when the response was generated. |
---|
566 | </t> |
---|
567 | <t> |
---|
568 | Unlike byte-ranges-specifier values (see <xref target="byte.ranges"/>), a byte-range-resp-spec |
---|
569 | &MUST; only specify one range, and &MUST; contain |
---|
570 | absolute byte positions for both the first and last byte of the |
---|
571 | range. |
---|
572 | </t> |
---|
573 | <t> |
---|
574 | A byte-content-range-spec with a byte-range-resp-spec whose last-byte-pos |
---|
575 | value is less than its first-byte-pos value, or whose |
---|
576 | instance-length value is less than or equal to its last-byte-pos |
---|
577 | value, is invalid. The recipient of an invalid byte-content-range-spec |
---|
578 | &MUST; ignore it and any content transferred along with it. |
---|
579 | </t> |
---|
580 | <t> |
---|
581 | In the case of a byte range request: |
---|
582 | A server sending a response with status code 416 (Requested range not |
---|
583 | satisfiable) &SHOULD; include a Content-Range field with a byte-range-resp-spec |
---|
584 | of "*". The instance-length specifies the current length of |
---|
585 | the selected resource. A response with status code 206 (Partial |
---|
586 | Content) &MUST-NOT; include a Content-Range field with a byte-range-resp-spec of "*". |
---|
587 | </t> |
---|
588 | <t> |
---|
589 | Examples of byte-content-range-spec values, assuming that the representation |
---|
590 | contains a total of 1234 bytes: |
---|
591 | <list style="symbols"> |
---|
592 | <t> |
---|
593 | The first 500 bytes: |
---|
594 | <figure><artwork type="example" x:indent-with=" "> |
---|
595 | bytes 0-499/1234 |
---|
596 | </artwork></figure> |
---|
597 | </t> |
---|
598 | <t> |
---|
599 | The second 500 bytes: |
---|
600 | <figure><artwork type="example" x:indent-with=" "> |
---|
601 | bytes 500-999/1234 |
---|
602 | </artwork></figure> |
---|
603 | </t> |
---|
604 | <t> |
---|
605 | All except for the first 500 bytes: |
---|
606 | <figure><artwork type="example" x:indent-with=" "> |
---|
607 | bytes 500-1233/1234 |
---|
608 | </artwork></figure> |
---|
609 | </t> |
---|
610 | <t> |
---|
611 | The last 500 bytes: |
---|
612 | <figure><artwork type="example" x:indent-with=" "> |
---|
613 | bytes 734-1233/1234 |
---|
614 | </artwork></figure> |
---|
615 | </t> |
---|
616 | </list> |
---|
617 | </t> |
---|
618 | <t> |
---|
619 | When an HTTP message includes the content of a single range (for |
---|
620 | example, a response to a request for a single range, or to a request |
---|
621 | for a set of ranges that overlap without any holes), this content is |
---|
622 | transmitted with a Content-Range header field, and a Content-Length header |
---|
623 | field showing the number of bytes actually transferred. For example, |
---|
624 | </t> |
---|
625 | <figure><artwork type="example"> |
---|
626 | HTTP/1.1 206 Partial Content |
---|
627 | Date: Wed, 15 Nov 1995 06:25:24 GMT |
---|
628 | Last-Modified: Wed, 15 Nov 1995 04:58:08 GMT |
---|
629 | Content-Range: bytes 21010-47021/47022 |
---|
630 | Content-Length: 26012 |
---|
631 | Content-Type: image/gif |
---|
632 | </artwork></figure> |
---|
633 | <t> |
---|
634 | When an HTTP message includes the content of multiple ranges (for |
---|
635 | example, a response to a request for multiple non-overlapping |
---|
636 | ranges), these are transmitted as a multipart message. The multipart |
---|
637 | media type used for this purpose is "multipart/byteranges" as defined |
---|
638 | in <xref target="internet.media.type.multipart.byteranges"/>. |
---|
639 | </t> |
---|
640 | <t> |
---|
641 | A response to a request for a single range &MUST-NOT; be sent using the |
---|
642 | multipart/byteranges media type. A response to a request for |
---|
643 | multiple ranges, whose result is a single range, &MAY; be sent as a |
---|
644 | multipart/byteranges media type with one part. A client that cannot |
---|
645 | decode a multipart/byteranges message &MUST-NOT; ask for multiple |
---|
646 | ranges in a single request. |
---|
647 | </t> |
---|
648 | <t> |
---|
649 | When a client requests multiple ranges in one request, the |
---|
650 | server &SHOULD; return them in the order that they appeared in the |
---|
651 | request. |
---|
652 | </t> |
---|
653 | <t> |
---|
654 | If the server ignores a byte-range-spec because it is syntactically |
---|
655 | invalid, the server &SHOULD; treat the request as if the invalid Range |
---|
656 | header field did not exist. (Normally, this means return a 200 |
---|
657 | response containing the full representation). |
---|
658 | </t> |
---|
659 | <t> |
---|
660 | If the server receives a request (other than one including an If-Range |
---|
661 | header field) with an unsatisfiable Range header |
---|
662 | field (that is, all of whose byte-range-spec values have a |
---|
663 | first-byte-pos value greater than the current length of the selected |
---|
664 | resource), it &SHOULD; return a response code of 416 (Requested range |
---|
665 | not satisfiable) (<xref target="status.416"/>). |
---|
666 | </t> |
---|
667 | <x:note> |
---|
668 | <t> |
---|
669 | <x:h>Note:</x:h> Clients cannot depend on servers to send a 416 (Requested |
---|
670 | range not satisfiable) response instead of a 200 (OK) response for |
---|
671 | an unsatisfiable Range header field, since not all servers |
---|
672 | implement this header field. |
---|
673 | </t> |
---|
674 | </x:note> |
---|
675 | </section> |
---|
676 | |
---|
677 | <section title="If-Range" anchor="header.if-range"> |
---|
678 | <iref primary="true" item="If-Range header field" x:for-anchor=""/> |
---|
679 | <iref primary="true" item="Header Fields" subitem="If-Range" x:for-anchor=""/> |
---|
680 | <x:anchor-alias value="If-Range"/> |
---|
681 | <t> |
---|
682 | If a client has a partial copy of a representation and wishes |
---|
683 | to have an up-to-date copy of the entire representation, it |
---|
684 | could use the Range header field with a conditional GET (using |
---|
685 | either or both of If-Unmodified-Since and If-Match.) However, if the |
---|
686 | condition fails because the representation has been modified, the client |
---|
687 | would then have to make a second request to obtain the entire current |
---|
688 | representation. |
---|
689 | </t> |
---|
690 | <t> |
---|
691 | The "If-Range" header field allows a client to "short-circuit" the second |
---|
692 | request. Informally, its meaning is "if the representation is unchanged, send |
---|
693 | me the part(s) that I am missing; otherwise, send me the entire new |
---|
694 | representation". |
---|
695 | </t> |
---|
696 | <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-Range"/> |
---|
697 | <x:ref>If-Range</x:ref> = <x:ref>entity-tag</x:ref> / <x:ref>HTTP-date</x:ref> |
---|
698 | </artwork></figure> |
---|
699 | <t> |
---|
700 | Clients &MUST-NOT; use an entity-tag marked as weak in an If-Range |
---|
701 | field value and &MUST-NOT; use a Last-Modified date in an If-Range |
---|
702 | field value unless it has no entity-tag for the representation and |
---|
703 | the Last-Modified date it does have for the representation is strong |
---|
704 | in the sense defined by &lastmod-comparison;. |
---|
705 | </t> |
---|
706 | <t> |
---|
707 | A server that evaluates a conditional range request that is applicable |
---|
708 | to one of its representations &MUST; evaluate the condition as false if |
---|
709 | the entity-tag used as a validator is marked as weak or, when an HTTP-date |
---|
710 | is used as the validator, if the date value is not strong in the sense |
---|
711 | defined by &lastmod-comparison;. (A server can distinguish between a |
---|
712 | valid HTTP-date and any form of entity-tag by examining the first |
---|
713 | two characters.) |
---|
714 | </t> |
---|
715 | <t> |
---|
716 | The If-Range header field &SHOULD; only be sent by clients together with |
---|
717 | a Range header field. The If-Range header field &MUST; be ignored if it |
---|
718 | is received in a request that does not include a Range header field. |
---|
719 | The If-Range header field &MUST; be ignored by a server that does not |
---|
720 | support the sub-range operation. |
---|
721 | </t> |
---|
722 | <t> |
---|
723 | If the validator given in the If-Range header field matches the current |
---|
724 | validator for the selected representation of the target resource, then |
---|
725 | the server &SHOULD; send the specified sub-range of the representation |
---|
726 | using a 206 (Partial Content) response. If the validator does not match, |
---|
727 | then the server &SHOULD; send the entire representation using a 200 (OK) |
---|
728 | response. |
---|
729 | </t> |
---|
730 | </section> |
---|
731 | |
---|
732 | <section title="Range" anchor="header.range"> |
---|
733 | <iref primary="true" item="Range header field" x:for-anchor=""/> |
---|
734 | <iref primary="true" item="Header Fields" subitem="Range" x:for-anchor=""/> |
---|
735 | |
---|
736 | <section title="Byte Ranges" anchor="byte.ranges"> |
---|
737 | <t> |
---|
738 | Since all HTTP representations are transferred as sequences |
---|
739 | of bytes, the concept of a byte range is meaningful for any HTTP |
---|
740 | representation. (However, not all clients and servers need to support byte-range |
---|
741 | operations.) |
---|
742 | </t> |
---|
743 | <t> |
---|
744 | Byte range specifications in HTTP apply to the sequence of bytes in |
---|
745 | the representation body (not necessarily the same as the message-body). |
---|
746 | </t> |
---|
747 | <t anchor="rule.ranges-specifier"> |
---|
748 | <x:anchor-alias value="byte-range-set"/> |
---|
749 | <x:anchor-alias value="byte-range-spec"/> |
---|
750 | <x:anchor-alias value="byte-ranges-specifier"/> |
---|
751 | <x:anchor-alias value="first-byte-pos"/> |
---|
752 | <x:anchor-alias value="last-byte-pos"/> |
---|
753 | <x:anchor-alias value="ranges-specifier"/> |
---|
754 | <x:anchor-alias value="suffix-byte-range-spec"/> |
---|
755 | <x:anchor-alias value="suffix-length"/> |
---|
756 | |
---|
757 | A byte range operation &MAY; specify a single range of bytes, or a set |
---|
758 | of ranges within a single representation. |
---|
759 | </t> |
---|
760 | <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"/> |
---|
761 | <x:ref>byte-ranges-specifier</x:ref> = <x:ref>bytes-unit</x:ref> "=" <x:ref>byte-range-set</x:ref> |
---|
762 | <x:ref>byte-range-set</x:ref> = 1#( <x:ref>byte-range-spec</x:ref> / <x:ref>suffix-byte-range-spec</x:ref> ) |
---|
763 | <x:ref>byte-range-spec</x:ref> = <x:ref>first-byte-pos</x:ref> "-" [ <x:ref>last-byte-pos</x:ref> ] |
---|
764 | <x:ref>first-byte-pos</x:ref> = 1*<x:ref>DIGIT</x:ref> |
---|
765 | <x:ref>last-byte-pos</x:ref> = 1*<x:ref>DIGIT</x:ref> |
---|
766 | </artwork></figure> |
---|
767 | <t> |
---|
768 | The first-byte-pos value in a byte-range-spec gives the byte-offset |
---|
769 | of the first byte in a range. The last-byte-pos value gives the |
---|
770 | byte-offset of the last byte in the range; that is, the byte |
---|
771 | positions specified are inclusive. Byte offsets start at zero. |
---|
772 | </t> |
---|
773 | <t> |
---|
774 | If the last-byte-pos value is present, it &MUST; be greater than or |
---|
775 | equal to the first-byte-pos in that byte-range-spec, or the byte-range-spec |
---|
776 | is syntactically invalid. The recipient of a byte-range-set |
---|
777 | that includes one or more syntactically invalid byte-range-spec |
---|
778 | values &MUST; ignore the header field that includes that byte-range-set. |
---|
779 | </t> |
---|
780 | <t> |
---|
781 | If the last-byte-pos value is absent, or if the value is greater than |
---|
782 | or equal to the current length of the representation body, last-byte-pos is |
---|
783 | taken to be equal to one less than the current length of the representation |
---|
784 | in bytes. |
---|
785 | </t> |
---|
786 | <t> |
---|
787 | By its choice of last-byte-pos, a client can limit the number of |
---|
788 | bytes retrieved without knowing the size of the representation. |
---|
789 | </t> |
---|
790 | <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="suffix-byte-range-spec"/><iref primary="true" item="Grammar" subitem="suffix-length"/> |
---|
791 | <x:ref>suffix-byte-range-spec</x:ref> = "-" <x:ref>suffix-length</x:ref> |
---|
792 | <x:ref>suffix-length</x:ref> = 1*<x:ref>DIGIT</x:ref> |
---|
793 | </artwork></figure> |
---|
794 | <t> |
---|
795 | A suffix-byte-range-spec is used to specify the suffix of the |
---|
796 | representation body, of a length given by the suffix-length value. (That is, |
---|
797 | this form specifies the last N bytes of a representation.) If the |
---|
798 | representation is shorter than the specified suffix-length, the entire |
---|
799 | representation is used. |
---|
800 | </t> |
---|
801 | <t> |
---|
802 | If a syntactically valid byte-range-set includes at least one byte-range-spec |
---|
803 | whose first-byte-pos is less than the current length of |
---|
804 | the representation, or at least one suffix-byte-range-spec with a non-zero |
---|
805 | suffix-length, then the byte-range-set is satisfiable. |
---|
806 | Otherwise, the byte-range-set is unsatisfiable. If the byte-range-set |
---|
807 | is unsatisfiable, the server &SHOULD; return a response with a |
---|
808 | 416 (Requested range not satisfiable) status code. Otherwise, the server |
---|
809 | &SHOULD; return a response with a 206 (Partial Content) status code |
---|
810 | containing the satisfiable ranges of the representation. |
---|
811 | </t> |
---|
812 | <t> |
---|
813 | Examples of byte-ranges-specifier values (assuming a representation of |
---|
814 | length 10000): |
---|
815 | <list style="symbols"> |
---|
816 | <t>The first 500 bytes (byte offsets 0-499, inclusive): |
---|
817 | <figure><artwork type="example" x:indent-with=" "> |
---|
818 | bytes=0-499 |
---|
819 | </artwork></figure> |
---|
820 | </t> |
---|
821 | <t>The second 500 bytes (byte offsets 500-999, inclusive): |
---|
822 | <figure><artwork type="example" x:indent-with=" "> |
---|
823 | bytes=500-999 |
---|
824 | </artwork></figure> |
---|
825 | </t> |
---|
826 | <t>The final 500 bytes (byte offsets 9500-9999, inclusive): |
---|
827 | <figure><artwork type="example" x:indent-with=" "> |
---|
828 | bytes=-500 |
---|
829 | </artwork></figure> |
---|
830 | Or: |
---|
831 | <figure><artwork type="example" x:indent-with=" "> |
---|
832 | bytes=9500- |
---|
833 | </artwork></figure> |
---|
834 | </t> |
---|
835 | <t>The first and last bytes only (bytes 0 and 9999): |
---|
836 | <figure><artwork type="example" x:indent-with=" "> |
---|
837 | bytes=0-0,-1 |
---|
838 | </artwork></figure> |
---|
839 | </t> |
---|
840 | <t>Several legal but not canonical specifications of the second 500 |
---|
841 | bytes (byte offsets 500-999, inclusive): |
---|
842 | <figure><artwork type="example" x:indent-with=" "> |
---|
843 | bytes=500-600,601-999 |
---|
844 | bytes=500-700,601-999 |
---|
845 | </artwork></figure> |
---|
846 | </t> |
---|
847 | </list> |
---|
848 | </t> |
---|
849 | </section> |
---|
850 | |
---|
851 | <section title="Range Retrieval Requests" anchor="range.retrieval.requests"> |
---|
852 | <x:anchor-alias value="Range"/> |
---|
853 | <x:anchor-alias value="other-ranges-specifier"/> |
---|
854 | <x:anchor-alias value="other-range-set"/> |
---|
855 | <t> |
---|
856 | The "Range" header field defines the GET method (conditional or |
---|
857 | not) to request one or more sub-ranges of the response representation body, instead |
---|
858 | of the entire representation body. |
---|
859 | </t> |
---|
860 | <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Range"/> |
---|
861 | <x:ref>Range</x:ref> = <x:ref>byte-ranges-specifier</x:ref> / <x:ref>other-ranges-specifier</x:ref> |
---|
862 | <x:ref>other-ranges-specifier</x:ref> = <x:ref>other-range-unit</x:ref> "=" <x:ref>other-range-set</x:ref> |
---|
863 | <x:ref>other-range-set</x:ref> = 1*<x:ref>CHAR</x:ref> |
---|
864 | </artwork></figure> |
---|
865 | <t> |
---|
866 | A server &MAY; ignore the Range header field. However, origin |
---|
867 | servers and intermediate caches ought to support byte ranges when |
---|
868 | possible, since Range supports efficient recovery from partially |
---|
869 | failed transfers, and supports efficient partial retrieval of large |
---|
870 | representations. |
---|
871 | </t> |
---|
872 | <t> |
---|
873 | If the server supports the Range header field and the specified range or |
---|
874 | ranges are appropriate for the representation: |
---|
875 | <list style="symbols"> |
---|
876 | <t>The presence of a Range header field in an unconditional GET modifies |
---|
877 | what is returned if the GET is otherwise successful. In other |
---|
878 | words, the response carries a status code of 206 (Partial |
---|
879 | Content) instead of 200 (OK).</t> |
---|
880 | |
---|
881 | <t>The presence of a Range header field in a conditional GET (a request |
---|
882 | using one or both of If-Modified-Since and If-None-Match, or |
---|
883 | one or both of If-Unmodified-Since and If-Match) modifies what |
---|
884 | is returned if the GET is otherwise successful and the |
---|
885 | condition is true. It does not affect the 304 (Not Modified) |
---|
886 | response returned if the conditional is false.</t> |
---|
887 | </list> |
---|
888 | </t> |
---|
889 | <t> |
---|
890 | In some cases, it might be more appropriate to use the If-Range |
---|
891 | header field (see <xref target="header.if-range"/>) in addition to the Range |
---|
892 | header field. |
---|
893 | </t> |
---|
894 | <t> |
---|
895 | If a proxy that supports ranges receives a Range request, forwards |
---|
896 | the request to an inbound server, and receives an entire representation in |
---|
897 | reply, it &MAY; only return the requested range to its client. |
---|
898 | </t> |
---|
899 | </section> |
---|
900 | </section> |
---|
901 | </section> |
---|
902 | |
---|
903 | <section title="IANA Considerations" anchor="IANA.considerations"> |
---|
904 | |
---|
905 | <section title="Status Code Registration" anchor="status.code.registration"> |
---|
906 | <t> |
---|
907 | The HTTP Status Code Registry located at <eref target="http://www.iana.org/assignments/http-status-codes"/> |
---|
908 | shall be updated with the registrations below: |
---|
909 | </t> |
---|
910 | <?BEGININC p5-range.iana-status-codes ?> |
---|
911 | <!--AUTOGENERATED FROM extract-status-code-defs.xslt, do not edit manually--> |
---|
912 | <texttable align="left" suppress-title="true" anchor="iana.status.code.registration.table"> |
---|
913 | <ttcol>Value</ttcol> |
---|
914 | <ttcol>Description</ttcol> |
---|
915 | <ttcol>Reference</ttcol> |
---|
916 | <c>206</c> |
---|
917 | <c>Partial Content</c> |
---|
918 | <c> |
---|
919 | <xref target="status.206"/> |
---|
920 | </c> |
---|
921 | <c>416</c> |
---|
922 | <c>Requested Range Not Satisfiable</c> |
---|
923 | <c> |
---|
924 | <xref target="status.416"/> |
---|
925 | </c> |
---|
926 | </texttable> |
---|
927 | <!--(END)--> |
---|
928 | <?ENDINC p5-range.iana-status-codes ?> |
---|
929 | </section> |
---|
930 | |
---|
931 | <section title="Header Field Registration" anchor="header.field.registration"> |
---|
932 | <t> |
---|
933 | The Message Header Field Registry located at <eref target="http://www.iana.org/assignments/message-headers/message-header-index.html"/> shall be updated |
---|
934 | with the permanent registrations below (see <xref target="RFC3864"/>): |
---|
935 | </t> |
---|
936 | <?BEGININC p5-range.iana-headers ?> |
---|
937 | <!--AUTOGENERATED FROM extract-header-defs.xslt, do not edit manually--> |
---|
938 | <texttable align="left" suppress-title="true" anchor="iana.header.registration.table"> |
---|
939 | <ttcol>Header Field Name</ttcol> |
---|
940 | <ttcol>Protocol</ttcol> |
---|
941 | <ttcol>Status</ttcol> |
---|
942 | <ttcol>Reference</ttcol> |
---|
943 | |
---|
944 | <c>Accept-Ranges</c> |
---|
945 | <c>http</c> |
---|
946 | <c>standard</c> |
---|
947 | <c> |
---|
948 | <xref target="header.accept-ranges"/> |
---|
949 | </c> |
---|
950 | <c>Content-Range</c> |
---|
951 | <c>http</c> |
---|
952 | <c>standard</c> |
---|
953 | <c> |
---|
954 | <xref target="header.content-range"/> |
---|
955 | </c> |
---|
956 | <c>If-Range</c> |
---|
957 | <c>http</c> |
---|
958 | <c>standard</c> |
---|
959 | <c> |
---|
960 | <xref target="header.if-range"/> |
---|
961 | </c> |
---|
962 | <c>Range</c> |
---|
963 | <c>http</c> |
---|
964 | <c>standard</c> |
---|
965 | <c> |
---|
966 | <xref target="header.range"/> |
---|
967 | </c> |
---|
968 | </texttable> |
---|
969 | <!--(END)--> |
---|
970 | <?ENDINC p5-range.iana-headers ?> |
---|
971 | <t> |
---|
972 | The change controller is: "IETF (iesg@ietf.org) - Internet Engineering Task Force". |
---|
973 | </t> |
---|
974 | </section> |
---|
975 | |
---|
976 | <section title="Range Specifier Registration" anchor="range.specifier.registration"> |
---|
977 | <t> |
---|
978 | The registration procedure for HTTP Range Specifiers is defined by |
---|
979 | <xref target="range.specifier.registry"/> of this document. |
---|
980 | </t> |
---|
981 | <t> |
---|
982 | The HTTP Range Specifier Registry shall be created at <eref target="http://www.iana.org/assignments/http-range-specifiers"/> |
---|
983 | and be populated with the registrations below: |
---|
984 | </t> |
---|
985 | <texttable align="left" suppress-title="true" anchor="iana.range.specifiers.table"> |
---|
986 | <ttcol>Range Specifier Name</ttcol> |
---|
987 | <ttcol>Description</ttcol> |
---|
988 | <ttcol>Reference</ttcol> |
---|
989 | |
---|
990 | <c>bytes</c> |
---|
991 | <c>a range of octets</c> |
---|
992 | <c>(this specification)</c> |
---|
993 | </texttable> |
---|
994 | <t> |
---|
995 | The change controller is: "IETF (iesg@ietf.org) - Internet Engineering Task Force". |
---|
996 | </t> |
---|
997 | </section> |
---|
998 | </section> |
---|
999 | |
---|
1000 | <section title="Security Considerations" anchor="security.considerations"> |
---|
1001 | <t> |
---|
1002 | This section is meant to inform application developers, information |
---|
1003 | providers, and users of the security limitations in HTTP/1.1 as |
---|
1004 | described by this document. The discussion does not include |
---|
1005 | definitive solutions to the problems revealed, though it does make |
---|
1006 | some suggestions for reducing security risks. |
---|
1007 | </t> |
---|
1008 | <section title="Overlapping Ranges" anchor="overlapping.ranges"> |
---|
1009 | <t> |
---|
1010 | Range requests containing overlapping ranges may lead to the situation |
---|
1011 | where a server is sending far more data than the size of the complete |
---|
1012 | resource representation. |
---|
1013 | </t> |
---|
1014 | </section> |
---|
1015 | </section> |
---|
1016 | |
---|
1017 | <section title="Acknowledgments" anchor="acks"> |
---|
1018 | <t> |
---|
1019 | See &acks;. |
---|
1020 | </t> |
---|
1021 | </section> |
---|
1022 | </middle> |
---|
1023 | <back> |
---|
1024 | |
---|
1025 | <references title="Normative References"> |
---|
1026 | |
---|
1027 | <reference anchor="Part1"> |
---|
1028 | <front> |
---|
1029 | <title abbrev="HTTP/1.1">HTTP/1.1, part 1: URIs, Connections, and Message Parsing</title> |
---|
1030 | <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor"> |
---|
1031 | <organization abbrev="Adobe">Adobe Systems Incorporated</organization> |
---|
1032 | <address><email>fielding@gbiv.com</email></address> |
---|
1033 | </author> |
---|
1034 | <author initials="J." surname="Gettys" fullname="Jim Gettys"> |
---|
1035 | <organization abbrev="Alcatel-Lucent">Alcatel-Lucent Bell Labs</organization> |
---|
1036 | <address><email>jg@freedesktop.org</email></address> |
---|
1037 | </author> |
---|
1038 | <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul"> |
---|
1039 | <organization abbrev="HP">Hewlett-Packard Company</organization> |
---|
1040 | <address><email>JeffMogul@acm.org</email></address> |
---|
1041 | </author> |
---|
1042 | <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen"> |
---|
1043 | <organization abbrev="Microsoft">Microsoft Corporation</organization> |
---|
1044 | <address><email>henrikn@microsoft.com</email></address> |
---|
1045 | </author> |
---|
1046 | <author initials="L." surname="Masinter" fullname="Larry Masinter"> |
---|
1047 | <organization abbrev="Adobe">Adobe Systems Incorporated</organization> |
---|
1048 | <address><email>LMM@acm.org</email></address> |
---|
1049 | </author> |
---|
1050 | <author initials="P." surname="Leach" fullname="Paul J. Leach"> |
---|
1051 | <organization abbrev="Microsoft">Microsoft Corporation</organization> |
---|
1052 | <address><email>paulle@microsoft.com</email></address> |
---|
1053 | </author> |
---|
1054 | <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee"> |
---|
1055 | <organization abbrev="W3C/MIT">World Wide Web Consortium</organization> |
---|
1056 | <address><email>timbl@w3.org</email></address> |
---|
1057 | </author> |
---|
1058 | <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor"> |
---|
1059 | <organization abbrev="W3C">World Wide Web Consortium</organization> |
---|
1060 | <address><email>ylafon@w3.org</email></address> |
---|
1061 | </author> |
---|
1062 | <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor"> |
---|
1063 | <organization abbrev="greenbytes">greenbytes GmbH</organization> |
---|
1064 | <address><email>julian.reschke@greenbytes.de</email></address> |
---|
1065 | </author> |
---|
1066 | <date month="&ID-MONTH;" year="&ID-YEAR;"/> |
---|
1067 | </front> |
---|
1068 | <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p1-messaging-&ID-VERSION;"/> |
---|
1069 | <x:source href="p1-messaging.xml" basename="p1-messaging"/> |
---|
1070 | </reference> |
---|
1071 | |
---|
1072 | <reference anchor="Part4"> |
---|
1073 | <front> |
---|
1074 | <title abbrev="HTTP/1.1">HTTP/1.1, part 4: Conditional Requests</title> |
---|
1075 | <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor"> |
---|
1076 | <organization abbrev="Adobe">Adobe Systems Incorporated</organization> |
---|
1077 | <address><email>fielding@gbiv.com</email></address> |
---|
1078 | </author> |
---|
1079 | <author initials="J." surname="Gettys" fullname="Jim Gettys"> |
---|
1080 | <organization abbrev="Alcatel-Lucent">Alcatel-Lucent Bell Labs</organization> |
---|
1081 | <address><email>jg@freedesktop.org</email></address> |
---|
1082 | </author> |
---|
1083 | <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul"> |
---|
1084 | <organization abbrev="HP">Hewlett-Packard Company</organization> |
---|
1085 | <address><email>JeffMogul@acm.org</email></address> |
---|
1086 | </author> |
---|
1087 | <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen"> |
---|
1088 | <organization abbrev="Microsoft">Microsoft Corporation</organization> |
---|
1089 | <address><email>henrikn@microsoft.com</email></address> |
---|
1090 | </author> |
---|
1091 | <author initials="L." surname="Masinter" fullname="Larry Masinter"> |
---|
1092 | <organization abbrev="Adobe">Adobe Systems Incorporated</organization> |
---|
1093 | <address><email>LMM@acm.org</email></address> |
---|
1094 | </author> |
---|
1095 | <author initials="P." surname="Leach" fullname="Paul J. Leach"> |
---|
1096 | <organization abbrev="Microsoft">Microsoft Corporation</organization> |
---|
1097 | <address><email>paulle@microsoft.com</email></address> |
---|
1098 | </author> |
---|
1099 | <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee"> |
---|
1100 | <organization abbrev="W3C/MIT">World Wide Web Consortium</organization> |
---|
1101 | <address><email>timbl@w3.org</email></address> |
---|
1102 | </author> |
---|
1103 | <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor"> |
---|
1104 | <organization abbrev="W3C">World Wide Web Consortium</organization> |
---|
1105 | <address><email>ylafon@w3.org</email></address> |
---|
1106 | </author> |
---|
1107 | <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor"> |
---|
1108 | <organization abbrev="greenbytes">greenbytes GmbH</organization> |
---|
1109 | <address><email>julian.reschke@greenbytes.de</email></address> |
---|
1110 | </author> |
---|
1111 | <date month="&ID-MONTH;" year="&ID-YEAR;"/> |
---|
1112 | </front> |
---|
1113 | <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p4-conditional-&ID-VERSION;"/> |
---|
1114 | <x:source href="p4-conditional.xml" basename="p4-conditional"/> |
---|
1115 | </reference> |
---|
1116 | |
---|
1117 | <reference anchor="RFC2046"> |
---|
1118 | <front> |
---|
1119 | <title abbrev="Media Types">Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types</title> |
---|
1120 | <author initials="N." surname="Freed" fullname="Ned Freed"> |
---|
1121 | <organization>Innosoft International, Inc.</organization> |
---|
1122 | <address><email>ned@innosoft.com</email></address> |
---|
1123 | </author> |
---|
1124 | <author initials="N." surname="Borenstein" fullname="Nathaniel S. Borenstein"> |
---|
1125 | <organization>First Virtual Holdings</organization> |
---|
1126 | <address><email>nsb@nsb.fv.com</email></address> |
---|
1127 | </author> |
---|
1128 | <date month="November" year="1996"/> |
---|
1129 | </front> |
---|
1130 | <seriesInfo name="RFC" value="2046"/> |
---|
1131 | </reference> |
---|
1132 | |
---|
1133 | <reference anchor="RFC2119"> |
---|
1134 | <front> |
---|
1135 | <title>Key words for use in RFCs to Indicate Requirement Levels</title> |
---|
1136 | <author initials="S." surname="Bradner" fullname="Scott Bradner"> |
---|
1137 | <organization>Harvard University</organization> |
---|
1138 | <address><email>sob@harvard.edu</email></address> |
---|
1139 | </author> |
---|
1140 | <date month="March" year="1997"/> |
---|
1141 | </front> |
---|
1142 | <seriesInfo name="BCP" value="14"/> |
---|
1143 | <seriesInfo name="RFC" value="2119"/> |
---|
1144 | </reference> |
---|
1145 | |
---|
1146 | <reference anchor="RFC5234"> |
---|
1147 | <front> |
---|
1148 | <title abbrev="ABNF for Syntax Specifications">Augmented BNF for Syntax Specifications: ABNF</title> |
---|
1149 | <author initials="D." surname="Crocker" fullname="Dave Crocker" role="editor"> |
---|
1150 | <organization>Brandenburg InternetWorking</organization> |
---|
1151 | <address> |
---|
1152 | <email>dcrocker@bbiw.net</email> |
---|
1153 | </address> |
---|
1154 | </author> |
---|
1155 | <author initials="P." surname="Overell" fullname="Paul Overell"> |
---|
1156 | <organization>THUS plc.</organization> |
---|
1157 | <address> |
---|
1158 | <email>paul.overell@thus.net</email> |
---|
1159 | </address> |
---|
1160 | </author> |
---|
1161 | <date month="January" year="2008"/> |
---|
1162 | </front> |
---|
1163 | <seriesInfo name="STD" value="68"/> |
---|
1164 | <seriesInfo name="RFC" value="5234"/> |
---|
1165 | </reference> |
---|
1166 | |
---|
1167 | </references> |
---|
1168 | |
---|
1169 | <references title="Informative References"> |
---|
1170 | |
---|
1171 | <reference anchor="RFC2616"> |
---|
1172 | <front> |
---|
1173 | <title>Hypertext Transfer Protocol -- HTTP/1.1</title> |
---|
1174 | <author initials="R." surname="Fielding" fullname="R. Fielding"> |
---|
1175 | <organization>University of California, Irvine</organization> |
---|
1176 | <address><email>fielding@ics.uci.edu</email></address> |
---|
1177 | </author> |
---|
1178 | <author initials="J." surname="Gettys" fullname="J. Gettys"> |
---|
1179 | <organization>W3C</organization> |
---|
1180 | <address><email>jg@w3.org</email></address> |
---|
1181 | </author> |
---|
1182 | <author initials="J." surname="Mogul" fullname="J. Mogul"> |
---|
1183 | <organization>Compaq Computer Corporation</organization> |
---|
1184 | <address><email>mogul@wrl.dec.com</email></address> |
---|
1185 | </author> |
---|
1186 | <author initials="H." surname="Frystyk" fullname="H. Frystyk"> |
---|
1187 | <organization>MIT Laboratory for Computer Science</organization> |
---|
1188 | <address><email>frystyk@w3.org</email></address> |
---|
1189 | </author> |
---|
1190 | <author initials="L." surname="Masinter" fullname="L. Masinter"> |
---|
1191 | <organization>Xerox Corporation</organization> |
---|
1192 | <address><email>masinter@parc.xerox.com</email></address> |
---|
1193 | </author> |
---|
1194 | <author initials="P." surname="Leach" fullname="P. Leach"> |
---|
1195 | <organization>Microsoft Corporation</organization> |
---|
1196 | <address><email>paulle@microsoft.com</email></address> |
---|
1197 | </author> |
---|
1198 | <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee"> |
---|
1199 | <organization>W3C</organization> |
---|
1200 | <address><email>timbl@w3.org</email></address> |
---|
1201 | </author> |
---|
1202 | <date month="June" year="1999"/> |
---|
1203 | </front> |
---|
1204 | <seriesInfo name="RFC" value="2616"/> |
---|
1205 | </reference> |
---|
1206 | |
---|
1207 | <reference anchor='RFC3864'> |
---|
1208 | <front> |
---|
1209 | <title>Registration Procedures for Message Header Fields</title> |
---|
1210 | <author initials='G.' surname='Klyne' fullname='G. Klyne'> |
---|
1211 | <organization>Nine by Nine</organization> |
---|
1212 | <address><email>GK-IETF@ninebynine.org</email></address> |
---|
1213 | </author> |
---|
1214 | <author initials='M.' surname='Nottingham' fullname='M. Nottingham'> |
---|
1215 | <organization>BEA Systems</organization> |
---|
1216 | <address><email>mnot@pobox.com</email></address> |
---|
1217 | </author> |
---|
1218 | <author initials='J.' surname='Mogul' fullname='J. Mogul'> |
---|
1219 | <organization>HP Labs</organization> |
---|
1220 | <address><email>JeffMogul@acm.org</email></address> |
---|
1221 | </author> |
---|
1222 | <date year='2004' month='September' /> |
---|
1223 | </front> |
---|
1224 | <seriesInfo name='BCP' value='90' /> |
---|
1225 | <seriesInfo name='RFC' value='3864' /> |
---|
1226 | </reference> |
---|
1227 | |
---|
1228 | <reference anchor="RFC4288"> |
---|
1229 | <front> |
---|
1230 | <title>Media Type Specifications and Registration Procedures</title> |
---|
1231 | <author initials="N." surname="Freed" fullname="N. Freed"> |
---|
1232 | <organization>Sun Microsystems</organization> |
---|
1233 | <address> |
---|
1234 | <email>ned.freed@mrochek.com</email> |
---|
1235 | </address> |
---|
1236 | </author> |
---|
1237 | <author initials="J." surname="Klensin" fullname="J. Klensin"> |
---|
1238 | <address> |
---|
1239 | <email>klensin+ietf@jck.com</email> |
---|
1240 | </address> |
---|
1241 | </author> |
---|
1242 | <date year="2005" month="December"/> |
---|
1243 | </front> |
---|
1244 | <seriesInfo name="BCP" value="13"/> |
---|
1245 | <seriesInfo name="RFC" value="4288"/> |
---|
1246 | </reference> |
---|
1247 | |
---|
1248 | <reference anchor='RFC5226'> |
---|
1249 | <front> |
---|
1250 | <title>Guidelines for Writing an IANA Considerations Section in RFCs</title> |
---|
1251 | <author initials='T.' surname='Narten' fullname='T. Narten'> |
---|
1252 | <organization>IBM</organization> |
---|
1253 | <address><email>narten@us.ibm.com</email></address> |
---|
1254 | </author> |
---|
1255 | <author initials='H.' surname='Alvestrand' fullname='H. Alvestrand'> |
---|
1256 | <organization>Google</organization> |
---|
1257 | <address><email>Harald@Alvestrand.no</email></address> |
---|
1258 | </author> |
---|
1259 | <date year='2008' month='May' /> |
---|
1260 | </front> |
---|
1261 | <seriesInfo name='BCP' value='26' /> |
---|
1262 | <seriesInfo name='RFC' value='5226' /> |
---|
1263 | </reference> |
---|
1264 | |
---|
1265 | </references> |
---|
1266 | |
---|
1267 | <section title="Internet Media Type multipart/byteranges" anchor="internet.media.type.multipart.byteranges"> |
---|
1268 | <iref item="Media Type" subitem="multipart/byteranges" primary="true"/> |
---|
1269 | <iref item="multipart/byteranges Media Type" primary="true"/> |
---|
1270 | <t> |
---|
1271 | When an HTTP 206 (Partial Content) response message includes the |
---|
1272 | content of multiple ranges (a response to a request for multiple |
---|
1273 | non-overlapping ranges), these are transmitted as a multipart |
---|
1274 | message-body (<xref target="RFC2046" x:fmt="," x:sec="5.1"/>). The media type for this purpose is called |
---|
1275 | "multipart/byteranges". The following is to be registered with IANA <xref target="RFC4288"/>. |
---|
1276 | </t> |
---|
1277 | <x:note> |
---|
1278 | <t> |
---|
1279 | <x:h>Note:</x:h> Despite the name "multipart/byteranges" is not limited to the byte ranges only. |
---|
1280 | </t> |
---|
1281 | </x:note> |
---|
1282 | <t> |
---|
1283 | The multipart/byteranges media type includes one or more parts, each |
---|
1284 | with its own Content-Type and Content-Range fields. The required |
---|
1285 | boundary parameter specifies the boundary string used to separate |
---|
1286 | each body-part. |
---|
1287 | </t> |
---|
1288 | <t> |
---|
1289 | <list style="hanging" x:indent="12em"> |
---|
1290 | <t hangText="Type name:"> |
---|
1291 | multipart |
---|
1292 | </t> |
---|
1293 | <t hangText="Subtype name:"> |
---|
1294 | byteranges |
---|
1295 | </t> |
---|
1296 | <t hangText="Required parameters:"> |
---|
1297 | boundary |
---|
1298 | </t> |
---|
1299 | <t hangText="Optional parameters:"> |
---|
1300 | none |
---|
1301 | </t> |
---|
1302 | <t hangText="Encoding considerations:"> |
---|
1303 | only "7bit", "8bit", or "binary" are permitted |
---|
1304 | </t> |
---|
1305 | <t hangText="Security considerations:"> |
---|
1306 | none |
---|
1307 | </t> |
---|
1308 | <t hangText="Interoperability considerations:"> |
---|
1309 | none |
---|
1310 | </t> |
---|
1311 | <t hangText="Published specification:"> |
---|
1312 | This specification (see <xref target="internet.media.type.multipart.byteranges"/>). |
---|
1313 | </t> |
---|
1314 | <t hangText="Applications that use this media type:"> |
---|
1315 | </t> |
---|
1316 | <t hangText="Additional information:"> |
---|
1317 | <list style="hanging"> |
---|
1318 | <t hangText="Magic number(s):">none</t> |
---|
1319 | <t hangText="File extension(s):">none</t> |
---|
1320 | <t hangText="Macintosh file type code(s):">none</t> |
---|
1321 | </list> |
---|
1322 | </t> |
---|
1323 | <t hangText="Person and email address to contact for further information:"> |
---|
1324 | See Authors Section. |
---|
1325 | </t> |
---|
1326 | <t hangText="Intended usage:"> |
---|
1327 | COMMON |
---|
1328 | </t> |
---|
1329 | <t hangText="Restrictions on usage:"> |
---|
1330 | none |
---|
1331 | </t> |
---|
1332 | <t hangText="Author/Change controller:"> |
---|
1333 | IESG |
---|
1334 | </t> |
---|
1335 | </list> |
---|
1336 | </t> |
---|
1337 | <figure><preamble> |
---|
1338 | For example: |
---|
1339 | </preamble><artwork type="example"> |
---|
1340 | HTTP/1.1 206 Partial Content |
---|
1341 | Date: Wed, 15 Nov 1995 06:25:24 GMT |
---|
1342 | Last-Modified: Wed, 15 Nov 1995 04:58:08 GMT |
---|
1343 | Content-type: multipart/byteranges; boundary=THIS_STRING_SEPARATES |
---|
1344 | |
---|
1345 | --THIS_STRING_SEPARATES |
---|
1346 | Content-type: application/pdf |
---|
1347 | Content-range: bytes 500-999/8000 |
---|
1348 | |
---|
1349 | ...the first range... |
---|
1350 | --THIS_STRING_SEPARATES |
---|
1351 | Content-type: application/pdf |
---|
1352 | Content-range: bytes 7000-7999/8000 |
---|
1353 | |
---|
1354 | ...the second range |
---|
1355 | --THIS_STRING_SEPARATES-- |
---|
1356 | </artwork></figure> |
---|
1357 | <figure><preamble> |
---|
1358 | Other example: |
---|
1359 | </preamble> |
---|
1360 | <artwork type="example"> |
---|
1361 | HTTP/1.1 206 Partial Content |
---|
1362 | Date: Tue, 14 Nov 1995 06:25:24 GMT |
---|
1363 | Last-Modified: Tue, 14 July 04:58:08 GMT |
---|
1364 | Content-type: multipart/byteranges; boundary=THIS_STRING_SEPARATES |
---|
1365 | |
---|
1366 | --THIS_STRING_SEPARATES |
---|
1367 | Content-type: video/example |
---|
1368 | Content-range: exampleunit 1.2-4.3/25 |
---|
1369 | |
---|
1370 | ...the first range... |
---|
1371 | --THIS_STRING_SEPARATES |
---|
1372 | Content-type: video/example |
---|
1373 | Content-range: exampleunit 11.2-14.3/25 |
---|
1374 | |
---|
1375 | ...the second range |
---|
1376 | --THIS_STRING_SEPARATES-- |
---|
1377 | </artwork> |
---|
1378 | </figure> |
---|
1379 | <t> |
---|
1380 | Notes: |
---|
1381 | <list style="numbers"> |
---|
1382 | <t>Additional CRLFs &MAY; precede the first boundary string in the body.</t> |
---|
1383 | |
---|
1384 | <t>Although <xref target="RFC2046"/> permits the boundary string to be |
---|
1385 | quoted, some existing implementations handle a quoted boundary |
---|
1386 | string incorrectly.</t> |
---|
1387 | |
---|
1388 | <t>A number of browsers and servers were coded to an early draft |
---|
1389 | of the byteranges specification to use a media type of |
---|
1390 | multipart/x-byteranges<iref item="multipart/x-byteranges Media Type"/><iref item="Media Type" subitem="multipart/x-byteranges"/>, which is almost, but not quite |
---|
1391 | compatible with the version documented in HTTP/1.1.</t> |
---|
1392 | </list> |
---|
1393 | </t> |
---|
1394 | </section> |
---|
1395 | |
---|
1396 | <section title="Compatibility with Previous Versions" anchor="compatibility"> |
---|
1397 | <section title="Changes from RFC 2616" anchor="changes.from.rfc.2616"> |
---|
1398 | <t> |
---|
1399 | Clarify that it is not ok to use a weak validator in a 206 response. |
---|
1400 | (<xref target="status.206"/>) |
---|
1401 | </t> |
---|
1402 | <t> |
---|
1403 | Change ABNF productions for header fields to only define the field value. |
---|
1404 | (<xref target="header.fields"/>) |
---|
1405 | </t> |
---|
1406 | <t> |
---|
1407 | Clarify that multipart/byteranges can consist of a single part. |
---|
1408 | (<xref target="internet.media.type.multipart.byteranges"/>) |
---|
1409 | </t> |
---|
1410 | </section> |
---|
1411 | |
---|
1412 | </section> |
---|
1413 | |
---|
1414 | <?BEGININC p5-range.abnf-appendix ?> |
---|
1415 | <section xmlns:x="http://purl.org/net/xml2rfc/ext" title="Collected ABNF" anchor="collected.abnf"> |
---|
1416 | <figure> |
---|
1417 | <artwork type="abnf" name="p5-range.parsed-abnf"> |
---|
1418 | <x:ref>Accept-Ranges</x:ref> = acceptable-ranges |
---|
1419 | |
---|
1420 | <x:ref>Content-Range</x:ref> = content-range-spec |
---|
1421 | |
---|
1422 | <x:ref>HTTP-date</x:ref> = <HTTP-date, defined in [Part1], Section 6.1> |
---|
1423 | |
---|
1424 | <x:ref>If-Range</x:ref> = entity-tag / HTTP-date |
---|
1425 | |
---|
1426 | <x:ref>OWS</x:ref> = <OWS, defined in [Part1], Section 1.2.2> |
---|
1427 | |
---|
1428 | <x:ref>Range</x:ref> = byte-ranges-specifier / other-ranges-specifier |
---|
1429 | |
---|
1430 | <x:ref>acceptable-ranges</x:ref> = ( *( "," OWS ) range-unit *( OWS "," [ OWS |
---|
1431 | range-unit ] ) ) / "none" |
---|
1432 | |
---|
1433 | <x:ref>byte-content-range-spec</x:ref> = bytes-unit SP byte-range-resp-spec "/" ( |
---|
1434 | instance-length / "*" ) |
---|
1435 | <x:ref>byte-range-resp-spec</x:ref> = ( first-byte-pos "-" last-byte-pos ) / "*" |
---|
1436 | <x:ref>byte-range-set</x:ref> = ( *( "," OWS ) byte-range-spec ) / ( |
---|
1437 | suffix-byte-range-spec *( OWS "," [ ( OWS byte-range-spec ) / |
---|
1438 | suffix-byte-range-spec ] ) ) |
---|
1439 | <x:ref>byte-range-spec</x:ref> = first-byte-pos "-" [ last-byte-pos ] |
---|
1440 | <x:ref>byte-ranges-specifier</x:ref> = bytes-unit "=" byte-range-set |
---|
1441 | <x:ref>bytes-unit</x:ref> = "bytes" |
---|
1442 | |
---|
1443 | <x:ref>content-range-spec</x:ref> = byte-content-range-spec / |
---|
1444 | other-content-range-spec |
---|
1445 | |
---|
1446 | <x:ref>entity-tag</x:ref> = <entity-tag, defined in [Part4], Section 2.2> |
---|
1447 | |
---|
1448 | <x:ref>first-byte-pos</x:ref> = 1*DIGIT |
---|
1449 | |
---|
1450 | <x:ref>instance-length</x:ref> = 1*DIGIT |
---|
1451 | |
---|
1452 | <x:ref>last-byte-pos</x:ref> = 1*DIGIT |
---|
1453 | |
---|
1454 | <x:ref>other-content-range-spec</x:ref> = other-range-unit SP other-range-resp-spec |
---|
1455 | <x:ref>other-range-resp-spec</x:ref> = *CHAR |
---|
1456 | <x:ref>other-range-set</x:ref> = 1*CHAR |
---|
1457 | <x:ref>other-range-unit</x:ref> = token |
---|
1458 | <x:ref>other-ranges-specifier</x:ref> = other-range-unit "=" other-range-set |
---|
1459 | |
---|
1460 | <x:ref>range-unit</x:ref> = bytes-unit / other-range-unit |
---|
1461 | |
---|
1462 | <x:ref>suffix-byte-range-spec</x:ref> = "-" suffix-length |
---|
1463 | <x:ref>suffix-length</x:ref> = 1*DIGIT |
---|
1464 | |
---|
1465 | <x:ref>token</x:ref> = <token, defined in [Part1], Section 1.2.2> |
---|
1466 | </artwork> |
---|
1467 | </figure> |
---|
1468 | <figure><preamble>ABNF diagnostics:</preamble><artwork type="inline"> |
---|
1469 | ; Accept-Ranges defined but not used |
---|
1470 | ; Content-Range defined but not used |
---|
1471 | ; If-Range defined but not used |
---|
1472 | ; Range defined but not used |
---|
1473 | </artwork></figure></section> |
---|
1474 | <?ENDINC p5-range.abnf-appendix ?> |
---|
1475 | |
---|
1476 | |
---|
1477 | <section title="Change Log (to be removed by RFC Editor before publication)" anchor="change.log"> |
---|
1478 | |
---|
1479 | <section title="Since RFC 2616"> |
---|
1480 | <t> |
---|
1481 | Extracted relevant partitions from <xref target="RFC2616"/>. |
---|
1482 | </t> |
---|
1483 | </section> |
---|
1484 | |
---|
1485 | <section title="Since draft-ietf-httpbis-p5-range-00"> |
---|
1486 | <t> |
---|
1487 | Closed issues: |
---|
1488 | <list style="symbols"> |
---|
1489 | <t> |
---|
1490 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/18"/>: |
---|
1491 | "Cache validators in 206 responses" |
---|
1492 | (<eref target="http://purl.org/NET/http-errata#ifrange206"/>) |
---|
1493 | </t> |
---|
1494 | <t> |
---|
1495 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/35"/>: |
---|
1496 | "Normative and Informative references" |
---|
1497 | </t> |
---|
1498 | <t> |
---|
1499 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/86"/>: |
---|
1500 | "Normative up-to-date references" |
---|
1501 | </t> |
---|
1502 | </list> |
---|
1503 | </t> |
---|
1504 | </section> |
---|
1505 | |
---|
1506 | <section title="Since draft-ietf-httpbis-p5-range-01"> |
---|
1507 | <t> |
---|
1508 | Closed issues: |
---|
1509 | <list style="symbols"> |
---|
1510 | <t> |
---|
1511 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/55"/>: |
---|
1512 | "Updating to RFC4288" |
---|
1513 | </t> |
---|
1514 | </list> |
---|
1515 | </t> |
---|
1516 | <t> |
---|
1517 | Ongoing work on ABNF conversion (<eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/36"/>): |
---|
1518 | <list style="symbols"> |
---|
1519 | <t> |
---|
1520 | Add explicit references to BNF syntax and rules imported from other parts of the specification. |
---|
1521 | </t> |
---|
1522 | </list> |
---|
1523 | </t> |
---|
1524 | </section> |
---|
1525 | |
---|
1526 | <section title="Since draft-ietf-httpbis-p5-range-02" anchor="changes.since.02"> |
---|
1527 | <t> |
---|
1528 | Ongoing work on IANA Message Header Field Registration (<eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/40"/>): |
---|
1529 | <list style="symbols"> |
---|
1530 | <t> |
---|
1531 | Reference RFC 3984, and update header field registrations for headers defined |
---|
1532 | in this document. |
---|
1533 | </t> |
---|
1534 | </list> |
---|
1535 | </t> |
---|
1536 | </section> |
---|
1537 | |
---|
1538 | <section title="Since draft-ietf-httpbis-p5-range-03" anchor="changes.since.03"> |
---|
1539 | <t> |
---|
1540 | None. |
---|
1541 | </t> |
---|
1542 | </section> |
---|
1543 | |
---|
1544 | <section title="Since draft-ietf-httpbis-p5-range-04" anchor="changes.since.04"> |
---|
1545 | <t> |
---|
1546 | Closed issues: |
---|
1547 | <list style="symbols"> |
---|
1548 | <t> |
---|
1549 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/133"/>: |
---|
1550 | "multipart/byteranges minimum number of parts" |
---|
1551 | </t> |
---|
1552 | </list> |
---|
1553 | </t> |
---|
1554 | <t> |
---|
1555 | Ongoing work on ABNF conversion (<eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/36"/>): |
---|
1556 | <list style="symbols"> |
---|
1557 | <t> |
---|
1558 | Use "/" instead of "|" for alternatives. |
---|
1559 | </t> |
---|
1560 | <t> |
---|
1561 | Introduce new ABNF rules for "bad" whitespace ("BWS"), optional |
---|
1562 | whitespace ("OWS") and required whitespace ("RWS"). |
---|
1563 | </t> |
---|
1564 | <t> |
---|
1565 | Rewrite ABNFs to spell out whitespace rules, factor out |
---|
1566 | header field value format definitions. |
---|
1567 | </t> |
---|
1568 | </list> |
---|
1569 | </t> |
---|
1570 | </section> |
---|
1571 | |
---|
1572 | <section title="Since draft-ietf-httpbis-p5-range-05" anchor="changes.since.05"> |
---|
1573 | <t> |
---|
1574 | Closed issues: |
---|
1575 | <list style="symbols"> |
---|
1576 | <t> |
---|
1577 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/142"/>: |
---|
1578 | "State base for *-byte-pos and suffix-length" |
---|
1579 | </t> |
---|
1580 | </list> |
---|
1581 | </t> |
---|
1582 | <t> |
---|
1583 | Ongoing work on Custom Ranges (<eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/85"/>): |
---|
1584 | <list style="symbols"> |
---|
1585 | <t> |
---|
1586 | Remove bias in favor of byte ranges; allow custom ranges in ABNF. |
---|
1587 | </t> |
---|
1588 | </list> |
---|
1589 | </t> |
---|
1590 | <t> |
---|
1591 | Final work on ABNF conversion (<eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/36"/>): |
---|
1592 | <list style="symbols"> |
---|
1593 | <t> |
---|
1594 | Add appendix containing collected and expanded ABNF, reorganize ABNF introduction. |
---|
1595 | </t> |
---|
1596 | </list> |
---|
1597 | </t> |
---|
1598 | </section> |
---|
1599 | |
---|
1600 | <section title="Since draft-ietf-httpbis-p5-range-06" anchor="changes.since.06"> |
---|
1601 | <t> |
---|
1602 | Closed issues: |
---|
1603 | <list style="symbols"> |
---|
1604 | <t> |
---|
1605 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/161"/>: |
---|
1606 | "base for numeric protocol elements" |
---|
1607 | </t> |
---|
1608 | </list> |
---|
1609 | </t> |
---|
1610 | </section> |
---|
1611 | |
---|
1612 | <section title="Since draft-ietf-httpbis-p5-range-07" anchor="changes.since.07"> |
---|
1613 | <t> |
---|
1614 | Closed issues: |
---|
1615 | <list style="symbols"> |
---|
1616 | <t> |
---|
1617 | Fixed discrepancy in the If-Range definition about allowed validators. |
---|
1618 | </t> |
---|
1619 | <t> |
---|
1620 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/150" />: "multipart/byteranges for custom range units" |
---|
1621 | </t> |
---|
1622 | <t> |
---|
1623 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/151" />: "range unit missing from other-ranges-specifier in Range header" |
---|
1624 | </t> |
---|
1625 | <t> |
---|
1626 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/198"/>: |
---|
1627 | "move IANA registrations for optional status codes" |
---|
1628 | </t> |
---|
1629 | </list> |
---|
1630 | </t> |
---|
1631 | </section> |
---|
1632 | |
---|
1633 | <section title="Since draft-ietf-httpbis-p5-range-08" anchor="changes.since.08"> |
---|
1634 | <t> |
---|
1635 | No significant changes. |
---|
1636 | </t> |
---|
1637 | </section> |
---|
1638 | |
---|
1639 | <section title="Since draft-ietf-httpbis-p5-range-09" anchor="changes.since.09"> |
---|
1640 | <t> |
---|
1641 | No significant changes. |
---|
1642 | </t> |
---|
1643 | </section> |
---|
1644 | |
---|
1645 | <section title="Since draft-ietf-httpbis-p5-range-10" anchor="changes.since.10"> |
---|
1646 | <t> |
---|
1647 | Closed issues: |
---|
1648 | <list style="symbols"> |
---|
1649 | <t> |
---|
1650 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/69"/>: |
---|
1651 | "Clarify 'Requested Variant'" |
---|
1652 | </t> |
---|
1653 | <t> |
---|
1654 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/109"/>: |
---|
1655 | "Clarify entity / representation / variant terminology" |
---|
1656 | </t> |
---|
1657 | <t> |
---|
1658 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/220"/>: |
---|
1659 | "consider removing the 'changes from 2068' sections" |
---|
1660 | </t> |
---|
1661 | </list> |
---|
1662 | </t> |
---|
1663 | <t> |
---|
1664 | Ongoing work on Custom Ranges (<eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/85"/>): |
---|
1665 | <list style="symbols"> |
---|
1666 | <t> |
---|
1667 | Add IANA registry. |
---|
1668 | </t> |
---|
1669 | </list> |
---|
1670 | </t> |
---|
1671 | </section> |
---|
1672 | |
---|
1673 | <section title="Since draft-ietf-httpbis-p5-range-11" anchor="changes.since.11"> |
---|
1674 | <t> |
---|
1675 | Closed issues: |
---|
1676 | <list style="symbols"> |
---|
1677 | <t> |
---|
1678 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/217"/>: |
---|
1679 | "Caches can't be required to serve ranges" |
---|
1680 | </t> |
---|
1681 | </list> |
---|
1682 | </t> |
---|
1683 | </section> |
---|
1684 | |
---|
1685 | <section title="Since draft-ietf-httpbis-p5-range-12" anchor="changes.since.12"> |
---|
1686 | <t> |
---|
1687 | Closed issues: |
---|
1688 | <list style="symbols"> |
---|
1689 | <t> |
---|
1690 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/224"/>: |
---|
1691 | "Header Classification" |
---|
1692 | </t> |
---|
1693 | </list> |
---|
1694 | </t> |
---|
1695 | </section> |
---|
1696 | |
---|
1697 | <section title="Since draft-ietf-httpbis-p5-range-13" anchor="changes.since.13"> |
---|
1698 | <t> |
---|
1699 | Closed issues: |
---|
1700 | <list style="symbols"> |
---|
1701 | <t> |
---|
1702 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/276"/>: |
---|
1703 | "untangle ABNFs for header fields" |
---|
1704 | </t> |
---|
1705 | </list> |
---|
1706 | </t> |
---|
1707 | </section> |
---|
1708 | |
---|
1709 | <section title="Since draft-ietf-httpbis-p5-range-14" anchor="changes.since.14"> |
---|
1710 | <t> |
---|
1711 | None. |
---|
1712 | </t> |
---|
1713 | </section> |
---|
1714 | |
---|
1715 | <section title="Since draft-ietf-httpbis-p5-range-15" anchor="changes.since.15"> |
---|
1716 | <t> |
---|
1717 | Closed issues: |
---|
1718 | <list style="symbols"> |
---|
1719 | <t> |
---|
1720 | <eref target="http://trac.tools.ietf.org/wg/httpbis/trac/ticket/175"/>: |
---|
1721 | "Security consideration: range flooding" |
---|
1722 | </t> |
---|
1723 | </list> |
---|
1724 | </t> |
---|
1725 | </section> |
---|
1726 | |
---|
1727 | </section> |
---|
1728 | |
---|
1729 | </back> |
---|
1730 | </rfc> |
---|