Ignore:
Timestamp:
23/01/13 12:27:35 (7 years ago)
Author:
fielding@…
Message:

(editorial) more cleanup in p5

File:
1 edited

Legend:

Unmodified
Added
Removed
  • draft-ietf-httpbis/latest/p5-range.html

    r2152 r2153  
    780780      <div id="rfc.iref.20"></div>
    781781      <h2 id="rfc.section.4.1"><a href="#rfc.section.4.1">4.1</a>&nbsp;<a id="status.206" href="#status.206">206 Partial Content</a></h2>
    782       <p id="rfc.section.4.1.p.1">The <dfn>206 (Partial Content)</dfn> status code indicates that the server has fulfilled the partial GET request for the resource. The request <em class="bcp14">MUST</em> have included a <a href="#header.range" class="smpl">Range</a> header field (<a href="#header.range" id="rfc.xref.header.range.2" title="Range">Section&nbsp;3.1</a>) indicating the desired range, and <em class="bcp14">MAY</em> have included an <a href="#header.if-range" class="smpl">If-Range</a> header field (<a href="#header.if-range" id="rfc.xref.header.if-range.2" title="If-Range">Section&nbsp;3.2</a>) to make the request conditional.
    783       </p>
    784       <p id="rfc.section.4.1.p.2">When an HTTP message includes the content of a single range (for example, a response to a request for a single range, or to
    785          a request for a set of ranges that overlap without any holes), this content is transmitted with a <a href="#header.content-range" class="smpl">Content-Range</a> header field, and a <a href="p1-messaging.html#header.content-length" class="smpl">Content-Length</a> header field showing the number of bytes actually transferred. For example,
     782      <p id="rfc.section.4.1.p.1">The <dfn>206 (Partial Content)</dfn> status code indicates that the server is successfully fulfilling a range request for the target resource by transferring one
     783         or more parts of the selected representation that correspond to the satisfiable ranges found in the requests's <a href="#header.range" class="smpl">Range</a> header field (<a href="#header.range" id="rfc.xref.header.range.2" title="Range">Section&nbsp;3.1</a>).
     784      </p>
     785      <p id="rfc.section.4.1.p.2">If a single part is being transferred, the server generating the 206 response <em class="bcp14">MUST</em> generate a <a href="#header.content-range" class="smpl">Content-Range</a> header field, describing what range of the selected representation is enclosed, and a payload consisting of the range. For
     786         example:
    786787      </p>
    787788      <div id="rfc.figure.u.17"></div><pre class="text">HTTP/1.1 206 Partial Content
     
    791792Content-Length: 26012
    792793Content-Type: image/gif
    793 </pre><p id="rfc.section.4.1.p.4">When an HTTP message includes the content of multiple ranges (for example, a response to a request for multiple non-overlapping
    794          ranges), these are transmitted as a multipart message. The multipart media type used for this purpose is "multipart/byteranges"
    795          as defined in <a href="#internet.media.type.multipart.byteranges" title="Internet Media Type multipart/byteranges">Appendix&nbsp;A</a>.
    796       </p>
    797       <p id="rfc.section.4.1.p.5">A server <em class="bcp14">MAY</em> combine requested ranges when those ranges are overlapping (see <a href="#overlapping.ranges" title="Overlapping Ranges">Section&nbsp;6.1</a>).
    798       </p>
    799       <p id="rfc.section.4.1.p.6">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 ranges in a single request.
    800       </p>
    801       <p id="rfc.section.4.1.p.7">When a client asks for multiple ranges in one request, the server <em class="bcp14">SHOULD</em> send them in the order that they appeared in the request.
    802       </p>
    803       <p id="rfc.section.4.1.p.8">When a 206 response is generated, the sender <em class="bcp14">MUST</em> generate the following header fields:
     794
     795... 26012 bytes of image data ...
     796</pre><p id="rfc.section.4.1.p.4">If multiple parts are being transferred, the server generating the 206 response <em class="bcp14">MUST</em> generate a "multipart/byteranges" payload, as defined in <a href="#internet.media.type.multipart.byteranges" title="Internet Media Type multipart/byteranges">Appendix&nbsp;A</a>, and send a <a href="p2-semantics.html#header.content-type" class="smpl">Content-Type</a> header field containing the "multipart/byteranges" media type and its required boundary parameter. For example:
     797      </p>
     798      <div id="rfc.figure.u.18"></div><pre class="text">HTTP/1.1 206 Partial Content
     799Date: Wed, 15 Nov 1995 06:25:24 GMT
     800Last-Modified: Wed, 15 Nov 1995 04:58:08 GMT
     801Content-Length: 1741
     802Content-Type: multipart/byteranges; boundary=THIS_STRING_SEPARATES
     803
     804--THIS_STRING_SEPARATES
     805Content-Type: application/pdf
     806Content-Range: bytes 500-999/8000
     807
     808...the first range...
     809--THIS_STRING_SEPARATES
     810Content-Type: application/pdf
     811Content-Range: bytes 7000-7999/8000
     812
     813...the second range
     814--THIS_STRING_SEPARATES--
     815</pre><p id="rfc.section.4.1.p.6">A server <em class="bcp14">MAY</em> combine requested ranges when those ranges are overlapping (see <a href="#overlapping.ranges" title="Overlapping Ranges">Section&nbsp;6.1</a>).
     816      </p>
     817      <p id="rfc.section.4.1.p.7">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 ranges in a single request.
     818      </p>
     819      <p id="rfc.section.4.1.p.8">When a client asks for multiple ranges in one request, the server <em class="bcp14">SHOULD</em> send them in the order that they appeared in the request.
     820      </p>
     821      <p id="rfc.section.4.1.p.9">When a 206 response is generated, the sender <em class="bcp14">MUST</em> generate the following header fields:
    804822      </p>
    805823      <ul>
     
    811829         </li>
    812830      </ul>
    813       <p id="rfc.section.4.1.p.9">If a 206 is generated in response to a request with an <a href="#header.if-range" class="smpl">If-Range</a> header field, the sender <em class="bcp14">SHOULD NOT</em> generate other representation header fields beyond those described above. Otherwise, the sender <em class="bcp14">MUST</em> generate all of the same representation header fields that would have been sent in a <a href="p2-semantics.html#status.200" class="smpl">200 (OK)</a> response to the same request.
    814       </p>
    815       <p id="rfc.section.4.1.p.10">Caches <em class="bcp14">MAY</em> use a heuristic (see <a href="p6-cache.html#heuristic.freshness" title="Calculating Heuristic Freshness">Section 4.1.2</a> of <a href="#Part6" id="rfc.xref.Part6.1"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Caching">[Part6]</cite></a>) to determine freshness for 206 responses.
     831      <p id="rfc.section.4.1.p.10">If a 206 is generated in response to a request with an <a href="#header.if-range" class="smpl">If-Range</a> header field, the sender <em class="bcp14">SHOULD NOT</em> generate other representation header fields beyond those described above. Otherwise, the sender <em class="bcp14">MUST</em> generate all of the same representation header fields that would have been sent in a <a href="p2-semantics.html#status.200" class="smpl">200 (OK)</a> response to the same request.
     832      </p>
     833      <p id="rfc.section.4.1.p.11">Caches <em class="bcp14">MAY</em> use a heuristic (see <a href="p6-cache.html#heuristic.freshness" title="Calculating Heuristic Freshness">Section 4.1.2</a> of <a href="#Part6" id="rfc.xref.Part6.1"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Caching">[Part6]</cite></a>) to determine freshness for 206 responses.
    816834      </p>
    817835      <div id="rfc.iref.c.1"></div>
     
    820838         enclosed as payload.
    821839      </p>
    822       <div id="rfc.figure.u.18"></div><pre class="inline"><span id="rfc.iref.g.18"></span><span id="rfc.iref.g.19"></span><span id="rfc.iref.g.20"></span><span id="rfc.iref.g.21"></span><span id="rfc.iref.g.22"></span><span id="rfc.iref.g.23"></span><span id="rfc.iref.g.24"></span><span id="rfc.iref.g.25"></span>  <a href="#header.content-range" class="smpl">Content-Range</a>       = <a href="#header.content-range" class="smpl">byte-content-range</a>
     840      <div id="rfc.figure.u.19"></div><pre class="inline"><span id="rfc.iref.g.18"></span><span id="rfc.iref.g.19"></span><span id="rfc.iref.g.20"></span><span id="rfc.iref.g.21"></span><span id="rfc.iref.g.22"></span><span id="rfc.iref.g.23"></span><span id="rfc.iref.g.24"></span><span id="rfc.iref.g.25"></span>  <a href="#header.content-range" class="smpl">Content-Range</a>       = <a href="#header.content-range" class="smpl">byte-content-range</a>
    823841                      / <a href="#header.content-range" class="smpl">other-content-range</a>
    824842                         
     
    846864         selected representation is known by the sender to be 1234 bytes:
    847865      </p>
    848       <div id="rfc.figure.u.19"></div><pre class="text">  Content-Range: bytes 42-1233/1234
     866      <div id="rfc.figure.u.20"></div><pre class="text">  Content-Range: bytes 42-1233/1234
    849867</pre><p id="rfc.section.4.2.p.8">or this second example would apply when the complete length is unknown:</p>
    850       <div id="rfc.figure.u.20"></div><pre class="text">  Content-Range: bytes 42-1233/*
     868      <div id="rfc.figure.u.21"></div><pre class="text">  Content-Range: bytes 42-1233/*
    851869</pre><p id="rfc.section.4.2.p.10">A server generating a <a href="#status.416" class="smpl">416 (Range Not Satisfiable)</a> response to a byte range request <em class="bcp14">SHOULD</em> send a Content-Range header field with an <a href="#header.content-range" class="smpl">unsatisfied-range</a> value, as in the following example:
    852870      </p>
    853       <div id="rfc.figure.u.21"></div><pre class="text">  Content-Range: bytes */1234
     871      <div id="rfc.figure.u.22"></div><pre class="text">  Content-Range: bytes */1234
    854872</pre><p id="rfc.section.4.2.p.12">The complete-length in a 416 response indicates the current length of the selected representation, which will be known by
    855873         the server generating the response because that is how it determined the range to be unsatisfiable.
     
    861879      <ul>
    862880         <li>The first 500 bytes:
    863             <div id="rfc.figure.u.22"></div><pre class="text">  Content-Range: bytes 0-499/1234
     881            <div id="rfc.figure.u.23"></div><pre class="text">  Content-Range: bytes 0-499/1234
    864882</pre> </li>
    865883         <li>The second 500 bytes:
    866             <div id="rfc.figure.u.23"></div><pre class="text">  Content-Range: bytes 500-999/1234
     884            <div id="rfc.figure.u.24"></div><pre class="text">  Content-Range: bytes 500-999/1234
    867885</pre> </li>
    868886         <li>All except for the first 500 bytes:
    869             <div id="rfc.figure.u.24"></div><pre class="text">  Content-Range: bytes 500-1233/1234
     887            <div id="rfc.figure.u.25"></div><pre class="text">  Content-Range: bytes 500-1233/1234
    870888</pre> </li>
    871889         <li>The last 500 bytes:
    872             <div id="rfc.figure.u.25"></div><pre class="text">  Content-Range: bytes 734-1233/1234
     890            <div id="rfc.figure.u.26"></div><pre class="text">  Content-Range: bytes 734-1233/1234
    873891</pre> </li>
    874892      </ul>
     
    894912      <div id="rfc.iref.29"></div>
    895913      <h2 id="rfc.section.4.4"><a href="#rfc.section.4.4">4.4</a>&nbsp;<a id="status.416" href="#status.416">416 Range Not Satisfiable</a></h2>
    896       <p id="rfc.section.4.4.p.1">The <dfn>416 (Range Not Satisfiable)</dfn> status code indicates that none of the ranges-specifier values in the request's <a href="#header.range" class="smpl">Range</a> header field (<a href="#header.range" id="rfc.xref.header.range.3" title="Range">Section&nbsp;3.1</a>) overlap the current extent of the selected resource and the request did not include an <a href="#header.if-range" class="smpl">If-Range</a> header field (<a href="#header.if-range" id="rfc.xref.header.if-range.3" title="If-Range">Section&nbsp;3.2</a>). (For byte-ranges, this means that the first-byte-pos of all of the byte-range-spec values were greater than the current
     914      <p id="rfc.section.4.4.p.1">The <dfn>416 (Range Not Satisfiable)</dfn> status code indicates that none of the ranges-specifier values in the request's <a href="#header.range" class="smpl">Range</a> header field (<a href="#header.range" id="rfc.xref.header.range.3" title="Range">Section&nbsp;3.1</a>) overlap the current extent of the selected resource and the request did not include an <a href="#header.if-range" class="smpl">If-Range</a> header field (<a href="#header.if-range" id="rfc.xref.header.if-range.2" title="If-Range">Section&nbsp;3.2</a>). (For byte-ranges, this means that the first-byte-pos of all of the byte-range-spec values were greater than the current
    897915         length of the selected representation.)
    898916      </p>
    899917      <p id="rfc.section.4.4.p.2">When this status code is sent in response to a byte-range request, the sender <em class="bcp14">SHOULD</em> generate a <a href="#header.content-range" class="smpl">Content-Range</a> header field specifying the current length of the selected representation (see <a href="#header.content-range" id="rfc.xref.header.content-range.3" title="Content-Range">Section&nbsp;4.2</a>).
    900918      </p>
    901       <div id="rfc.figure.u.26"></div>
     919      <div id="rfc.figure.u.27"></div>
    902920      <p>For example:</p>  <pre class="text">HTTP/1.1 416 Range Not Satisfiable
    903921Date: Mon, 20 Jan 2012 15:41:54 GMT
     
    931949            <thead>
    932950               <tr>
    933                   <th>Range Specifier Name</th>
     951                  <th>Range Unit Name</th>
    934952                  <th>Description</th>
    935953                  <th>Reference</th>
     
    10131031                  <td class="left">http</td>
    10141032                  <td class="left">standard</td>
    1015                   <td class="left"> <a href="#header.if-range" id="rfc.xref.header.if-range.4" title="If-Range">Section&nbsp;3.2</a>
     1033                  <td class="left"> <a href="#header.if-range" id="rfc.xref.header.if-range.3" title="If-Range">Section&nbsp;3.2</a>
    10161034                  </td>
    10171035               </tr>
     
    11181136      <div id="rfc.iref.m.2"></div>
    11191137      <h1 id="rfc.section.A" class="np"><a href="#rfc.section.A">A.</a>&nbsp;<a id="internet.media.type.multipart.byteranges" href="#internet.media.type.multipart.byteranges">Internet Media Type multipart/byteranges</a></h1>
    1120       <p id="rfc.section.A.p.1">When an HTTP <a href="#status.206" class="smpl">206 (Partial Content)</a> response message includes the content of multiple ranges (a response to a request for multiple non-overlapping ranges), these
    1121          are transmitted as a multipart message body (<a href="#RFC2046" id="rfc.xref.RFC2046.1"><cite title="Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types">[RFC2046]</cite></a>, <a href="http://tools.ietf.org/html/rfc2046#section-5.1">Section 5.1</a>). The media type for this purpose is called "multipart/byteranges". The following is to be registered with IANA <a href="#BCP13" id="rfc.xref.BCP13.1"><cite title="Media Type Specifications and Registration Procedures">[BCP13]</cite></a>.
    1122       </p>
    1123       <p id="rfc.section.A.p.2">The multipart/byteranges media type includes one or more parts, each with its own <a href="p2-semantics.html#header.content-type" class="smpl">Content-Type</a> and <a href="#header.content-range" class="smpl">Content-Range</a> fields. The required boundary parameter specifies the boundary string used to separate each body-part.
     1138      <p id="rfc.section.A.p.1">When a <a href="#status.206" class="smpl">206 (Partial Content)</a> response message includes the content of multiple ranges, they are transmitted as body-parts in a multipart message body (<a href="#RFC2046" id="rfc.xref.RFC2046.1"><cite title="Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types">[RFC2046]</cite></a>, <a href="http://tools.ietf.org/html/rfc2046#section-5.1">Section 5.1</a>) with the media type of "multipart/byteranges". The following definition is to be registered with IANA <a href="#BCP13" id="rfc.xref.BCP13.1"><cite title="Media Type Specifications and Registration Procedures">[BCP13]</cite></a>.
     1139      </p>
     1140      <p id="rfc.section.A.p.2">The multipart/byteranges media type includes one or more body-parts, each with its own <a href="p2-semantics.html#header.content-type" class="smpl">Content-Type</a> and <a href="#header.content-range" class="smpl">Content-Range</a> fields. The required boundary parameter specifies the boundary string used to separate each body-part.
    11241141      </p>
    11251142      <p id="rfc.section.A.p.3"> </p>
     
    11641181         <dd>IESG</dd>
    11651182      </dl>
    1166       <div class="note" id="rfc.section.A.p.4">
    1167          <p> <b>Note:</b> Despite the name "multipart/byteranges" is not limited to the byte ranges only.
    1168          </p>
    1169       </div>
    1170       <div id="rfc.figure.u.27"></div>
    1171       <p>For example:</p><pre class="text">  HTTP/1.1 206 Partial Content
    1172   Date: Wed, 15 Nov 1995 06:25:24 GMT
    1173   Last-Modified: Wed, 15 Nov 1995 04:58:08 GMT
    1174   Content-Length: 1741
    1175   Content-Type: multipart/byteranges; boundary=THIS_STRING_SEPARATES
    1176  
    1177   --THIS_STRING_SEPARATES
    1178   Content-Type: application/pdf
    1179   Content-Range: bytes 500-999/8000
    1180  
    1181   ...the first range...
    1182   --THIS_STRING_SEPARATES
    1183   Content-Type: application/pdf
    1184   Content-Range: bytes 7000-7999/8000
    1185  
    1186   ...the second range
    1187   --THIS_STRING_SEPARATES--
    1188 </pre><div id="rfc.figure.u.28"></div>
    1189       <p>Another example, using the "exampleunit" range unit:</p>  <pre class="text">  HTTP/1.1 206 Partial Content
    1190   Date: Tue, 14 Nov 1995 06:25:24 GMT
    1191   Last-Modified: Tue, 14 July 04:58:08 GMT
    1192   Content-Length: 2331785
    1193   Content-Type: multipart/byteranges; boundary=THIS_STRING_SEPARATES
    1194  
    1195   --THIS_STRING_SEPARATES
    1196   Content-Type: video/example
    1197   Content-Range: exampleunit 1.2-4.3/25
    1198  
    1199   ...the first range...
    1200   --THIS_STRING_SEPARATES
    1201   Content-Type: video/example
    1202   Content-Range: exampleunit 11.2-14.3/25
    1203  
    1204   ...the second range
    1205   --THIS_STRING_SEPARATES--
    1206 </pre> <p id="rfc.section.A.p.7">Notes: </p>
     1183      <p id="rfc.section.A.p.4">Implementation Notes: </p>
    12071184      <ol>
    1208          <li>Additional CRLFs <em class="bcp14">MAY</em> precede the first boundary string in the body.
    1209          </li>
     1185         <li>Additional CRLFs might precede the first boundary string in the body.</li>
    12101186         <li>Although <a href="#RFC2046" id="rfc.xref.RFC2046.2"><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.
    12111187         </li>
    1212          <li>A number of clients 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.
     1188         <li>A number of clients and servers were coded to an early draft of the byteranges specification that used 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 this type.
    12131189         </li>
    12141190      </ol>
    1215       <h1 id="rfc.section.B"><a href="#rfc.section.B">B.</a>&nbsp;<a id="changes.from.rfc.2616" href="#changes.from.rfc.2616">Changes from RFC 2616</a></h1>
     1191      <p id="rfc.section.A.p.5">Despite the name, the "multipart/byteranges" media type is not limited to byte ranges. The following example uses an "exampleunit"
     1192         range unit:
     1193      </p>
     1194      <div id="rfc.figure.u.28"></div><pre class="text">HTTP/1.1 206 Partial Content
     1195Date: Tue, 14 Nov 1995 06:25:24 GMT
     1196Last-Modified: Tue, 14 July 04:58:08 GMT
     1197Content-Length: 2331785
     1198Content-Type: multipart/byteranges; boundary=THIS_STRING_SEPARATES
     1199
     1200--THIS_STRING_SEPARATES
     1201Content-Type: video/example
     1202Content-Range: exampleunit 1.2-4.3/25
     1203
     1204...the first range...
     1205--THIS_STRING_SEPARATES
     1206Content-Type: video/example
     1207Content-Range: exampleunit 11.2-14.3/25
     1208
     1209...the second range
     1210--THIS_STRING_SEPARATES--
     1211</pre> <h1 id="rfc.section.B"><a href="#rfc.section.B">B.</a>&nbsp;<a id="changes.from.rfc.2616" href="#changes.from.rfc.2616">Changes from RFC 2616</a></h1>
    12161212      <p id="rfc.section.B.p.1">A weak validator cannot be used in a <a href="#status.206" class="smpl">206</a> response. (<a href="#status.206" id="rfc.xref.status.206.2" title="206 Partial Content">Section&nbsp;4.1</a>)
    12171213      </p>
     
    12231219      <p id="rfc.section.B.p.4">multipart/byteranges can consist of a single part. (<a href="#internet.media.type.multipart.byteranges" title="Internet Media Type multipart/byteranges">Appendix&nbsp;A</a>)
    12241220      </p>
    1225       <p id="rfc.section.B.p.5">This specification introduces a Range Specifier Registry. (<a href="#range.unit.registry" title="Range Unit Registry">Section&nbsp;5.1</a>)
     1221      <p id="rfc.section.B.p.5">This specification introduces a Range Unit Registry. (<a href="#range.unit.registry" title="Range Unit Registry">Section&nbsp;5.1</a>)
    12261222      </p>
    12271223      <h1 id="rfc.section.C"><a href="#rfc.section.C">C.</a>&nbsp;<a id="imported.abnf" href="#imported.abnf">Imported ABNF</a></h1>
     
    13691365            </li>
    13701366            <li><a id="rfc.index.I" href="#rfc.index.I"><b>I</b></a><ul>
    1371                   <li>If-Range header field&nbsp;&nbsp;<a href="#rfc.xref.header.if-range.1">3.1</a>, <a href="#rfc.iref.i.1"><b>3.2</b></a>, <a href="#rfc.xref.header.if-range.2">4.1</a>, <a href="#rfc.xref.header.if-range.3">4.4</a>, <a href="#rfc.xref.header.if-range.4">5.3</a></li>
     1367                  <li>If-Range header field&nbsp;&nbsp;<a href="#rfc.xref.header.if-range.1">3.1</a>, <a href="#rfc.iref.i.1"><b>3.2</b></a>, <a href="#rfc.xref.header.if-range.2">4.4</a>, <a href="#rfc.xref.header.if-range.3">5.3</a></li>
    13721368               </ul>
    13731369            </li>
Note: See TracChangeset for help on using the changeset viewer.