source: draft-ietf-httpbis/00/p5-range.html

Last change on this file was 2726, checked in by julian.reschke@…, 6 years ago

update to latest version of rfc2629.xslt, regen all HTML

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/html;charset=utf-8
File size: 63.0 KB
Line 
1<!DOCTYPE html
2  PUBLIC "-//W3C//DTD HTML 4.01//EN">
3<html lang="en">
4   <head profile="http://dublincore.org/documents/2008/08/04/dc-html/">
5      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
6      <title>HTTP/1.1, part 5: Range Requests and Partial Responses</title><style type="text/css" title="Xml2Rfc (sans serif)">
7a {
8  text-decoration: none;
9}
10a.smpl {
11  color: black;
12}
13a:hover {
14  text-decoration: underline;
15}
16a:active {
17  text-decoration: underline;
18}
19address {
20  margin-top: 1em;
21  margin-left: 2em;
22  font-style: normal;
23}
24body {
25  color: black;
26  font-family: cambria, helvetica, arial, sans-serif;
27  font-size: 11pt;
28  margin-right: 2em;
29}
30cite {
31  font-style: normal;
32}
33dl {
34  margin-left: 2em;
35}
36ul.empty {
37  list-style-type: none;
38}
39ul.empty li {
40  margin-top: .5em;
41}
42dl p {
43  margin-left: 0em;
44}
45dt {
46  margin-top: .5em;
47}
48h1 {
49  font-size: 130%;
50  line-height: 21pt;
51  page-break-after: avoid;
52}
53h1.np {
54  page-break-before: always;
55}
56h2 {
57  font-size: 120%;
58  line-height: 15pt;
59  page-break-after: avoid;
60}
61h3 {
62  font-size: 110%;
63  page-break-after: avoid;
64}
65h4, h5, h6 {
66  page-break-after: avoid;
67}
68h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
69  color: black;
70}
71img {
72  margin-left: 3em;
73}
74li {
75  margin-left: 2em;
76}
77ol {
78  margin-left: 2em;
79}
80ol.la {
81  list-style-type: lower-alpha;
82}
83ol.ua {
84  list-style-type: upper-alpha;
85}
86ol p {
87  margin-left: 0em;
88}
89p {
90  margin-left: 2em;
91}
92pre {
93  margin-left: 3em;
94  background-color: lightyellow;
95  padding: .25em;
96  page-break-inside: avoid;
97}
98pre.text2 {
99  border-style: dotted;
100  border-width: 1px;
101  background-color: #f0f0f0;
102  width: 69em;
103}
104pre.inline {
105  background-color: white;
106  padding: 0em;
107}
108pre.text {
109  border-style: dotted;
110  border-width: 1px;
111  background-color: #f8f8f8;
112  width: 69em;
113}
114pre.drawing {
115  border-style: solid;
116  border-width: 1px;
117  background-color: #f8f8f8;
118  padding: 2em;
119}
120table {
121  margin-left: 2em;
122}
123table.header {
124  border-spacing: 1px;
125  width: 95%;
126  font-size: 11pt;
127  color: white;
128}
129td.top {
130  vertical-align: top;
131}
132td.topnowrap {
133  vertical-align: top;
134  white-space: nowrap;
135}
136table.header td {
137  background-color: gray;
138  width: 50%;
139}
140table.header a {
141  color: white;
142}
143td.reference {
144  vertical-align: top;
145  white-space: nowrap;
146  padding-right: 1em;
147}
148thead {
149  display:table-header-group;
150}
151ul.toc, ul.toc ul {
152  list-style: none;
153  margin-left: 1.5em;
154  padding-left: 0em;
155}
156ul.toc li {
157  line-height: 150%;
158  font-weight: bold;
159  margin-left: 0em;
160}
161ul.toc li li {
162  line-height: normal;
163  font-weight: normal;
164  font-size: 10pt;
165  margin-left: 0em;
166}
167li.excluded {
168  font-size: 0pt;
169}
170ul p {
171  margin-left: 0em;
172}
173.title, .filename, h1, h2, h3, h4 {
174  font-family: candara, helvetica, arial, sans-serif;
175}
176samp, tt, code, pre {
177  font: consolas, monospace;
178}
179ul.ind, ul.ind ul {
180  list-style: none;
181  margin-left: 1.5em;
182  padding-left: 0em;
183  page-break-before: avoid;
184}
185ul.ind li {
186  font-weight: bold;
187  line-height: 200%;
188  margin-left: 0em;
189}
190ul.ind li li {
191  font-weight: normal;
192  line-height: 150%;
193  margin-left: 0em;
194}
195.avoidbreak {
196  page-break-inside: avoid;
197}
198.bcp14 {
199  font-style: normal;
200  text-transform: lowercase;
201  font-variant: small-caps;
202}
203.comment {
204  background-color: yellow;
205}
206.center {
207  text-align: center;
208}
209.error {
210  color: red;
211  font-style: italic;
212  font-weight: bold;
213}
214.figure {
215  font-weight: bold;
216  text-align: center;
217  font-size: 10pt;
218}
219.filename {
220  color: #333333;
221  font-size: 75%;
222  font-weight: bold;
223  line-height: 21pt;
224  text-align: center;
225}
226.fn {
227  font-weight: bold;
228}
229.left {
230  text-align: left;
231}
232.right {
233  text-align: right;
234}
235.title {
236  color: green;
237  font-size: 150%;
238  line-height: 18pt;
239  font-weight: bold;
240  text-align: center;
241  margin-top: 36pt;
242}
243.warning {
244  font-size: 130%;
245  background-color: yellow;
246}
247
248
249@media print {
250  .noprint {
251    display: none;
252  }
253
254  a {
255    color: black;
256    text-decoration: none;
257  }
258
259  table.header {
260    width: 90%;
261  }
262
263  td.header {
264    width: 50%;
265    color: black;
266    background-color: white;
267    vertical-align: top;
268    font-size: 110%;
269  }
270
271  ul.toc a:nth-child(2)::after {
272    content: leader('.') target-counter(attr(href), page);
273  }
274
275  ul.ind li li a {
276    content: target-counter(attr(href), page);
277  }
278
279  .print2col {
280    column-count: 2;
281    -moz-column-count: 2;
282    column-fill: auto;
283  }
284}
285
286@page {
287  @top-left {
288       content: "Internet-Draft";
289  }
290  @top-right {
291       content: "December 2007";
292  }
293  @top-center {
294       content: "HTTP/1.1";
295  }
296  @bottom-left {
297       content: "Fielding, et al.";
298  }
299  @bottom-center {
300       content: "Expires June 22, 2008";
301  }
302  @bottom-right {
303       content: "[Page " counter(page) "]";
304  }
305}
306
307@page:first {
308    @top-left {
309      content: normal;
310    }
311    @top-right {
312      content: normal;
313    }
314    @top-center {
315      content: normal;
316    }
317}
318</style><link rel="Contents" href="#rfc.toc">
319      <link rel="Author" href="#rfc.authors">
320      <link rel="Copyright" href="#rfc.copyright">
321      <link rel="Index" href="#rfc.index">
322      <link rel="Chapter" title="1 Introduction" href="#rfc.section.1">
323      <link rel="Chapter" title="2 Range Units" href="#rfc.section.2">
324      <link rel="Chapter" title="3 Status Code Definitions" href="#rfc.section.3">
325      <link rel="Chapter" title="4 Combining Byte Ranges" href="#rfc.section.4">
326      <link rel="Chapter" title="5 Header Field Definitions" href="#rfc.section.5">
327      <link rel="Chapter" title="6 IANA Considerations" href="#rfc.section.6">
328      <link rel="Chapter" title="7 Security Considerations" href="#rfc.section.7">
329      <link rel="Chapter" title="8 Acknowledgments" href="#rfc.section.8">
330      <link rel="Chapter" href="#rfc.section.9" title="9 References">
331      <link rel="Appendix" title="A Internet Media Type multipart/byteranges" href="#rfc.section.A">
332      <link rel="Appendix" title="B Changes from RFC 2068" href="#rfc.section.B">
333      <meta name="generator" content="http://greenbytes.de/tech/webdav/rfc2629.xslt, Revision 1.640, 2014/06/13 12:42:58, XSLT vendor: SAXON 8.9 from Saxonica http://www.saxonica.com/">
334      <link rel="schema.dct" href="http://purl.org/dc/terms/">
335      <meta name="dct.creator" content="Fielding, R.">
336      <meta name="dct.creator" content="Gettys, J.">
337      <meta name="dct.creator" content="Mogul, J.">
338      <meta name="dct.creator" content="Frystyk, H.">
339      <meta name="dct.creator" content="Masinter, L.">
340      <meta name="dct.creator" content="Leach, P.">
341      <meta name="dct.creator" content="Berners-Lee, T.">
342      <meta name="dct.identifier" content="urn:ietf:id:draft-ietf-httpbis-p5-range-00">
343      <meta name="dct.issued" scheme="ISO8601" content="2007-12-20">
344      <meta name="dct.replaces" content="urn:ietf:rfc:2068">
345      <meta name="dct.replaces" content="urn:ietf:rfc:2616">
346      <meta name="dct.abstract" content="The Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed, collaborative, hypermedia information systems. HTTP has been in use by the World Wide Web global information initiative since 1990. This document is Part 5 of the seven-part specification that defines the protocol referred to as &#34;HTTP/1.1&#34; and, taken together, obsoletes RFC 2616. Part 5 defines range-specific requests and the rules for constructing and combining responses to those requests.">
347      <meta name="description" content="The Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed, collaborative, hypermedia information systems. HTTP has been in use by the World Wide Web global information initiative since 1990. This document is Part 5 of the seven-part specification that defines the protocol referred to as &#34;HTTP/1.1&#34; and, taken together, obsoletes RFC 2616. Part 5 defines range-specific requests and the rules for constructing and combining responses to those requests.">
348   </head>
349   <body>
350      <table class="header">
351         <tbody>
352            <tr>
353               <td class="left">Network Working Group</td>
354               <td class="right">R. Fielding, Editor</td>
355            </tr>
356            <tr>
357               <td class="left">Internet-Draft</td>
358               <td class="right">Day Software</td>
359            </tr>
360            <tr>
361               <td class="left">Obsoletes: <a href="https://tools.ietf.org/html/rfc2068">2068</a>, <a href="https://tools.ietf.org/html/rfc2616">2616</a> (if approved)
362               </td>
363               <td class="right">J. Gettys</td>
364            </tr>
365            <tr>
366               <td class="left">Intended status: Standards Track</td>
367               <td class="right">One Laptop per Child</td>
368            </tr>
369            <tr>
370               <td class="left">Expires: June 22, 2008</td>
371               <td class="right">J. Mogul</td>
372            </tr>
373            <tr>
374               <td class="left"></td>
375               <td class="right">HP</td>
376            </tr>
377            <tr>
378               <td class="left"></td>
379               <td class="right">H. Frystyk</td>
380            </tr>
381            <tr>
382               <td class="left"></td>
383               <td class="right">Microsoft</td>
384            </tr>
385            <tr>
386               <td class="left"></td>
387               <td class="right">L. Masinter</td>
388            </tr>
389            <tr>
390               <td class="left"></td>
391               <td class="right">Adobe Systems</td>
392            </tr>
393            <tr>
394               <td class="left"></td>
395               <td class="right">P. Leach</td>
396            </tr>
397            <tr>
398               <td class="left"></td>
399               <td class="right">Microsoft</td>
400            </tr>
401            <tr>
402               <td class="left"></td>
403               <td class="right">T. Berners-Lee</td>
404            </tr>
405            <tr>
406               <td class="left"></td>
407               <td class="right">W3C/MIT</td>
408            </tr>
409            <tr>
410               <td class="left"></td>
411               <td class="right">December 20, 2007</td>
412            </tr>
413         </tbody>
414      </table>
415      <p class="title">HTTP/1.1, part 5: Range Requests and Partial Responses<br><span class="filename">draft-ietf-httpbis-p5-range-00</span></p>
416      <div id="rfc.status">
417         <h1><a href="#rfc.status">Status of this Memo</a></h1>
418         <p>By submitting this Internet-Draft, each author represents that any applicable patent or other IPR claims of which he or she
419            is aware have been or will be disclosed, and any of which he or she becomes aware will be disclosed, in accordance with Section
420            6 of BCP 79.
421         </p>
422         <p>Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note
423            that other groups may also distribute working documents as Internet-Drafts.
424         </p>
425         <p>Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other
426            documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as “work
427            in progress”.
428         </p>
429         <p>The list of current Internet-Drafts can be accessed at <a href="http://www.ietf.org/ietf/1id-abstracts.txt">http://www.ietf.org/ietf/1id-abstracts.txt</a>.
430         </p>
431         <p>The list of Internet-Draft Shadow Directories can be accessed at <a href="http://www.ietf.org/shadow.html">http://www.ietf.org/shadow.html</a>.
432         </p>
433         <p>This Internet-Draft will expire on June 22, 2008.</p>
434      </div>
435      <h1 id="rfc.abstract"><a href="#rfc.abstract">Abstract</a></h1>
436      <p>The Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed, collaborative, hypermedia information
437         systems. HTTP has been in use by the World Wide Web global information initiative since 1990. This document is Part 5 of the
438         seven-part specification that defines the protocol referred to as "HTTP/1.1" and, taken together, obsoletes RFC 2616. Part
439         5 defines range-specific requests and the rules for constructing and combining responses to those requests.
440      </p>
441      <h1 id="rfc.note.1"><a href="#rfc.note.1">Editorial Note (To be removed by RFC Editor)</a></h1>
442      <p>This version of the HTTP specification contains only minimal editorial changes from <a href="#RFC2616" id="rfc.xref.RFC2616.1"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> (abstract, introductory paragraph, and authors' addresses). All other changes are due to partitioning the original into seven
443         mostly independent parts. The intent is for readers of future drafts to able to use draft 00 as the basis for comparison when
444         the WG makes later changes to the specification text. This draft will shortly be followed by draft 01 (containing the first
445         round of changes that have already been agreed to on the mailing list). There is no point in reviewing this draft other than
446         to verify that the partitioning has been done correctly. Roy T. Fielding, Yves Lafon, and Julian Reschke will be the editors
447         after draft 00 is submitted.
448      </p>
449      <p>Discussion of this draft should take place on the HTTPBIS working group mailing list (ietf-http-wg@w3.org). The current issues
450         list is at &lt;<a href="http://www3.tools.ietf.org/wg/httpbis/trac/report/11">http://www3.tools.ietf.org/wg/httpbis/trac/report/11</a>&gt; and related documents (including fancy diffs) can be found at &lt;<a href="http://www3.tools.ietf.org/wg/httpbis/">http://www3.tools.ietf.org/wg/httpbis/</a>&gt;.
451      </p>
452      <hr class="noprint">
453      <h1 class="np" id="rfc.toc"><a href="#rfc.toc">Table of Contents</a></h1>
454      <ul class="toc">
455         <li><a href="#rfc.section.1">1.</a>&nbsp;&nbsp;&nbsp;<a href="#introduction">Introduction</a></li>
456         <li><a href="#rfc.section.2">2.</a>&nbsp;&nbsp;&nbsp;<a href="#range.units">Range Units</a></li>
457         <li><a href="#rfc.section.3">3.</a>&nbsp;&nbsp;&nbsp;<a href="#rfc.section.3">Status Code Definitions</a><ul>
458               <li><a href="#rfc.section.3.1">3.1</a>&nbsp;&nbsp;&nbsp;<a href="#status.206">206 Partial Content</a></li>
459               <li><a href="#rfc.section.3.2">3.2</a>&nbsp;&nbsp;&nbsp;<a href="#status.416">416 Requested Range Not Satisfiable</a></li>
460            </ul>
461         </li>
462         <li><a href="#rfc.section.4">4.</a>&nbsp;&nbsp;&nbsp;<a href="#combining.byte.ranges">Combining Byte Ranges</a></li>
463         <li><a href="#rfc.section.5">5.</a>&nbsp;&nbsp;&nbsp;<a href="#header.fields">Header Field Definitions</a><ul>
464               <li><a href="#rfc.section.5.1">5.1</a>&nbsp;&nbsp;&nbsp;<a href="#header.accept-ranges">Accept-Ranges</a></li>
465               <li><a href="#rfc.section.5.2">5.2</a>&nbsp;&nbsp;&nbsp;<a href="#header.content-range">Content-Range</a></li>
466               <li><a href="#rfc.section.5.3">5.3</a>&nbsp;&nbsp;&nbsp;<a href="#header.if-range">If-Range</a></li>
467               <li><a href="#rfc.section.5.4">5.4</a>&nbsp;&nbsp;&nbsp;<a href="#header.range">Range</a><ul>
468                     <li><a href="#rfc.section.5.4.1">5.4.1</a>&nbsp;&nbsp;&nbsp;<a href="#byte.ranges">Byte Ranges</a></li>
469                     <li><a href="#rfc.section.5.4.2">5.4.2</a>&nbsp;&nbsp;&nbsp;<a href="#range.retrieval.requests">Range Retrieval Requests</a></li>
470                  </ul>
471               </li>
472            </ul>
473         </li>
474         <li><a href="#rfc.section.6">6.</a>&nbsp;&nbsp;&nbsp;<a href="#IANA.considerations">IANA Considerations</a></li>
475         <li><a href="#rfc.section.7">7.</a>&nbsp;&nbsp;&nbsp;<a href="#security.considerations">Security Considerations</a></li>
476         <li><a href="#rfc.section.8">8.</a>&nbsp;&nbsp;&nbsp;<a href="#ack">Acknowledgments</a></li>
477         <li><a href="#rfc.section.9">9.</a>&nbsp;&nbsp;&nbsp;<a href="#rfc.references">References</a></li>
478         <li><a href="#rfc.section.A">A.</a>&nbsp;&nbsp;&nbsp;<a href="#internet.media.type.multipart.byteranges">Internet Media Type multipart/byteranges</a></li>
479         <li><a href="#rfc.section.B">B.</a>&nbsp;&nbsp;&nbsp;<a href="#changes.from.rfc.2068">Changes from RFC 2068</a></li>
480         <li><a href="#rfc.index">Index</a></li>
481         <li><a href="#rfc.authors">Authors' Addresses</a></li>
482         <li><a href="#rfc.ipr">Intellectual Property and Copyright Statements</a></li>
483      </ul>
484      <div id="introduction">
485         <h1 id="rfc.section.1" class="np"><a href="#rfc.section.1">1.</a>&nbsp;<a href="#introduction">Introduction</a></h1>
486         <p id="rfc.section.1.p.1">This document will define aspects of HTTP related to range requests, partial responses, and the multipart/byteranges media
487            type. Right now it only includes the extracted relevant sections of <a href="#RFC2616">RFC 2616</a> <cite title="Hypertext Transfer Protocol -- HTTP/1.1" id="rfc.xref.RFC2616.2">[RFC2616]</cite> without edit.
488         </p>
489      </div>
490      <div id="range.units">
491         <h1 id="rfc.section.2"><a href="#rfc.section.2">2.</a>&nbsp;<a href="#range.units">Range Units</a></h1>
492         <p id="rfc.section.2.p.1">HTTP/1.1 allows a client to request that only part (a range of) the response entity be included within the response. HTTP/1.1
493            uses range units in the Range (<a href="#header.range" id="rfc.xref.header.range.1" title="Range">Section&nbsp;5.4</a>) and Content-Range (<a href="#header.content-range" id="rfc.xref.header.content-range.1" title="Content-Range">Section&nbsp;5.2</a>) header fields. An entity can be broken down into subranges according to various structural units.
494         </p>
495         <div id="rfc.figure.u.1"></div><pre class="inline"><span id="rfc.iref.g.1"></span><span id="rfc.iref.g.2"></span><span id="rfc.iref.g.3"></span>   range-unit       = bytes-unit | other-range-unit
496   bytes-unit       = "bytes"
497   other-range-unit = token
498</pre><p id="rfc.section.2.p.3">The only range unit defined by HTTP/1.1 is "bytes". HTTP/1.1 implementations <em class="bcp14">MAY</em> ignore ranges specified using other units.
499         </p>
500         <p id="rfc.section.2.p.4">HTTP/1.1 has been designed to allow implementations of applications that do not depend on knowledge of ranges.</p>
501      </div>
502      <div>
503         <h1 id="rfc.section.3"><a href="#rfc.section.3">3.</a>&nbsp;Status Code Definitions
504         </h1>
505         <div id="status.206">
506            <div id="rfc.iref.2.1"></div>
507            <div id="rfc.iref.s.1"></div>
508            <h2 id="rfc.section.3.1"><a href="#rfc.section.3.1">3.1</a>&nbsp;<a href="#status.206">206 Partial Content</a></h2>
509            <p id="rfc.section.3.1.p.1">The server has fulfilled the partial GET request for the resource. The request <em class="bcp14">MUST</em> have included a Range header field (<a href="#header.range" id="rfc.xref.header.range.2" title="Range">Section&nbsp;5.4</a>) indicating the desired range, and <em class="bcp14">MAY</em> have included an If-Range header field (<a href="#header.if-range" id="rfc.xref.header.if-range.1" title="If-Range">Section&nbsp;5.3</a>) to make the request conditional.
510            </p>
511            <p id="rfc.section.3.1.p.2">The response <em class="bcp14">MUST</em> include the following header fields:
512            </p>
513            <ul>
514               <li>Either a Content-Range header field (<a href="#header.content-range" id="rfc.xref.header.content-range.2" title="Content-Range">Section&nbsp;5.2</a>) indicating the range included with this response, or a multipart/byteranges Content-Type including Content-Range fields
515                  for each part. If a Content-Length header field is present in the response, its value <em class="bcp14">MUST</em> match the actual number of OCTETs transmitted in the message-body.
516               </li>
517               <li>Date</li>
518               <li>ETag and/or Content-Location, if the header would have been sent in a 200 response to the same request</li>
519               <li>Expires, Cache-Control, and/or Vary, if the field-value might differ from that sent in any previous response for the same
520                  variant
521               </li>
522            </ul>
523            <p id="rfc.section.3.1.p.3">If the 206 response is the result of an If-Range request that used a strong cache validator (see <a href="p4-conditional.html#weak.and.strong.validators" title="Weak and Strong Validators">Section 4</a> of <a href="#Part4" id="rfc.xref.Part4.1"><cite title="HTTP/1.1, part 4: Conditional Requests">[Part4]</cite></a>), the response <em class="bcp14">SHOULD NOT</em> include other entity-headers. If the response is the result of an If-Range request that used a weak validator, the response <em class="bcp14">MUST NOT</em> include other entity-headers; this prevents inconsistencies between cached entity-bodies and updated headers. Otherwise, the
524               response <em class="bcp14">MUST</em> include all of the entity-headers that would have been returned with a 200 (OK) response to the same request.
525            </p>
526            <p id="rfc.section.3.1.p.4">A cache <em class="bcp14">MUST NOT</em> combine a 206 response with other previously cached content if the ETag or Last-Modified headers do not match exactly, see <a href="#combining.byte.ranges" title="Combining Byte Ranges">4</a>.
527            </p>
528            <p id="rfc.section.3.1.p.5">A cache that does not support the Range and Content-Range headers <em class="bcp14">MUST NOT</em> cache 206 (Partial) responses.
529            </p>
530         </div>
531         <div id="status.416">
532            <div id="rfc.iref.4.1"></div>
533            <div id="rfc.iref.s.2"></div>
534            <h2 id="rfc.section.3.2"><a href="#rfc.section.3.2">3.2</a>&nbsp;<a href="#status.416">416 Requested Range Not Satisfiable</a></h2>
535            <p id="rfc.section.3.2.p.1">A server <em class="bcp14">SHOULD</em> return a response with this status code if a request included a Range request-header field (<a href="#header.range" id="rfc.xref.header.range.3" title="Range">Section&nbsp;5.4</a>), and none of the range-specifier values in this field overlap the current extent of the selected resource, and the request
536               did not include an If-Range request-header field. (For byte-ranges, this means that the first-byte-pos of all of the byte-range-spec
537               values were greater than the current length of the selected resource.)
538            </p>
539            <p id="rfc.section.3.2.p.2">When this status code is returned for a byte-range request, the response <em class="bcp14">SHOULD</em> include a Content-Range entity-header field specifying the current length of the selected resource (see <a href="#header.content-range" id="rfc.xref.header.content-range.3" title="Content-Range">Section&nbsp;5.2</a>). This response <em class="bcp14">MUST NOT</em> use the multipart/byteranges content-type.
540            </p>
541         </div>
542      </div>
543      <div id="combining.byte.ranges">
544         <h1 id="rfc.section.4"><a href="#rfc.section.4">4.</a>&nbsp;<a href="#combining.byte.ranges">Combining Byte Ranges</a></h1>
545         <p id="rfc.section.4.p.1">A response might transfer only a subrange of the bytes of an entity-body, either because the request included one or more
546            Range specifications, or because a connection was broken prematurely. After several such transfers, a cache might have received
547            several ranges of the same entity-body.
548         </p>
549         <p id="rfc.section.4.p.2">If a cache has a stored non-empty set of subranges for an entity, and an incoming response transfers another subrange, the
550            cache <em class="bcp14">MAY</em> combine the new subrange with the existing set if both the following conditions are met:
551         </p>
552         <ul>
553            <li>Both the incoming response and the cache entry have a cache validator.</li>
554            <li>The two cache validators match using the strong comparison function (see <a href="p4-conditional.html#weak.and.strong.validators" title="Weak and Strong Validators">Section 4</a> of <a href="#Part4" id="rfc.xref.Part4.2"><cite title="HTTP/1.1, part 4: Conditional Requests">[Part4]</cite></a>).
555            </li>
556         </ul>
557         <p id="rfc.section.4.p.3">If either requirement is not met, the cache <em class="bcp14">MUST</em> use only the most recent partial response (based on the Date values transmitted with every response, and using the incoming
558            response if these values are equal or missing), and <em class="bcp14">MUST</em> discard the other partial information.
559         </p>
560      </div>
561      <div id="header.fields">
562         <h1 id="rfc.section.5"><a href="#rfc.section.5">5.</a>&nbsp;<a href="#header.fields">Header Field Definitions</a></h1>
563         <p id="rfc.section.5.p.1">This section defines the syntax and semantics of all standard HTTP/1.1 header fields. For entity-header fields, both sender
564            and recipient refer to either the client or the server, depending on who sends and who receives the entity.
565         </p>
566         <div id="header.accept-ranges">
567            <div id="rfc.iref.a.1"></div>
568            <div id="rfc.iref.h.1"></div>
569            <h2 id="rfc.section.5.1"><a href="#rfc.section.5.1">5.1</a>&nbsp;<a href="#header.accept-ranges">Accept-Ranges</a></h2>
570            <p id="rfc.section.5.1.p.1">The Accept-Ranges response-header field allows the server to indicate its acceptance of range requests for a resource:</p>
571            <div id="rfc.figure.u.2"></div><pre class="inline"><span id="rfc.iref.g.4"></span><span id="rfc.iref.g.5"></span>       Accept-Ranges     = "Accept-Ranges" ":" acceptable-ranges
572       acceptable-ranges = 1#range-unit | "none"
573</pre><p id="rfc.section.5.1.p.3">Origin servers that accept byte-range requests <em class="bcp14">MAY</em> send
574            </p>
575            <div id="rfc.figure.u.3"></div><pre class="text">       Accept-Ranges: bytes
576</pre><p id="rfc.section.5.1.p.5">but are not required to do so. Clients <em class="bcp14">MAY</em> generate byte-range requests without having received this header for the resource involved. Range units are defined in <a href="#range.units" title="Range Units">Section&nbsp;2</a>.
577            </p>
578            <p id="rfc.section.5.1.p.6">Servers that do not accept any kind of range request for a resource <em class="bcp14">MAY</em> send
579            </p>
580            <div id="rfc.figure.u.4"></div><pre class="text">       Accept-Ranges: none
581</pre><p id="rfc.section.5.1.p.8">to advise the client not to attempt a range request.</p>
582         </div>
583         <div id="header.content-range">
584            <div id="rfc.iref.c.1"></div>
585            <div id="rfc.iref.h.2"></div>
586            <h2 id="rfc.section.5.2"><a href="#rfc.section.5.2">5.2</a>&nbsp;<a href="#header.content-range">Content-Range</a></h2>
587            <p id="rfc.section.5.2.p.1">The Content-Range entity-header is sent with a partial entity-body to specify where in the full entity-body the partial body
588               should be applied. Range units are defined in <a href="#range.units" title="Range Units">Section&nbsp;2</a>.
589            </p>
590            <div id="rfc.figure.u.5"></div><pre class="inline"><span id="rfc.iref.g.6"></span><span id="rfc.iref.g.7"></span><span id="rfc.iref.g.8"></span><span id="rfc.iref.g.9"></span><span id="rfc.iref.g.10"></span>    Content-Range = "Content-Range" ":" content-range-spec
591
592    content-range-spec      = byte-content-range-spec
593    byte-content-range-spec = bytes-unit SP
594                              byte-range-resp-spec "/"
595                              ( instance-length | "*" )
596
597    byte-range-resp-spec = (first-byte-pos "-" last-byte-pos)
598                                   | "*"
599    instance-length           = 1*DIGIT
600</pre><p id="rfc.section.5.2.p.3">The header <em class="bcp14">SHOULD</em> indicate the total length of the full entity-body, unless this length is unknown or difficult to determine. The asterisk "*"
601               character means that the instance-length is unknown at the time when the response was generated.
602            </p>
603            <p id="rfc.section.5.2.p.4">Unlike byte-ranges-specifier values (see <a href="#byte.ranges" title="Byte Ranges">Section&nbsp;5.4.1</a>), a byte-range-resp-spec <em class="bcp14">MUST</em> only specify one range, and <em class="bcp14">MUST</em> contain absolute byte positions for both the first and last byte of the range.
604            </p>
605            <p id="rfc.section.5.2.p.5">A byte-content-range-spec with a byte-range-resp-spec whose last-byte-pos value is less than its first-byte-pos value, or
606               whose instance-length value is less than or equal to its last-byte-pos value, is invalid. The recipient of an invalid byte-content-range-spec <em class="bcp14">MUST</em> ignore it and any content transferred along with it.
607            </p>
608            <p id="rfc.section.5.2.p.6">A server sending a response with status code 416 (Requested range not satisfiable) <em class="bcp14">SHOULD</em> include a Content-Range field with a byte-range-resp-spec of "*". The instance-length specifies the current length of the
609               selected resource. A response with status code 206 (Partial Content) <em class="bcp14">MUST NOT</em> include a Content-Range field with a byte-range-resp-spec of "*".
610            </p>
611            <p id="rfc.section.5.2.p.7">Examples of byte-content-range-spec values, assuming that the entity contains a total of 1234 bytes: </p>
612            <ul>
613               <li>The first 500 bytes: <span id="rfc.figure.u.6"></span><pre class="text">   bytes 0-499/1234
614</pre> </li>
615               <li>The second 500 bytes: <span id="rfc.figure.u.7"></span><pre class="text">   bytes 500-999/1234
616</pre> </li>
617               <li>All except for the first 500 bytes: <span id="rfc.figure.u.8"></span><pre class="text">   bytes 500-1233/1234
618</pre> </li>
619               <li>The last 500 bytes: <span id="rfc.figure.u.9"></span><pre class="text">   bytes 734-1233/1234
620</pre> </li>
621            </ul>
622            <p id="rfc.section.5.2.p.8">When an HTTP message includes the content of a single range (for example, a response to a request for a single range, or to
623               a request for a set of ranges that overlap without any holes), this content is transmitted with a Content-Range header, and
624               a Content-Length header showing the number of bytes actually transferred. For example,
625            </p>
626            <div id="rfc.figure.u.10"></div><pre class="text">    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</pre><p id="rfc.section.5.2.p.10">When an HTTP message includes the content of multiple ranges (for example, a response to a request for multiple non-overlapping
633               ranges), these are transmitted as a multipart message. The multipart media type used for this purpose is "multipart/byteranges"
634               as defined in <a href="#internet.media.type.multipart.byteranges" title="Internet Media Type multipart/byteranges">Appendix&nbsp;A</a>. See <a href="#changes.from.rfc.2068" title="Changes from RFC 2068">Appendix&nbsp;B</a> for a compatibility issue.
635            </p>
636            <p id="rfc.section.5.2.p.11">A response to a request for a single range <em class="bcp14">MUST NOT</em> be sent using the multipart/byteranges media type. A response to a request for multiple ranges, whose result is a single range, <em class="bcp14">MAY</em> be sent as a multipart/byteranges media type with one part. A client that cannot decode a multipart/byteranges message <em class="bcp14">MUST NOT</em> ask for multiple byte-ranges in a single request.
637            </p>
638            <p id="rfc.section.5.2.p.12">When a client requests multiple byte-ranges in one request, the server <em class="bcp14">SHOULD</em> return them in the order that they appeared in the request.
639            </p>
640            <p id="rfc.section.5.2.p.13">If the server ignores a byte-range-spec because it is syntactically invalid, the server <em class="bcp14">SHOULD</em> treat the request as if the invalid Range header field did not exist. (Normally, this means return a 200 response containing
641               the full entity).
642            </p>
643            <p id="rfc.section.5.2.p.14">If the server receives a request (other than one including an If-Range request-header field) with an unsatisfiable Range request-header
644               field (that is, all of whose byte-range-spec values have a first-byte-pos value greater than the current length of the selected
645               resource), it <em class="bcp14">SHOULD</em> return a response code of 416 (Requested range not satisfiable) (<a href="#status.416" id="rfc.xref.status.416.1" title="416 Requested Range Not Satisfiable">Section&nbsp;3.2</a>).
646            </p>
647            <ul class="empty">
648               <li><b>Note:</b> clients cannot depend on servers to send a 416 (Requested range not satisfiable) response instead of a 200 (OK) response for
649                  an unsatisfiable Range request-header, since not all servers implement this request-header.
650               </li>
651            </ul>
652         </div>
653         <div id="header.if-range">
654            <div id="rfc.iref.i.1"></div>
655            <div id="rfc.iref.h.3"></div>
656            <h2 id="rfc.section.5.3"><a href="#rfc.section.5.3">5.3</a>&nbsp;<a href="#header.if-range">If-Range</a></h2>
657            <p id="rfc.section.5.3.p.1">If a client has a partial copy of an entity in its cache, and wishes to have an up-to-date copy of the entire entity in its
658               cache, it could use the Range request-header with a conditional GET (using either or both of If-Unmodified-Since and If-Match.)
659               However, if the condition fails because the entity has been modified, the client would then have to make a second request
660               to obtain the entire current entity-body.
661            </p>
662            <p id="rfc.section.5.3.p.2">The If-Range header allows a client to "short-circuit" the second request. Informally, its meaning is `if the entity is unchanged,
663               send me the part(s) that I am missing; otherwise, send me the entire new entity'.
664            </p>
665            <div id="rfc.figure.u.11"></div><pre class="inline"><span id="rfc.iref.g.11"></span>     If-Range = "If-Range" ":" ( entity-tag | HTTP-date )
666</pre><p id="rfc.section.5.3.p.4">If the client has no entity tag for an entity, but does have a Last-Modified date, it <em class="bcp14">MAY</em> use that date in an If-Range header. (The server can distinguish between a valid HTTP-date and any form of entity-tag by examining
667               no more than two characters.) The If-Range header <em class="bcp14">SHOULD</em> only be used together with a Range header, and <em class="bcp14">MUST</em> be ignored if the request does not include a Range header, or if the server does not support the sub-range operation.
668            </p>
669            <p id="rfc.section.5.3.p.5">If the entity tag given in the If-Range header matches the current entity tag for the entity, then the server <em class="bcp14">SHOULD</em> provide the specified sub-range of the entity using a 206 (Partial content) response. If the entity tag does not match, then
670               the server <em class="bcp14">SHOULD</em> return the entire entity using a 200 (OK) response.
671            </p>
672         </div>
673         <div id="header.range">
674            <div id="rfc.iref.r.1"></div>
675            <div id="rfc.iref.h.4"></div>
676            <h2 id="rfc.section.5.4"><a href="#rfc.section.5.4">5.4</a>&nbsp;<a href="#header.range">Range</a></h2>
677            <div id="byte.ranges">
678               <h3 id="rfc.section.5.4.1"><a href="#rfc.section.5.4.1">5.4.1</a>&nbsp;<a href="#byte.ranges">Byte Ranges</a></h3>
679               <p id="rfc.section.5.4.1.p.1">Since all HTTP entities are represented in HTTP messages as sequences of bytes, the concept of a byte range is meaningful
680                  for any HTTP entity. (However, not all clients and servers need to support byte-range operations.)
681               </p>
682               <p id="rfc.section.5.4.1.p.2">Byte range specifications in HTTP apply to the sequence of bytes in the entity-body (not necessarily the same as the message-body).</p>
683               <p id="rfc.section.5.4.1.p.3">A byte range operation <em class="bcp14">MAY</em> specify a single range of bytes, or a set of ranges within a single entity.
684               </p>
685               <div id="rfc.figure.u.12"></div><pre class="inline"><span id="rfc.iref.g.12"></span><span id="rfc.iref.g.13"></span><span id="rfc.iref.g.14"></span><span id="rfc.iref.g.15"></span><span id="rfc.iref.g.16"></span><span id="rfc.iref.g.17"></span>    ranges-specifier = byte-ranges-specifier
686    byte-ranges-specifier = bytes-unit "=" byte-range-set
687    byte-range-set  = 1#( byte-range-spec | suffix-byte-range-spec )
688    byte-range-spec = first-byte-pos "-" [last-byte-pos]
689    first-byte-pos  = 1*DIGIT
690    last-byte-pos   = 1*DIGIT
691</pre><p id="rfc.section.5.4.1.p.5">The first-byte-pos value in a byte-range-spec gives the byte-offset of the first byte in a range. The last-byte-pos value
692                  gives the byte-offset of the last byte in the range; that is, the byte positions specified are inclusive. Byte offsets start
693                  at zero.
694               </p>
695               <p id="rfc.section.5.4.1.p.6">If the last-byte-pos value is present, it <em class="bcp14">MUST</em> be greater than or equal to the first-byte-pos in that byte-range-spec, or the byte-range-spec is syntactically invalid. The
696                  recipient of a byte-range-set that includes one or more syntactically invalid byte-range-spec values <em class="bcp14">MUST</em> ignore the header field that includes that byte-range-set.
697               </p>
698               <p id="rfc.section.5.4.1.p.7">If the last-byte-pos value is absent, or if the value is greater than or equal to the current length of the entity-body, last-byte-pos
699                  is taken to be equal to one less than the current length of the entity-body in bytes.
700               </p>
701               <p id="rfc.section.5.4.1.p.8">By its choice of last-byte-pos, a client can limit the number of bytes retrieved without knowing the size of the entity.</p>
702               <div id="rfc.figure.u.13"></div><pre class="inline"><span id="rfc.iref.g.18"></span><span id="rfc.iref.g.19"></span>    suffix-byte-range-spec = "-" suffix-length
703    suffix-length = 1*DIGIT
704</pre><p id="rfc.section.5.4.1.p.10">A suffix-byte-range-spec is used to specify the suffix of the entity-body, of a length given by the suffix-length value. (That
705                  is, this form specifies the last N bytes of an entity-body.) If the entity is shorter than the specified suffix-length, the
706                  entire entity-body is used.
707               </p>
708               <p id="rfc.section.5.4.1.p.11">If a syntactically valid byte-range-set includes at least one byte-range-spec whose first-byte-pos is less than the current
709                  length of the entity-body, or at least one suffix-byte-range-spec with a non-zero suffix-length, then the byte-range-set is
710                  satisfiable. Otherwise, the byte-range-set is unsatisfiable. If the byte-range-set is unsatisfiable, the server <em class="bcp14">SHOULD</em> return a response with a status of 416 (Requested range not satisfiable). Otherwise, the server <em class="bcp14">SHOULD</em> return a response with a status of 206 (Partial Content) containing the satisfiable ranges of the entity-body.
711               </p>
712               <p id="rfc.section.5.4.1.p.12">Examples of byte-ranges-specifier values (assuming an entity-body of length 10000): </p>
713               <ul>
714                  <li>The first 500 bytes (byte offsets 0-499, inclusive): bytes=0-499</li>
715                  <li>The second 500 bytes (byte offsets 500-999, inclusive): bytes=500-999</li>
716                  <li>The final 500 bytes (byte offsets 9500-9999, inclusive): bytes=-500</li>
717                  <li>Or bytes=9500-</li>
718                  <li>The first and last bytes only (bytes 0 and 9999): bytes=0-0,-1</li>
719                  <li>Several legal but not canonical specifications of the second 500 bytes (byte offsets 500-999, inclusive): <br> bytes=500-600,601-999<br> bytes=500-700,601-999
720                  </li>
721               </ul>
722            </div>
723            <div id="range.retrieval.requests">
724               <h3 id="rfc.section.5.4.2"><a href="#rfc.section.5.4.2">5.4.2</a>&nbsp;<a href="#range.retrieval.requests">Range Retrieval Requests</a></h3>
725               <p id="rfc.section.5.4.2.p.1">HTTP retrieval requests using conditional or unconditional GET methods <em class="bcp14">MAY</em> request one or more sub-ranges of the entity, instead of the entire entity, using the Range request header, which applies
726                  to the entity returned as the result of the request:
727               </p>
728               <div id="rfc.figure.u.14"></div><pre class="inline"><span id="rfc.iref.g.20"></span>   Range = "Range" ":" ranges-specifier
729</pre><p id="rfc.section.5.4.2.p.3">A server <em class="bcp14">MAY</em> ignore the Range header. However, HTTP/1.1 origin servers and intermediate caches ought to support byte ranges when possible,
730                  since Range supports efficient recovery from partially failed transfers, and supports efficient partial retrieval of large
731                  entities.
732               </p>
733               <p id="rfc.section.5.4.2.p.4">If the server supports the Range header and the specified range or ranges are appropriate for the entity: </p>
734               <ul>
735                  <li>The presence of a Range header in an unconditional GET modifies what is returned if the GET is otherwise successful. In other
736                     words, the response carries a status code of 206 (Partial Content) instead of 200 (OK).
737                  </li>
738                  <li>The presence of a Range header in a conditional GET (a request using one or both of If-Modified-Since and If-None-Match, or
739                     one or both of If-Unmodified-Since and If-Match) modifies what is returned if the GET is otherwise successful and the condition
740                     is true. It does not affect the 304 (Not Modified) response returned if the conditional is false.
741                  </li>
742               </ul>
743               <p id="rfc.section.5.4.2.p.5">In some cases, it might be more appropriate to use the If-Range header (see <a href="#header.if-range" id="rfc.xref.header.if-range.2" title="If-Range">Section&nbsp;5.3</a>) in addition to the Range header.
744               </p>
745               <p id="rfc.section.5.4.2.p.6">If a proxy that supports ranges receives a Range request, forwards the request to an inbound server, and receives an entire
746                  entity in reply, it <em class="bcp14">SHOULD</em> only return the requested range to its client. It <em class="bcp14">SHOULD</em> store the entire received response in its cache if that is consistent with its cache allocation policies.
747               </p>
748            </div>
749         </div>
750      </div>
751      <div id="IANA.considerations">
752         <h1 id="rfc.section.6"><a href="#rfc.section.6">6.</a>&nbsp;<a href="#IANA.considerations">IANA Considerations</a></h1>
753         <p id="rfc.section.6.p.1">TBD.</p>
754      </div>
755      <div id="security.considerations">
756         <h1 id="rfc.section.7"><a href="#rfc.section.7">7.</a>&nbsp;<a href="#security.considerations">Security Considerations</a></h1>
757         <p id="rfc.section.7.p.1">No additional security considerations have been identified beyond those applicable to HTTP in general <a href="#Part1" id="rfc.xref.Part1.1"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>.
758         </p>
759      </div>
760      <div id="ack">
761         <h1 id="rfc.section.8"><a href="#rfc.section.8">8.</a>&nbsp;<a href="#ack">Acknowledgments</a></h1>
762         <p id="rfc.section.8.p.1">Most of the specification of ranges is based on work originally done by Ari Luotonen and John Franks, with additional input
763            from Steve Zilles.
764         </p>
765         <p id="rfc.section.8.p.2">Based on an XML translation of RFC 2616 by Julian Reschke.</p>
766      </div>
767      <h1 id="rfc.references"><a href="#rfc.section.9" id="rfc.section.9">9.</a> References
768      </h1>
769      <table>
770         <tr>
771            <td class="reference"><b id="Part1">[Part1]</b></td>
772            <td class="top"><a href="mailto:fielding@gbiv.com" title="Day Software">Fielding, R., Ed.</a>, <a href="mailto:jg@laptop.org" title="One Laptop per Child">Gettys, J.</a>, <a href="mailto:JeffMogul@acm.org" title="Hewlett-Packard Company">Mogul, J.</a>, <a href="mailto:henrikn@microsoft.com" title="Microsoft Corporation">Frystyk, H.</a>, <a href="mailto:LMM@acm.org" title="Adobe Systems, Incorporated">Masinter, L.</a>, <a href="mailto:paulle@microsoft.com" title="Microsoft Corporation">Leach, P.</a>, and <a href="mailto:timbl@w3.org" title="World Wide Web Consortium">T. Berners-Lee</a>, “<a href="https://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-00">HTTP/1.1, part 1: URIs, Connections, and Message Parsing</a>”, Internet-Draft&nbsp;draft-ietf-httpbis-p1-messaging-00 (work in progress), December&nbsp;2007.
773            </td>
774         </tr>
775         <tr>
776            <td class="reference"><b id="Part4">[Part4]</b></td>
777            <td class="top"><a href="mailto:fielding@gbiv.com" title="Day Software">Fielding, R., Ed.</a>, <a href="mailto:jg@laptop.org" title="One Laptop per Child">Gettys, J.</a>, <a href="mailto:JeffMogul@acm.org" title="Hewlett-Packard Company">Mogul, J.</a>, <a href="mailto:henrikn@microsoft.com" title="Microsoft Corporation">Frystyk, H.</a>, <a href="mailto:LMM@acm.org" title="Adobe Systems, Incorporated">Masinter, L.</a>, <a href="mailto:paulle@microsoft.com" title="Microsoft Corporation">Leach, P.</a>, and <a href="mailto:timbl@w3.org" title="World Wide Web Consortium">T. Berners-Lee</a>, “<a href="https://tools.ietf.org/html/draft-ietf-httpbis-p4-conditional-00">HTTP/1.1, part 4: Conditional Requests</a>”, Internet-Draft&nbsp;draft-ietf-httpbis-p4-conditional-00 (work in progress), December&nbsp;2007.
778            </td>
779         </tr>
780         <tr>
781            <td class="reference"><b id="RFC2046">[RFC2046]</b></td>
782            <td class="top"><a href="mailto:ned@innosoft.com" title="Innosoft International, Inc.">Freed, N.</a> and <a href="mailto:nsb@nsb.fv.com" title="First Virtual Holdings">N. Borenstein</a>, “<a href="https://tools.ietf.org/html/rfc2046">Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types</a>”, RFC&nbsp;2046, November&nbsp;1996.
783            </td>
784         </tr>
785         <tr>
786            <td class="reference"><b id="RFC2616">[RFC2616]</b></td>
787            <td class="top"><a href="mailto:fielding@ics.uci.edu" title="University of California, Irvine">Fielding, R.</a>, <a href="mailto:jg@w3.org" title="W3C">Gettys, J.</a>, <a href="mailto:mogul@wrl.dec.com" title="Compaq Computer Corporation">Mogul, J.</a>, <a href="mailto:frystyk@w3.org" title="MIT Laboratory for Computer Science">Frystyk, H.</a>, <a href="mailto:masinter@parc.xerox.com" title="Xerox Corporation">Masinter, L.</a>, <a href="mailto:paulle@microsoft.com" title="Microsoft Corporation">Leach, P.</a>, and <a href="mailto:timbl@w3.org" title="W3C">T. Berners-Lee</a>, “<a href="https://tools.ietf.org/html/rfc2616">Hypertext Transfer Protocol -- HTTP/1.1</a>”, RFC&nbsp;2616, June&nbsp;1999.
788            </td>
789         </tr>
790      </table>
791      <div id="internet.media.type.multipart.byteranges">
792         <div id="rfc.iref.m.1"></div>
793         <div id="rfc.iref.m.2"></div>
794         <h1 id="rfc.section.A" class="np"><a href="#rfc.section.A">A.</a>&nbsp;<a href="#internet.media.type.multipart.byteranges">Internet Media Type multipart/byteranges</a></h1>
795         <p id="rfc.section.A.p.1">When an HTTP 206 (Partial Content) response message includes the content of multiple ranges (a response to a request for multiple
796            non-overlapping ranges), these are transmitted as a multipart message-body. The media type for this purpose is called "multipart/byteranges".
797         </p>
798         <p id="rfc.section.A.p.2">The multipart/byteranges media type includes two or more parts, each with its own Content-Type and Content-Range fields. The
799            required boundary parameter specifies the boundary string used to separate each body-part.
800         </p>
801         <p id="rfc.section.A.p.3"></p>
802         <dl>
803            <dt>Media Type name:</dt>
804            <dd>multipart</dd>
805            <dt>Media subtype name:</dt>
806            <dd>byteranges</dd>
807            <dt>Required parameters:</dt>
808            <dd>boundary</dd>
809            <dt>Optional parameters:</dt>
810            <dd>none</dd>
811            <dt>Encoding considerations:</dt>
812            <dd>only "7bit", "8bit", or "binary" are permitted</dd>
813            <dt>Security considerations:</dt>
814            <dd>none</dd>
815         </dl>
816         <div id="rfc.figure.u.15"></div>
817         <p>For example:</p><pre class="text">   HTTP/1.1 206 Partial Content
818   Date: Wed, 15 Nov 1995 06:25:24 GMT
819   Last-Modified: Wed, 15 Nov 1995 04:58:08 GMT
820   Content-type: multipart/byteranges; boundary=THIS_STRING_SEPARATES
821
822   --THIS_STRING_SEPARATES
823   Content-type: application/pdf
824   Content-range: bytes 500-999/8000
825
826   ...the first range...
827   --THIS_STRING_SEPARATES
828   Content-type: application/pdf
829   Content-range: bytes 7000-7999/8000
830
831   ...the second range
832   --THIS_STRING_SEPARATES--
833</pre><p id="rfc.section.A.p.5">Notes: </p>
834         <ol>
835            <li>Additional CRLFs may precede the first boundary string in the entity.</li>
836            <li>Although RFC 2046 <a href="#RFC2046" id="rfc.xref.RFC2046.1"><cite title="Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types">[RFC2046]</cite></a> permits the boundary string to be quoted, some existing implementations handle a quoted boundary string incorrectly.
837            </li>
838            <li>A number of browsers and servers were coded to an early draft of the byteranges specification to use a media type of multipart/x-byteranges<span id="rfc.iref.m.3"></span><span id="rfc.iref.m.4"></span>, which is almost, but not quite compatible with the version documented in HTTP/1.1.
839            </li>
840         </ol>
841      </div>
842      <div id="changes.from.rfc.2068">
843         <h1 id="rfc.section.B"><a href="#rfc.section.B">B.</a>&nbsp;<a href="#changes.from.rfc.2068">Changes from RFC 2068</a></h1>
844         <p id="rfc.section.B.p.1">There are situations where a server (especially a proxy) does not know the full length of a response but is capable of serving
845            a byterange request. We therefore need a mechanism to allow byteranges with a content-range not indicating the full length
846            of the message. (<a href="#header.content-range" id="rfc.xref.header.content-range.4" title="Content-Range">Section&nbsp;5.2</a>)
847         </p>
848         <p id="rfc.section.B.p.2">Range request responses would become very verbose if all meta-data were always returned; by allowing the server to only send
849            needed headers in a 206 response, this problem can be avoided.
850         </p>
851         <p id="rfc.section.B.p.3">Fix problem with unsatisfiable range requests; there are two cases: syntactic problems, and range doesn't exist in the document.
852            The 416 status code was needed to resolve this ambiguity needed to indicate an error for a byte range request that falls outside
853            of the actual contents of a document. (Section <a href="#status.416" id="rfc.xref.status.416.2" title="416 Requested Range Not Satisfiable">3.2</a>, <a href="#header.content-range" id="rfc.xref.header.content-range.5" title="Content-Range">5.2</a>)
854         </p>
855      </div>
856      <h1 id="rfc.index"><a href="#rfc.index">Index</a></h1>
857      <p class="noprint"><a href="#rfc.index.2">2</a> <a href="#rfc.index.4">4</a> <a href="#rfc.index.A">A</a> <a href="#rfc.index.C">C</a> <a href="#rfc.index.G">G</a> <a href="#rfc.index.H">H</a> <a href="#rfc.index.I">I</a> <a href="#rfc.index.M">M</a> <a href="#rfc.index.P">P</a> <a href="#rfc.index.R">R</a> <a href="#rfc.index.S">S</a> 
858      </p>
859      <div class="print2col">
860         <ul class="ind">
861            <li><a id="rfc.index.2" href="#rfc.index.2"><b>2</b></a><ul>
862                  <li>206 Partial Content (status code)&nbsp;&nbsp;<a href="#rfc.iref.2.1"><b>3.1</b></a></li>
863               </ul>
864            </li>
865            <li><a id="rfc.index.4" href="#rfc.index.4"><b>4</b></a><ul>
866                  <li>416 Requested Range Not Satisfiable (status code)&nbsp;&nbsp;<a href="#rfc.iref.4.1"><b>3.2</b></a>, <a href="#rfc.xref.status.416.1">5.2</a>, <a href="#rfc.xref.status.416.2">B</a></li>
867               </ul>
868            </li>
869            <li><a id="rfc.index.A" href="#rfc.index.A"><b>A</b></a><ul>
870                  <li>Accept-Ranges header&nbsp;&nbsp;<a href="#rfc.iref.a.1"><b>5.1</b></a></li>
871               </ul>
872            </li>
873            <li><a id="rfc.index.C" href="#rfc.index.C"><b>C</b></a><ul>
874                  <li>Content-Range header&nbsp;&nbsp;<a href="#rfc.xref.header.content-range.1">2</a>, <a href="#rfc.xref.header.content-range.2">3.1</a>, <a href="#rfc.xref.header.content-range.3">3.2</a>, <a href="#rfc.iref.c.1"><b>5.2</b></a>, <a href="#rfc.xref.header.content-range.4">B</a>, <a href="#rfc.xref.header.content-range.5">B</a></li>
875               </ul>
876            </li>
877            <li><a id="rfc.index.G" href="#rfc.index.G"><b>G</b></a><ul>
878                  <li><tt>Grammar</tt>&nbsp;&nbsp;
879                     <ul>
880                        <li><tt>Accept-Ranges</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.4"><b>5.1</b></a></li>
881                        <li><tt>acceptable-ranges</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.5"><b>5.1</b></a></li>
882                        <li><tt>byte-content-range-spec</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.8"><b>5.2</b></a></li>
883                        <li><tt>byte-range-resp-spec</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.9"><b>5.2</b></a></li>
884                        <li><tt>byte-range-set</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.14"><b>5.4.1</b></a></li>
885                        <li><tt>byte-range-spec</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.15"><b>5.4.1</b></a></li>
886                        <li><tt>byte-ranges-specifier</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.13"><b>5.4.1</b></a></li>
887                        <li><tt>bytes-unit</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.2"><b>2</b></a></li>
888                        <li><tt>Content-Range</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.6"><b>5.2</b></a></li>
889                        <li><tt>content-range-spec</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.7"><b>5.2</b></a></li>
890                        <li><tt>first-byte-pos</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.16"><b>5.4.1</b></a></li>
891                        <li><tt>If-Range</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.11"><b>5.3</b></a></li>
892                        <li><tt>instance-length</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.10"><b>5.2</b></a></li>
893                        <li><tt>last-byte-pos</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.17"><b>5.4.1</b></a></li>
894                        <li><tt>other-range-unit</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.3"><b>2</b></a></li>
895                        <li><tt>Range</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.20"><b>5.4.2</b></a></li>
896                        <li><tt>range-unit</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.1"><b>2</b></a></li>
897                        <li><tt>ranges-specifier</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.12"><b>5.4.1</b></a></li>
898                        <li><tt>suffix-byte-range-spec</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.18"><b>5.4.1</b></a></li>
899                        <li><tt>suffix-length</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.19"><b>5.4.1</b></a></li>
900                     </ul>
901                  </li>
902               </ul>
903            </li>
904            <li><a id="rfc.index.H" href="#rfc.index.H"><b>H</b></a><ul>
905                  <li>Headers&nbsp;&nbsp;
906                     <ul>
907                        <li>Accept-Ranges&nbsp;&nbsp;<a href="#rfc.iref.h.1"><b>5.1</b></a></li>
908                        <li>Content-Range&nbsp;&nbsp;<a href="#rfc.xref.header.content-range.1">2</a>, <a href="#rfc.xref.header.content-range.2">3.1</a>, <a href="#rfc.xref.header.content-range.3">3.2</a>, <a href="#rfc.iref.h.2"><b>5.2</b></a>, <a href="#rfc.xref.header.content-range.4">B</a>, <a href="#rfc.xref.header.content-range.5">B</a></li>
909                        <li>If-Range&nbsp;&nbsp;<a href="#rfc.xref.header.if-range.1">3.1</a>, <a href="#rfc.iref.h.3"><b>5.3</b></a>, <a href="#rfc.xref.header.if-range.2">5.4.2</a></li>
910                        <li>Range&nbsp;&nbsp;<a href="#rfc.xref.header.range.1">2</a>, <a href="#rfc.xref.header.range.2">3.1</a>, <a href="#rfc.xref.header.range.3">3.2</a>, <a href="#rfc.iref.h.4"><b>5.4</b></a></li>
911                     </ul>
912                  </li>
913               </ul>
914            </li>
915            <li><a id="rfc.index.I" href="#rfc.index.I"><b>I</b></a><ul>
916                  <li>If-Range header&nbsp;&nbsp;<a href="#rfc.xref.header.if-range.1">3.1</a>, <a href="#rfc.iref.i.1"><b>5.3</b></a>, <a href="#rfc.xref.header.if-range.2">5.4.2</a></li>
917               </ul>
918            </li>
919            <li><a id="rfc.index.M" href="#rfc.index.M"><b>M</b></a><ul>
920                  <li>Media Type&nbsp;&nbsp;
921                     <ul>
922                        <li>multipart/byteranges&nbsp;&nbsp;<a href="#rfc.iref.m.1"><b>A</b></a></li>
923                        <li>multipart/x-byteranges&nbsp;&nbsp;<a href="#rfc.iref.m.4">A</a></li>
924                     </ul>
925                  </li>
926                  <li>multipart/byteranges Media Type&nbsp;&nbsp;<a href="#rfc.iref.m.2"><b>A</b></a></li>
927                  <li>multipart/x-byteranges Media Type&nbsp;&nbsp;<a href="#rfc.iref.m.3">A</a></li>
928               </ul>
929            </li>
930            <li><a id="rfc.index.P" href="#rfc.index.P"><b>P</b></a><ul>
931                  <li><em>Part1</em>&nbsp;&nbsp;<a href="#rfc.xref.Part1.1">7</a>, <a href="#Part1"><b>9</b></a></li>
932                  <li><em>Part4</em>&nbsp;&nbsp;<a href="#rfc.xref.Part4.1">3.1</a>, <a href="#rfc.xref.Part4.2">4</a>, <a href="#Part4"><b>9</b></a><ul>
933                        <li><em>Section 4</em>&nbsp;&nbsp;<a href="#rfc.xref.Part4.1">3.1</a>, <a href="#rfc.xref.Part4.2">4</a></li>
934                     </ul>
935                  </li>
936               </ul>
937            </li>
938            <li><a id="rfc.index.R" href="#rfc.index.R"><b>R</b></a><ul>
939                  <li>Range header&nbsp;&nbsp;<a href="#rfc.xref.header.range.1">2</a>, <a href="#rfc.xref.header.range.2">3.1</a>, <a href="#rfc.xref.header.range.3">3.2</a>, <a href="#rfc.iref.r.1"><b>5.4</b></a></li>
940                  <li><em>RFC2046</em>&nbsp;&nbsp;<a href="#RFC2046"><b>9</b></a>, <a href="#rfc.xref.RFC2046.1">A</a></li>
941                  <li><em>RFC2616</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC2616.1">§</a>, <a href="#rfc.xref.RFC2616.2">1</a>, <a href="#RFC2616"><b>9</b></a></li>
942               </ul>
943            </li>
944            <li><a id="rfc.index.S" href="#rfc.index.S"><b>S</b></a><ul>
945                  <li>Status Codes&nbsp;&nbsp;
946                     <ul>
947                        <li>206 Partial Content&nbsp;&nbsp;<a href="#rfc.iref.s.1"><b>3.1</b></a></li>
948                        <li>416 Requested Range Not Satisfiable&nbsp;&nbsp;<a href="#rfc.iref.s.2"><b>3.2</b></a>, <a href="#rfc.xref.status.416.1">5.2</a>, <a href="#rfc.xref.status.416.2">B</a></li>
949                     </ul>
950                  </li>
951               </ul>
952            </li>
953         </ul>
954      </div>
955      <div class="avoidbreak">
956         <h1 id="rfc.authors"><a href="#rfc.authors">Authors' Addresses</a></h1>
957         <p><b>Roy T. Fielding</b>
958            (editor)
959            <br>Day Software<br>23 Corporate Plaza DR, Suite 280<br>Newport Beach, CA&nbsp;92660<br>USA<br>Phone: <a href="tel:+1-949-706-5300">+1-949-706-5300</a><br>Fax: <a href="fax:+1-949-706-5305">+1-949-706-5305</a><br>EMail: <a href="mailto:fielding@gbiv.com">fielding@gbiv.com</a><br>URI: <a href="http://roy.gbiv.com/">http://roy.gbiv.com/</a></p>
960         <p><b>Jim Gettys</b><br>One Laptop per Child<br>21 Oak Knoll Road<br>Carlisle, MA&nbsp;01741<br>USA<br>EMail: <a href="mailto:jg@laptop.org">jg@laptop.org</a><br>URI: <a href="http://www.laptop.org/">http://www.laptop.org/</a></p>
961         <p><b>Jeffrey C. Mogul</b><br>Hewlett-Packard Company<br>HP Labs, Large Scale Systems Group<br>1501 Page Mill Road, MS 1177<br>Palo Alto, CA&nbsp;94304<br>USA<br>EMail: <a href="mailto:JeffMogul@acm.org">JeffMogul@acm.org</a></p>
962         <p><b>Henrik Frystyk Nielsen</b><br>Microsoft Corporation<br>1 Microsoft Way<br>Redmond, WA&nbsp;98052<br>USA<br>EMail: <a href="mailto:henrikn@microsoft.com">henrikn@microsoft.com</a></p>
963         <p><b>Larry Masinter</b><br>Adobe Systems, Incorporated<br>345 Park Ave<br>San Jose, CA&nbsp;95110<br>USA<br>EMail: <a href="mailto:LMM@acm.org">LMM@acm.org</a><br>URI: <a href="http://larry.masinter.net/">http://larry.masinter.net/</a></p>
964         <p><b>Paul J. Leach</b><br>Microsoft Corporation<br>1 Microsoft Way<br>Redmond, WA&nbsp;98052<br>EMail: <a href="mailto:paulle@microsoft.com">paulle@microsoft.com</a></p>
965         <p><b>Tim Berners-Lee</b><br>World Wide Web Consortium<br>MIT Computer Science and Artificial Intelligence Laboratory<br>The Stata Center, Building 32<br>32 Vassar Street<br>Cambridge, MA&nbsp;02139<br>USA<br>EMail: <a href="mailto:timbl@w3.org">timbl@w3.org</a><br>URI: <a href="http://www.w3.org/People/Berners-Lee/">http://www.w3.org/People/Berners-Lee/</a></p>
966      </div>
967      <div id="rfc.copyright">
968         <h1><a href="#rfc.copyright">Full Copyright Statement</a></h1>
969         <p>Copyright © The IETF Trust (2007).</p>
970         <p>This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the
971            authors retain all their rights.
972         </p>
973         <p>This document and the information contained herein are provided on an “AS IS” basis and THE CONTRIBUTOR, THE ORGANIZATION
974            HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND THE INTERNET ENGINEERING TASK FORCE
975            DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN
976            WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
977         </p>
978      </div>
979      <div id="rfc.ipr">
980         <h1><a href="#rfc.ipr">Intellectual Property</a></h1>
981         <p>The IETF takes no position regarding the validity or scope of any Intellectual Property Rights or other rights that might
982            be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any
983            license under such rights might or might not be available; nor does it represent that it has made any independent effort to
984            identify any such rights. Information on the procedures with respect to rights in RFC documents can be found in BCP 78 and
985            BCP 79.
986         </p>
987         <p>Copies of IPR disclosures made to the IETF Secretariat and any assurances of licenses to be made available, or the result
988            of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users
989            of this specification can be obtained from the IETF on-line IPR repository at <a href="http://www.ietf.org/ipr">http://www.ietf.org/ipr</a>.
990         </p>
991         <p>The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary
992            rights that may cover technology that may be required to implement this standard. Please address the information to the IETF
993            at <a href="mailto:ietf-ipr@ietf.org">ietf-ipr@ietf.org</a>.
994         </p>
995      </div>
996   </body>
997</html>
Note: See TracBrowser for help on using the repository browser.