Changeset 2153 for draft-ietf-httpbis/latest
- Timestamp:
- 23/01/13 12:27:35 (10 years ago)
- Location:
- draft-ietf-httpbis/latest
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
draft-ietf-httpbis/latest/p5-range.html
r2152 r2153 780 780 <div id="rfc.iref.20"></div> 781 781 <h2 id="rfc.section.4.1"><a href="#rfc.section.4.1">4.1</a> <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 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 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 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: 786 787 </p> 787 788 <div id="rfc.figure.u.17"></div><pre class="text">HTTP/1.1 206 Partial Content … … 791 792 Content-Length: 26012 792 793 Content-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 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 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 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 799 Date: Wed, 15 Nov 1995 06:25:24 GMT 800 Last-Modified: Wed, 15 Nov 1995 04:58:08 GMT 801 Content-Length: 1741 802 Content-Type: multipart/byteranges; boundary=THIS_STRING_SEPARATES 803 804 --THIS_STRING_SEPARATES 805 Content-Type: application/pdf 806 Content-Range: bytes 500-999/8000 807 808 ...the first range... 809 --THIS_STRING_SEPARATES 810 Content-Type: application/pdf 811 Content-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 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: 804 822 </p> 805 823 <ul> … … 811 829 </li> 812 830 </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.1 0">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. 816 834 </p> 817 835 <div id="rfc.iref.c.1"></div> … … 820 838 enclosed as payload. 821 839 </p> 822 <div id="rfc.figure.u.1 8"></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> 823 841 / <a href="#header.content-range" class="smpl">other-content-range</a> 824 842 … … 846 864 selected representation is known by the sender to be 1234 bytes: 847 865 </p> 848 <div id="rfc.figure.u. 19"></div><pre class="text"> Content-Range: bytes 42-1233/1234866 <div id="rfc.figure.u.20"></div><pre class="text"> Content-Range: bytes 42-1233/1234 849 867 </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.2 0"></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/* 851 869 </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: 852 870 </p> 853 <div id="rfc.figure.u.2 1"></div><pre class="text"> Content-Range: bytes */1234871 <div id="rfc.figure.u.22"></div><pre class="text"> Content-Range: bytes */1234 854 872 </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 855 873 the server generating the response because that is how it determined the range to be unsatisfiable. … … 861 879 <ul> 862 880 <li>The first 500 bytes: 863 <div id="rfc.figure.u.2 2"></div><pre class="text"> Content-Range: bytes 0-499/1234881 <div id="rfc.figure.u.23"></div><pre class="text"> Content-Range: bytes 0-499/1234 864 882 </pre> </li> 865 883 <li>The second 500 bytes: 866 <div id="rfc.figure.u.2 3"></div><pre class="text"> Content-Range: bytes 500-999/1234884 <div id="rfc.figure.u.24"></div><pre class="text"> Content-Range: bytes 500-999/1234 867 885 </pre> </li> 868 886 <li>All except for the first 500 bytes: 869 <div id="rfc.figure.u.2 4"></div><pre class="text"> Content-Range: bytes 500-1233/1234887 <div id="rfc.figure.u.25"></div><pre class="text"> Content-Range: bytes 500-1233/1234 870 888 </pre> </li> 871 889 <li>The last 500 bytes: 872 <div id="rfc.figure.u.2 5"></div><pre class="text"> Content-Range: bytes 734-1233/1234890 <div id="rfc.figure.u.26"></div><pre class="text"> Content-Range: bytes 734-1233/1234 873 891 </pre> </li> 874 892 </ul> … … 894 912 <div id="rfc.iref.29"></div> 895 913 <h2 id="rfc.section.4.4"><a href="#rfc.section.4.4">4.4</a> <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 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 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 current914 <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 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 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 897 915 length of the selected representation.) 898 916 </p> 899 917 <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 4.2</a>). 900 918 </p> 901 <div id="rfc.figure.u.2 6"></div>919 <div id="rfc.figure.u.27"></div> 902 920 <p>For example:</p> <pre class="text">HTTP/1.1 416 Range Not Satisfiable 903 921 Date: Mon, 20 Jan 2012 15:41:54 GMT … … 931 949 <thead> 932 950 <tr> 933 <th>Range SpecifierName</th>951 <th>Range Unit Name</th> 934 952 <th>Description</th> 935 953 <th>Reference</th> … … 1013 1031 <td class="left">http</td> 1014 1032 <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 3.2</a>1033 <td class="left"> <a href="#header.if-range" id="rfc.xref.header.if-range.3" title="If-Range">Section 3.2</a> 1016 1034 </td> 1017 1035 </tr> … … 1118 1136 <div id="rfc.iref.m.2"></div> 1119 1137 <h1 id="rfc.section.A" class="np"><a href="#rfc.section.A">A.</a> <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. 1124 1141 </p> 1125 1142 <p id="rfc.section.A.p.3"> </p> … … 1164 1181 <dd>IESG</dd> 1165 1182 </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> 1207 1184 <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> 1210 1186 <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. 1211 1187 </li> 1212 <li>A number of clients and servers were coded to an early draft of the byteranges specification t o 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. 1213 1189 </li> 1214 1190 </ol> 1215 <h1 id="rfc.section.B"><a href="#rfc.section.B">B.</a> <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 1195 Date: Tue, 14 Nov 1995 06:25:24 GMT 1196 Last-Modified: Tue, 14 July 04:58:08 GMT 1197 Content-Length: 2331785 1198 Content-Type: multipart/byteranges; boundary=THIS_STRING_SEPARATES 1199 1200 --THIS_STRING_SEPARATES 1201 Content-Type: video/example 1202 Content-Range: exampleunit 1.2-4.3/25 1203 1204 ...the first range... 1205 --THIS_STRING_SEPARATES 1206 Content-Type: video/example 1207 Content-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> <a id="changes.from.rfc.2616" href="#changes.from.rfc.2616">Changes from RFC 2616</a></h1> 1216 1212 <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 4.1</a>) 1217 1213 </p> … … 1223 1219 <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 A</a>) 1224 1220 </p> 1225 <p id="rfc.section.B.p.5">This specification introduces a Range SpecifierRegistry. (<a href="#range.unit.registry" title="Range Unit Registry">Section 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 5.1</a>) 1226 1222 </p> 1227 1223 <h1 id="rfc.section.C"><a href="#rfc.section.C">C.</a> <a id="imported.abnf" href="#imported.abnf">Imported ABNF</a></h1> … … 1369 1365 </li> 1370 1366 <li><a id="rfc.index.I" href="#rfc.index.I"><b>I</b></a><ul> 1371 <li>If-Range header field <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 <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> 1372 1368 </ul> 1373 1369 </li> -
draft-ietf-httpbis/latest/p5-range.xml
r2152 r2153 487 487 <t> 488 488 The <x:dfn>206 (Partial Content)</x:dfn> status code indicates that the 489 server has fulfilled the partial GET request for the resource. 490 The request &MUST; have included a <x:ref>Range</x:ref> header field 491 (<xref target="header.range"/>) indicating the desired range, and &MAY; have 492 included an <x:ref>If-Range</x:ref> header field 493 (<xref target="header.if-range"/>) to make the request conditional. 494 </t> 495 <t> 496 When an HTTP message includes the content of a single range (for 497 example, a response to a request for a single range, or to a request 498 for a set of ranges that overlap without any holes), this content is 499 transmitted with a <x:ref>Content-Range</x:ref> header field, and a 500 <x:ref>Content-Length</x:ref> header field showing the number of bytes 501 actually transferred. For example, 489 server is successfully fulfilling a range request for the target resource 490 by transferring one or more parts of the selected representation that 491 correspond to the satisfiable ranges found in the requests's 492 <x:ref>Range</x:ref> header field (<xref target="header.range"/>). 493 </t> 494 <t> 495 If a single part is being transferred, the server generating the 206 496 response &MUST; generate a <x:ref>Content-Range</x:ref> header field, 497 describing what range of the selected representation is enclosed, and a 498 payload consisting of the range. For example: 502 499 </t> 503 500 <figure><artwork type="message/http; msgtype="response"" x:indent-with=" "> … … 508 505 Content-Length: 26012 509 506 Content-Type: image/gif 510 </artwork></figure> 511 <t> 512 When an HTTP message includes the content of multiple ranges (for 513 example, a response to a request for multiple non-overlapping 514 ranges), these are transmitted as a multipart message. The multipart 515 media type used for this purpose is "multipart/byteranges" as defined 516 in <xref target="internet.media.type.multipart.byteranges"/>. 517 </t> 507 508 ... 26012 bytes of image data ... 509 </artwork></figure> 510 <t> 511 If multiple parts are being transferred, the server generating the 206 512 response &MUST; generate a "multipart/byteranges" payload, as defined 513 in <xref target="internet.media.type.multipart.byteranges"/>, and send a 514 <x:ref>Content-Type</x:ref> header field containing the 515 "multipart/byteranges" media type and its required boundary parameter. 516 For example: 517 </t> 518 <figure><preamble> 519 </preamble><artwork type="message/http; msgtype="response"" x:indent-with=" "> 520 HTTP/1.1 206 Partial Content 521 Date: Wed, 15 Nov 1995 06:25:24 GMT 522 Last-Modified: Wed, 15 Nov 1995 04:58:08 GMT 523 Content-Length: 1741 524 Content-Type: multipart/byteranges; boundary=THIS_STRING_SEPARATES 525 526 --THIS_STRING_SEPARATES 527 Content-Type: application/pdf 528 Content-Range: bytes 500-999/8000 529 530 ...the first range... 531 --THIS_STRING_SEPARATES 532 Content-Type: application/pdf 533 Content-Range: bytes 7000-7999/8000 534 535 ...the second range 536 --THIS_STRING_SEPARATES-- 537 </artwork></figure> 518 538 <t> 519 539 A server &MAY; combine requested ranges when those ranges are overlapping … … 818 838 </t> 819 839 <texttable align="left" suppress-title="true" anchor="iana.range.units.table"> 820 <ttcol>Range SpecifierName</ttcol>840 <ttcol>Range Unit Name</ttcol> 821 841 <ttcol>Description</ttcol> 822 842 <ttcol>Reference</ttcol> … … 1183 1203 <iref item="multipart/byteranges Media Type" primary="true"/> 1184 1204 <t> 1185 When a n HTTP<x:ref>206 (Partial Content)</x:ref> response message includes the1186 content of multiple ranges (a response to a request for multiple1187 non-overlapping ranges), these are transmitted as a multipart1188 message body (<xref target="RFC2046" x:fmt="," x:sec="5.1"/>). The media type for this purpose is called1189 "multipart/byteranges". The following isto be registered with IANA <xref target="BCP13"/>.1190 </t> 1191 <t> 1192 The multipart/byteranges media type includes one or more parts, each1205 When a <x:ref>206 (Partial Content)</x:ref> response message includes the 1206 content of multiple ranges, they are transmitted as body-parts in a 1207 multipart message body (<xref target="RFC2046" x:fmt="," x:sec="5.1"/>) 1208 with the media type of "multipart/byteranges". The following definition is 1209 to be registered with IANA <xref target="BCP13"/>. 1210 </t> 1211 <t> 1212 The multipart/byteranges media type includes one or more body-parts, each 1193 1213 with its own <x:ref>Content-Type</x:ref> and <x:ref>Content-Range</x:ref> 1194 1214 fields. The required boundary parameter specifies the boundary string used … … 1245 1265 </list> 1246 1266 </t> 1247 <x:note> 1248 <t> 1249 &Note; Despite the name "multipart/byteranges" is not limited to the byte ranges only. 1250 </t> 1251 </x:note> 1252 <figure><preamble> 1253 For example: 1254 </preamble><artwork type="example"> 1255 HTTP/1.1 206 Partial Content 1256 Date: Wed, 15 Nov 1995 06:25:24 GMT 1257 Last-Modified: Wed, 15 Nov 1995 04:58:08 GMT 1258 Content-Length: 1741 1259 Content-Type: multipart/byteranges; boundary=THIS_STRING_SEPARATES 1260 1261 --THIS_STRING_SEPARATES 1262 Content-Type: application/pdf 1263 Content-Range: bytes 500-999/8000 1264 1265 ...the first range... 1266 --THIS_STRING_SEPARATES 1267 Content-Type: application/pdf 1268 Content-Range: bytes 7000-7999/8000 1269 1270 ...the second range 1271 --THIS_STRING_SEPARATES-- 1272 </artwork></figure> 1273 <figure><preamble> 1274 Another example, using the "exampleunit" range unit: 1275 </preamble> 1276 <artwork type="example"> 1277 HTTP/1.1 206 Partial Content 1278 Date: Tue, 14 Nov 1995 06:25:24 GMT 1279 Last-Modified: Tue, 14 July 04:58:08 GMT 1280 Content-Length: 2331785 1281 Content-Type: multipart/byteranges; boundary=THIS_STRING_SEPARATES 1282 1283 --THIS_STRING_SEPARATES 1284 Content-Type: video/example 1285 Content-Range: exampleunit 1.2-4.3/25 1286 1287 ...the first range... 1288 --THIS_STRING_SEPARATES 1289 Content-Type: video/example 1290 Content-Range: exampleunit 11.2-14.3/25 1291 1292 ...the second range 1293 --THIS_STRING_SEPARATES-- 1294 </artwork> 1295 </figure> 1296 <t> 1297 Notes: 1267 <t> 1268 Implementation Notes: 1298 1269 <list style="numbers"> 1299 <t>Additional CRLFs &MAY;precede the first boundary string in the body.</t>1270 <t>Additional CRLFs might precede the first boundary string in the body.</t> 1300 1271 1301 1272 <t>Although <xref target="RFC2046"/> permits the boundary string to be … … 1304 1275 1305 1276 <t>A number of clients and servers were coded to an early draft 1306 of the byteranges specification t o usea media type of1307 multipart/x-byteranges<iref item="multipart/x-byteranges Media Type"/><iref item="Media Type" subitem="multipart/x-byteranges"/>, which is almost, but not quite1308 compatible with the version documented in HTTP/1.1.</t>1277 of the byteranges specification that used a media type of 1278 multipart/x-byteranges<iref item="multipart/x-byteranges Media Type"/><iref item="Media Type" subitem="multipart/x-byteranges"/>, 1279 which is almost (but not quite) compatible with this type.</t> 1309 1280 </list> 1310 1281 </t> 1282 <t> 1283 Despite the name, the "multipart/byteranges" media type is not limited to 1284 byte ranges. The following example uses an "exampleunit" range unit: 1285 </t> 1286 <figure><artwork type="message/http; msgtype="response"" x:indent-with=" "> 1287 HTTP/1.1 206 Partial Content 1288 Date: Tue, 14 Nov 1995 06:25:24 GMT 1289 Last-Modified: Tue, 14 July 04:58:08 GMT 1290 Content-Length: 2331785 1291 Content-Type: multipart/byteranges; boundary=THIS_STRING_SEPARATES 1292 1293 --THIS_STRING_SEPARATES 1294 Content-Type: video/example 1295 Content-Range: exampleunit 1.2-4.3/25 1296 1297 ...the first range... 1298 --THIS_STRING_SEPARATES 1299 Content-Type: video/example 1300 Content-Range: exampleunit 11.2-14.3/25 1301 1302 ...the second range 1303 --THIS_STRING_SEPARATES-- 1304 </artwork> 1305 </figure> 1311 1306 </section> 1312 1307 … … 1331 1326 </t> 1332 1327 <t> 1333 This specification introduces a Range SpecifierRegistry.1328 This specification introduces a Range Unit Registry. 1334 1329 (<xref target="range.unit.registry"/>) 1335 1330 </t>
Note: See TracChangeset
for help on using the changeset viewer.