Changeset 2135 for draft-ietf-httpbis/latest
- Timestamp:
- 20/01/13 01:58:48 (10 years ago)
- Location:
- draft-ietf-httpbis/latest
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
draft-ietf-httpbis/latest/httpbis.abnf
r2083 r2135 18 18 Content-Length = 1*DIGIT 19 19 Content-Location = absolute-URI / partial-URI 20 Content-Range = byte-content-range -spec / other-content-range-spec20 Content-Range = byte-content-range / other-content-range 21 21 Content-Type = media-type 22 22 Date = HTTP-date … … 73 73 authority = <authority, defined in [RFC3986], Section 3.2> 74 74 authority-form = authority 75 byte-content-range-spec = bytes-unit SP byte-range-resp-spec "/" ( instance-length / "*" ) 76 byte-range-resp-spec = ( first-byte-pos "-" last-byte-pos ) / "*" 75 byte-content-range = bytes-unit SP ( byte-range-resp "/" unsatisfied-range ) 76 byte-range = first-byte-pos "-" last-byte-pos 77 byte-range-resp = byte-range "/" ( complete-length / "*" ) 77 78 byte-range-set = *( "," OWS ) ( byte-range-spec / suffix-byte-range-spec ) *( OWS "," [ OWS ( byte-range-spec / suffix-byte-range-spec ) ] ) 78 79 byte-range-spec = first-byte-pos "-" [ last-byte-pos ] … … 91 92 codings = content-coding / "identity" / "*" 92 93 comment = "(" *( ctext / quoted-cpair / comment ) ")" 94 complete-length = 1*DIGIT 93 95 connection-option = token 94 96 content-coding = token … … 135 137 http-URI = "http://" authority path-abempty [ "?" query ] 136 138 https-URI = "https://" authority path-abempty [ "?" query ] 137 instance-length = 1*DIGIT138 139 language-range = <language-range, defined in [RFC4647], Section 2.1> 139 140 language-tag = <Language-Tag, defined in [RFC5646], Section 2.1> … … 164 165 opaque-tag = DQUOTE *etagc DQUOTE 165 166 origin-form = path-absolute [ "?" query ] 166 other-content-range -spec = other-range-unit SP other-range-resp-spec167 other-range-resp -spec= *CHAR167 other-content-range = other-range-unit SP other-range-resp 168 other-range-resp = *CHAR 168 169 other-range-set = 1*CHAR 169 170 other-range-unit = token … … 221 222 transfer-parameter = attribute BWS "=" BWS value 222 223 type = token 224 unsatisfied-range = "*/" complete-length 223 225 uri-host = <host, defined in [RFC3986], Section 3.2.2> 224 226 value = word -
draft-ietf-httpbis/latest/p5-range.html
r2134 r2135 577 577 </li> 578 578 <li><a href="#rfc.section.2">2.</a> <a href="#range.units">Range Units</a><ul> 579 <li><a href="#rfc.section.2.1">2.1</a> <a href="#range. specifier.registry">Range SpecifierRegistry</a></li>579 <li><a href="#rfc.section.2.1">2.1</a> <a href="#range.unit.registry">Range Unit Registry</a></li> 580 580 </ul> 581 581 </li> … … 655 655 </p> 656 656 <h1 id="rfc.section.2"><a href="#rfc.section.2">2.</a> <a id="range.units" href="#range.units">Range Units</a></h1> 657 <p id="rfc.section.2.p.1"> HTTP/1.1 allows a client to request that only part (a range) of the representation be included within the response. HTTP/1.1658 uses range units in the <a href="#range.retrieval.requests" class="smpl">Range</a> (<a href="#header.range" id="rfc.xref.header.range.1" title="Range">Section 5.4</a>) and <a href="#header.content-range" class="smpl">Content-Range</a> (<a href="#header.content-range" id="rfc.xref.header.content-range.1" title="Content-Range">Section 5.2</a>) header fields. A representation can be broken down into subranges according to various structural units.657 <p id="rfc.section.2.p.1">A representation can be partitioned into subranges according to various structural units, depending on the structure inherent 658 in the representation's media type. Such a <dfn>range unit</dfn> can be used in the <a href="#range.retrieval.requests" class="smpl">Range</a> (<a href="#header.range" id="rfc.xref.header.range.1" title="Range">Section 5.4</a>) and <a href="#header.content-range" class="smpl">Content-Range</a> (<a href="#header.content-range" id="rfc.xref.header.content-range.1" title="Content-Range">Section 5.2</a>) header fields to delineate the parts of a representation that are either requested or transferred, respectively. 659 659 </p> 660 660 <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> <a href="#range.units" class="smpl">range-unit</a> = <a href="#range.units" class="smpl">bytes-unit</a> / <a href="#range.units" class="smpl">other-range-unit</a> 661 661 <a href="#range.units" class="smpl">bytes-unit</a> = "bytes" 662 662 <a href="#range.units" class="smpl">other-range-unit</a> = <a href="#imported.abnf" class="smpl">token</a> 663 </pre><p id="rfc.section.2.p.3">HTTP/1.1 has been designed to allow implementations of applications that do not depend on knowledge of ranges. The only range 664 unit defined by HTTP/1.1 is "bytes". Additional specifiers can be defined as described in <a href="#range.specifier.registry" title="Range Specifier Registry">Section 2.1</a>. 665 </p> 666 <p id="rfc.section.2.p.4">If a range unit is not understood in a request, a server <em class="bcp14">MUST</em> ignore the whole <a href="#range.retrieval.requests" class="smpl">Range</a> header field (<a href="#header.range" id="rfc.xref.header.range.2" title="Range">Section 5.4</a>). If a range unit is not understood in a response, an intermediary <em class="bcp14">SHOULD</em> pass the response to the client; a client <em class="bcp14">MUST</em> fail. 667 </p> 668 <h2 id="rfc.section.2.1"><a href="#rfc.section.2.1">2.1</a> <a id="range.specifier.registry" href="#range.specifier.registry">Range Specifier Registry</a></h2> 669 <p id="rfc.section.2.1.p.1">The HTTP Range Specifier Registry defines the name space for the range specifier names.</p> 663 </pre><p id="rfc.section.2.p.3">The only range unit defined by HTTP/1.1 is "bytes" (<a href="#byte.ranges" title="Byte Ranges">Section 5.4.1</a>). Additional units can be defined as described in <a href="#range.unit.registry" title="Range Unit Registry">Section 2.1</a>. 664 </p> 665 <h2 id="rfc.section.2.1"><a href="#rfc.section.2.1">2.1</a> <a id="range.unit.registry" href="#range.unit.registry">Range Unit Registry</a></h2> 666 <p id="rfc.section.2.1.p.1">The HTTP Range Unit Registry defines the name space for the range unit names and refers to their corresponding specifications.</p> 670 667 <p id="rfc.section.2.1.p.2">Registrations <em class="bcp14">MUST</em> include the following fields: 671 668 </p> … … 682 679 <div id="rfc.iref.3"></div> 683 680 <h2 id="rfc.section.3.1"><a href="#rfc.section.3.1">3.1</a> <a id="status.206" href="#status.206">206 Partial Content</a></h2> 684 <p id="rfc.section.3.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="#range.retrieval.requests" class="smpl">Range</a> header field (<a href="#header.range" id="rfc.xref.header.range. 3" title="Range">Section 5.4</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.1" title="If-Range">Section 5.3</a>) to make the request conditional.681 <p id="rfc.section.3.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="#range.retrieval.requests" class="smpl">Range</a> header field (<a href="#header.range" id="rfc.xref.header.range.2" title="Range">Section 5.4</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.1" title="If-Range">Section 5.3</a>) to make the request conditional. 685 682 </p> 686 683 <p id="rfc.section.3.1.p.2">When a 206 response is generated, the sender <em class="bcp14">MUST</em> generate the following header fields: … … 699 696 <div id="rfc.iref.3"></div> 700 697 <h2 id="rfc.section.3.2"><a href="#rfc.section.3.2">3.2</a> <a id="status.416" href="#status.416">416 Range Not Satisfiable</a></h2> 701 <p id="rfc.section.3.2.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="#range.retrieval.requests" class="smpl">Range</a> header field (<a href="#header.range" id="rfc.xref.header.range. 4" title="Range">Section 5.4</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 5.3</a>). (For byte-ranges, this means that the first-byte-pos of all of the byte-range-spec values were greater than the current698 <p id="rfc.section.3.2.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="#range.retrieval.requests" class="smpl">Range</a> header field (<a href="#header.range" id="rfc.xref.header.range.3" title="Range">Section 5.4</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 5.3</a>). (For byte-ranges, this means that the first-byte-pos of all of the byte-range-spec values were greater than the current 702 699 length of the selected representation.) 703 700 </p> … … 776 773 body is intended to be applied. 777 774 </p> 778 <p id="rfc.section.5.2.p.2">Range units are defined in <a href="#range.units" title="Range Units">Section 2</a>. 779 </p> 780 <div id="rfc.figure.u.7"></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> <a href="#header.content-range" class="smpl">Content-Range</a> = <a href="#header.content-range" class="smpl">byte-content-range-spec</a> 781 / <a href="#header.content-range" class="smpl">other-content-range-spec</a> 775 <div id="rfc.figure.u.7"></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><span id="rfc.iref.g.11"></span><span id="rfc.iref.g.12"></span><span id="rfc.iref.g.13"></span> <a href="#header.content-range" class="smpl">Content-Range</a> = <a href="#header.content-range" class="smpl">byte-content-range</a> 776 / <a href="#header.content-range" class="smpl">other-content-range</a> 782 777 783 <a href="#header.content-range" class="smpl">byte-content-range-spec</a> = <a href="#range.units" class="smpl">bytes-unit</a> <a href="#imported.abnf" class="smpl">SP</a> 784 <a href="#header.content-range" class="smpl">byte-range-resp-spec</a> "/" 785 ( <a href="#header.content-range" class="smpl">instance-length</a> / "*" ) 778 <a href="#header.content-range" class="smpl">byte-content-range</a> = <a href="#range.units" class="smpl">bytes-unit</a> <a href="#imported.abnf" class="smpl">SP</a> 779 ( <a href="#header.content-range" class="smpl">byte-range-resp</a> "/" <a href="#header.content-range" class="smpl">unsatisfied-range</a> ) 780 781 <a href="#header.content-range" class="smpl">byte-range-resp</a> = <a href="#header.content-range" class="smpl">byte-range</a> "/" ( <a href="#header.content-range" class="smpl">complete-length</a> / "*" ) 782 <a href="#header.content-range" class="smpl">byte-range</a> = <a href="#rule.ranges-specifier" class="smpl">first-byte-pos</a> "-" <a href="#rule.ranges-specifier" class="smpl">last-byte-pos</a> 783 <a href="#header.content-range" class="smpl">unsatisfied-range</a> = "*/" <a href="#header.content-range" class="smpl">complete-length</a> 784 785 <a href="#header.content-range" class="smpl">complete-length</a> = 1*<a href="#imported.abnf" class="smpl">DIGIT</a> 786 786 787 <a href="#header.content-range" class="smpl">byte-range-resp-spec</a> = (<a href="#rule.ranges-specifier" class="smpl">first-byte-pos</a> "-" <a href="#rule.ranges-specifier" class="smpl">last-byte-pos</a>) 788 / "*" 789 790 <a href="#header.content-range" class="smpl">instance-length</a> = 1*<a href="#imported.abnf" class="smpl">DIGIT</a> 791 792 <a href="#header.content-range" class="smpl">other-content-range-spec</a> = <a href="#range.units" class="smpl">other-range-unit</a> <a href="#imported.abnf" class="smpl">SP</a> 793 <a href="#header.content-range" class="smpl">other-range-resp-spec</a> 794 <a href="#header.content-range" class="smpl">other-range-resp-spec</a> = *<a href="#imported.abnf" class="smpl">CHAR</a> 795 </pre><p id="rfc.section.5.2.p.4">The header field <em class="bcp14">SHOULD</em> indicate the total length of the full representation, unless this length is unknown or difficult to determine. The asterisk 796 "*" character means that the instance-length is unknown at the time when the response was generated. 797 </p> 798 <p id="rfc.section.5.2.p.5">Unlike byte-ranges-specifier values (see <a href="#byte.ranges" title="Byte Ranges">Section 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. 799 </p> 800 <p id="rfc.section.5.2.p.6">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 801 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. 802 </p> 803 <p id="rfc.section.5.2.p.7">In the case of a byte range request: a server sending a response with status code <a href="#status.416" class="smpl">416 (Range Not Satisfiable)</a> <em class="bcp14">SHOULD</em> send a Content-Range field with a byte-range-resp-spec of "*". The instance-length specifies the current length of the selected 804 resource. A server <em class="bcp14">MUST NOT</em> generate a a Content-Range field with a byte-range-resp-spec of "*" in a <a href="#status.206" class="smpl">206 (Partial Content)</a> response. 805 </p> 806 <p id="rfc.section.5.2.p.8">The "Content-Range" header field has no meaning for status codes that do not explicitly describe its semantic. Currently, 807 only status codes <a href="#status.206" class="smpl">206 (Partial Content)</a> and <a href="#status.416" class="smpl">416 (Range Not Satisfiable)</a> describe the meaning of this header field. 808 </p> 809 <p id="rfc.section.5.2.p.9">Examples of byte-content-range-spec values, assuming that the representation contains a total of 1234 bytes: </p> 787 <a href="#header.content-range" class="smpl">other-content-range</a> = <a href="#range.units" class="smpl">other-range-unit</a> <a href="#imported.abnf" class="smpl">SP</a> <a href="#header.content-range" class="smpl">other-range-resp</a> 788 <a href="#header.content-range" class="smpl">other-range-resp</a> = *<a href="#imported.abnf" class="smpl">CHAR</a> 789 </pre><p id="rfc.section.5.2.p.3">Range units are defined in <a href="#range.units" title="Range Units">Section 2</a>. A recipient of a <a href="#status.206" class="smpl">206 (Partial Content)</a> response containing a <a href="#header.content-range" class="smpl">Content-Range</a> header field with a <a href="#range.units" class="smpl">range unit</a> that the recipient does not understand <em class="bcp14">MUST NOT</em> attempt to recombine it with a stored representation. A proxy that receives such a message <em class="bcp14">SHOULD</em> forward it downstream. 790 </p> 791 <p id="rfc.section.5.2.p.4">For byte ranges, a sender <em class="bcp14">SHOULD</em> indicate the complete length of the representation from which the range has been extracted unless the complete length is unknown 792 or difficult to determine. An asterisk character ("*") in place of the complete-length indicates that the representation length 793 was unknown when the header field was generated. 794 </p> 795 <p id="rfc.section.5.2.p.5">A Content-Range field value with a <a href="#header.content-range" class="smpl">byte-range-resp</a> that has a <a href="#rule.ranges-specifier" class="smpl">last-byte-pos</a> value less than its <a href="#rule.ranges-specifier" class="smpl">first-byte-pos</a> value, or a <a href="#header.content-range" class="smpl">complete-length</a> value less than or equal to its <a href="#rule.ranges-specifier" class="smpl">last-byte-pos</a> value, is invalid. The recipient of an invalid <a href="#header.content-range" class="smpl">Content-Range</a> <em class="bcp14">MUST NOT</em> attempt to recombine the received content with a stored representation. 796 </p> 797 <p id="rfc.section.5.2.p.6">A server generating a <a href="#status.206" class="smpl">206 (Partial Content)</a> response to a byte range request <em class="bcp14">MUST</em> send, in each body-part of a multipart response or in the header block of a single part response, a Content-Range header field 798 containing a <a href="#header.content-range" class="smpl">byte-range-resp</a> value that reflects the corresponding range being sent. The following example would apply when the complete length of the 799 selected representation is known by the sender to be 1234 bytes: 800 </p> 801 <div id="rfc.figure.u.8"></div><pre class="text"> Content-Range: bytes 42-1233/1234 802 </pre><p id="rfc.section.5.2.p.8">or this second example would apply when the complete length is unknown:</p> 803 <div id="rfc.figure.u.9"></div><pre class="text"> Content-Range: bytes 42-1233/* 804 </pre><p id="rfc.section.5.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: 805 </p> 806 <div id="rfc.figure.u.10"></div><pre class="text"> Content-Range: bytes */1234 807 </pre><p id="rfc.section.5.2.p.12">The complete-length in a 416 response indicates the current length of the selected representation, which will be known by 808 the server generating the response because that is how it determined the range to be unsatisfiable. 809 </p> 810 <p id="rfc.section.5.2.p.13">The "Content-Range" header field has no meaning for status codes that do not explicitly describe its semantic. For this specification, 811 only the <a href="#status.206" class="smpl">206 (Partial Content)</a> and <a href="#status.416" class="smpl">416 (Range Not Satisfiable)</a> status codes describe a meaning for Content-Range. 812 </p> 813 <p id="rfc.section.5.2.p.14">More examples of Content-Range values, assuming that the representation contains a total of 1234 bytes: </p> 810 814 <ul> 811 815 <li>The first 500 bytes: 812 <div id="rfc.figure.u. 8"></div><pre class="text">bytes 0-499/1234816 <div id="rfc.figure.u.11"></div><pre class="text"> Content-Range: bytes 0-499/1234 813 817 </pre> </li> 814 818 <li>The second 500 bytes: 815 <div id="rfc.figure.u. 9"></div><pre class="text">bytes 500-999/1234819 <div id="rfc.figure.u.12"></div><pre class="text"> Content-Range: bytes 500-999/1234 816 820 </pre> </li> 817 821 <li>All except for the first 500 bytes: 818 <div id="rfc.figure.u.1 0"></div><pre class="text">bytes 500-1233/1234822 <div id="rfc.figure.u.13"></div><pre class="text"> Content-Range: bytes 500-1233/1234 819 823 </pre> </li> 820 824 <li>The last 500 bytes: 821 <div id="rfc.figure.u.1 1"></div><pre class="text">bytes 734-1233/1234825 <div id="rfc.figure.u.14"></div><pre class="text"> Content-Range: bytes 734-1233/1234 822 826 </pre> </li> 823 827 </ul> … … 831 835 is unchanged, send me the part(s) that I am requesting in Range; otherwise, send me the entire representation. 832 836 </p> 833 <div id="rfc.figure.u.1 2"></div><pre class="inline"><span id="rfc.iref.g.10"></span> <a href="#header.if-range" class="smpl">If-Range</a> = <a href="#imported.abnf" class="smpl">entity-tag</a> / <a href="#imported.abnf" class="smpl">HTTP-date</a>837 <div id="rfc.figure.u.15"></div><pre class="inline"><span id="rfc.iref.g.14"></span> <a href="#header.if-range" class="smpl">If-Range</a> = <a href="#imported.abnf" class="smpl">entity-tag</a> / <a href="#imported.abnf" class="smpl">HTTP-date</a> 834 838 </pre><p id="rfc.section.5.3.p.4">Clients <em class="bcp14">MUST NOT</em> use an entity-tag marked as weak in an If-Range field value and <em class="bcp14">MUST NOT</em> use a <a href="p4-conditional.html#header.last-modified" class="smpl">Last-Modified</a> date in an If-Range field value unless it has no entity-tag for the representation and the Last-Modified date it does have 835 839 for the representation is strong in the sense defined by <a href="p4-conditional.html#lastmod.comparison" title="Comparison">Section 2.2.2</a> of <a href="#Part4" id="rfc.xref.Part4.3"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests">[Part4]</cite></a>. … … 856 860 </p> 857 861 </div> 858 <div id="rfc.figure.u.1 3"></div><pre class="inline"><span id="rfc.iref.g.11"></span><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> <a href="#rule.ranges-specifier" class="smpl">byte-ranges-specifier</a> = <a href="#range.units" class="smpl">bytes-unit</a> "=" <a href="#rule.ranges-specifier" class="smpl">byte-range-set</a>862 <div id="rfc.figure.u.16"></div><pre class="inline"><span id="rfc.iref.g.15"></span><span id="rfc.iref.g.16"></span><span id="rfc.iref.g.17"></span><span id="rfc.iref.g.18"></span><span id="rfc.iref.g.19"></span><span id="rfc.iref.g.20"></span> <a href="#rule.ranges-specifier" class="smpl">byte-ranges-specifier</a> = <a href="#range.units" class="smpl">bytes-unit</a> "=" <a href="#rule.ranges-specifier" class="smpl">byte-range-set</a> 859 863 <a href="#rule.ranges-specifier" class="smpl">byte-range-set</a> = 1#( <a href="#rule.ranges-specifier" class="smpl">byte-range-spec</a> / <a href="#rule.ranges-specifier" class="smpl">suffix-byte-range-spec</a> ) 860 864 <a href="#rule.ranges-specifier" class="smpl">byte-range-spec</a> = <a href="#rule.ranges-specifier" class="smpl">first-byte-pos</a> "-" [ <a href="#rule.ranges-specifier" class="smpl">last-byte-pos</a> ] … … 872 876 </p> 873 877 <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 representation.</p> 874 <div id="rfc.figure.u.1 4"></div><pre class="inline"><span id="rfc.iref.g.17"></span><span id="rfc.iref.g.18"></span> <a href="#rule.ranges-specifier" class="smpl">suffix-byte-range-spec</a> = "-" <a href="#rule.ranges-specifier" class="smpl">suffix-length</a>878 <div id="rfc.figure.u.17"></div><pre class="inline"><span id="rfc.iref.g.21"></span><span id="rfc.iref.g.22"></span> <a href="#rule.ranges-specifier" class="smpl">suffix-byte-range-spec</a> = "-" <a href="#rule.ranges-specifier" class="smpl">suffix-length</a> 875 879 <a href="#rule.ranges-specifier" class="smpl">suffix-length</a> = 1*<a href="#imported.abnf" class="smpl">DIGIT</a> 876 880 </pre><p id="rfc.section.5.4.1.p.10">A suffix-byte-range-spec is used to specify the suffix of the representation data, of a length given by the suffix-length … … 887 891 <ul> 888 892 <li>The first 500 bytes (byte offsets 0-499, inclusive): 889 <div id="rfc.figure.u.1 5"></div><pre class="text"> bytes=0-499893 <div id="rfc.figure.u.18"></div><pre class="text"> bytes=0-499 890 894 </pre> </li> 891 895 <li>The second 500 bytes (byte offsets 500-999, inclusive): 892 <div id="rfc.figure.u.1 6"></div><pre class="text"> bytes=500-999896 <div id="rfc.figure.u.19"></div><pre class="text"> bytes=500-999 893 897 </pre> </li> 894 898 <li>The final 500 bytes (byte offsets 9500-9999, inclusive): 895 <div id="rfc.figure.u. 17"></div><pre class="text"> bytes=-500896 </pre> Or: <div id="rfc.figure.u. 18"></div><pre class="text"> bytes=9500-899 <div id="rfc.figure.u.20"></div><pre class="text"> bytes=-500 900 </pre> Or: <div id="rfc.figure.u.21"></div><pre class="text"> bytes=9500- 897 901 </pre> </li> 898 902 <li>The first and last bytes only (bytes 0 and 9999): 899 <div id="rfc.figure.u. 19"></div><pre class="text"> bytes=0-0,-1903 <div id="rfc.figure.u.22"></div><pre class="text"> bytes=0-0,-1 900 904 </pre> </li> 901 905 <li>Several legal but not canonical specifications of the second 500 bytes (byte offsets 500-999, inclusive): 902 <div id="rfc.figure.u.2 0"></div><pre class="text"> bytes=500-600,601-999906 <div id="rfc.figure.u.23"></div><pre class="text"> bytes=500-600,601-999 903 907 bytes=500-700,601-999 904 908 </pre> </li> … … 908 912 of the selected representation data in a successful response, rather than the entire representation data. 909 913 </p> 910 <div id="rfc.figure.u.2 1"></div><pre class="inline"><span id="rfc.iref.g.19"></span> <a href="#range.retrieval.requests" class="smpl">Range</a> = <a href="#rule.ranges-specifier" class="smpl">byte-ranges-specifier</a> / <a href="#range.retrieval.requests" class="smpl">other-ranges-specifier</a>914 <div id="rfc.figure.u.24"></div><pre class="inline"><span id="rfc.iref.g.23"></span> <a href="#range.retrieval.requests" class="smpl">Range</a> = <a href="#rule.ranges-specifier" class="smpl">byte-ranges-specifier</a> / <a href="#range.retrieval.requests" class="smpl">other-ranges-specifier</a> 911 915 <a href="#range.retrieval.requests" class="smpl">other-ranges-specifier</a> = <a href="#range.units" class="smpl">other-range-unit</a> "=" <a href="#range.retrieval.requests" class="smpl">other-range-set</a> 912 916 <a href="#range.retrieval.requests" class="smpl">other-range-set</a> = 1*<a href="#imported.abnf" class="smpl">CHAR</a> … … 915 919 server <em class="bcp14">MUST</em> ignore a Range header field received with a request method other than GET. 916 920 </p> 917 <p id="rfc.section.5.4.2.p.4">The Range header field is evaluated after evaluating the preconditions of <a href="#Part4" id="rfc.xref.Part4.5"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests">[Part4]</cite></a> and only if the result of their evaluation is leading toward a <a href="p2-semantics.html#status.200" class="smpl">200 (OK)</a> response. In other words, Range is ignored when a conditional GET would result in a <a href="p4-conditional.html#status.304" class="smpl">304 (Not Modified)</a> response. 918 </p> 919 <p id="rfc.section.5.4.2.p.5">The If-Range header field (<a href="#header.if-range" id="rfc.xref.header.if-range.3" title="If-Range">Section 5.3</a>) can be used as a precondition to applying the Range header field. 920 </p> 921 <p id="rfc.section.5.4.2.p.6">If all of the preconditions are true, the server supports the Range header field for the target resource, the specified range(s) 921 <p id="rfc.section.5.4.2.p.4">An origin server <em class="bcp14">MUST</em> ignore a <a href="#range.retrieval.requests" class="smpl">Range</a> header field that contains a range unit it does not understand. A proxy <em class="bcp14">MAY</em> either discard a <a href="#range.retrieval.requests" class="smpl">Range</a> header field that contains a range unit it does not understand or pass it to the next inbound server when forwarding the request. 922 </p> 923 <p id="rfc.section.5.4.2.p.5">The Range header field is evaluated after evaluating the preconditions of <a href="#Part4" id="rfc.xref.Part4.5"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests">[Part4]</cite></a> and only if the result of their evaluation is leading toward a <a href="p2-semantics.html#status.200" class="smpl">200 (OK)</a> response. In other words, Range is ignored when a conditional GET would result in a <a href="p4-conditional.html#status.304" class="smpl">304 (Not Modified)</a> response. 924 </p> 925 <p id="rfc.section.5.4.2.p.6">The If-Range header field (<a href="#header.if-range" id="rfc.xref.header.if-range.3" title="If-Range">Section 5.3</a>) can be used as a precondition to applying the Range header field. 926 </p> 927 <p id="rfc.section.5.4.2.p.7">If all of the preconditions are true, the server supports the Range header field for the target resource, the specified range(s) 922 928 are syntactically correct (as defined in <a href="#byte.ranges" title="Byte Ranges">Section 5.4.1</a>), and at least one of the ranges has a non-empty intersection with the current selected representation extent, then the server <em class="bcp14">MAY</em> respond with a status code of <a href="#status.206" class="smpl">206 (Partial Content)</a> and a payload containing one or more partial representations that correspond to those requested, as defined in <a href="#range.response" title="Responses to a Range Request">Section 4</a>. 923 929 </p> … … 992 998 <td class="left">http</td> 993 999 <td class="left">standard</td> 994 <td class="left"> <a href="#header.range" id="rfc.xref.header.range. 5" title="Range">Section 5.4</a>1000 <td class="left"> <a href="#header.range" id="rfc.xref.header.range.4" title="Range">Section 5.4</a> 995 1001 </td> 996 1002 </tr> … … 1000 1006 <p id="rfc.section.6.2.p.2">The change controller is: "IETF (iesg@ietf.org) - Internet Engineering Task Force".</p> 1001 1007 <h2 id="rfc.section.6.3"><a href="#rfc.section.6.3">6.3</a> <a id="range.specifier.registration" href="#range.specifier.registration">Range Specifier Registration</a></h2> 1002 <p id="rfc.section.6.3.p.1">The registration procedure for HTTP Range Specifiers is defined by <a href="#range. specifier.registry" title="Range SpecifierRegistry">Section 2.1</a> of this document.1008 <p id="rfc.section.6.3.p.1">The registration procedure for HTTP Range Specifiers is defined by <a href="#range.unit.registry" title="Range Unit Registry">Section 2.1</a> of this document. 1003 1009 </p> 1004 1010 <p id="rfc.section.6.3.p.2">The HTTP Range Specifier Registry shall be created at <<a href="http://www.iana.org/assignments/http-range-specifiers">http://www.iana.org/assignments/http-range-specifiers</a>> and be populated with the registrations below: … … 1170 1176 </p> 1171 1177 </div> 1172 <div id="rfc.figure.u.2 2"></div>1178 <div id="rfc.figure.u.25"></div> 1173 1179 <p>For example:</p><pre class="text"> HTTP/1.1 206 Partial Content 1174 1180 Date: Wed, 15 Nov 1995 06:25:24 GMT … … 1188 1194 ...the second range 1189 1195 --THIS_STRING_SEPARATES-- 1190 </pre><div id="rfc.figure.u.2 3"></div>1196 </pre><div id="rfc.figure.u.26"></div> 1191 1197 <p>Another example, using the "exampleunit" range unit:</p> <pre class="text"> HTTP/1.1 206 Partial Content 1192 1198 Date: Tue, 14 Nov 1995 06:25:24 GMT … … 1225 1231 <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>) 1226 1232 </p> 1227 <p id="rfc.section.B.p.5">This specification introduces a Range Specifier Registry. (<a href="#range. specifier.registry" title="Range SpecifierRegistry">Section 2.1</a>)1233 <p id="rfc.section.B.p.5">This specification introduces a Range Specifier Registry. (<a href="#range.unit.registry" title="Range Unit Registry">Section 2.1</a>) 1228 1234 </p> 1229 1235 <h1 id="rfc.section.C"><a href="#rfc.section.C">C.</a> <a id="imported.abnf" href="#imported.abnf">Imported ABNF</a></h1> … … 1236 1242 <p id="rfc.section.C.p.3">The rules below are defined in <a href="#Part1" id="rfc.xref.Part1.5"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing">[Part1]</cite></a>: 1237 1243 </p> 1238 <div id="rfc.figure.u.2 4"></div><pre class="inline"> <a href="#imported.abnf" class="smpl">OWS</a> = <OWS, defined in <a href="#Part1" id="rfc.xref.Part1.6"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing">[Part1]</cite></a>, <a href="p1-messaging.html#whitespace" title="Whitespace">Section 3.2.3</a>>1244 <div id="rfc.figure.u.27"></div><pre class="inline"> <a href="#imported.abnf" class="smpl">OWS</a> = <OWS, defined in <a href="#Part1" id="rfc.xref.Part1.6"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing">[Part1]</cite></a>, <a href="p1-messaging.html#whitespace" title="Whitespace">Section 3.2.3</a>> 1239 1245 <a href="#imported.abnf" class="smpl">token</a> = <token, defined in <a href="#Part1" id="rfc.xref.Part1.7"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing">[Part1]</cite></a>, <a href="p1-messaging.html#field.components" title="Field value components">Section 3.2.6</a>> 1240 1246 </pre><p id="rfc.section.C.p.5">The rules below are defined in other parts:</p> 1241 <div id="rfc.figure.u.2 5"></div><pre class="inline"> <a href="#imported.abnf" class="smpl">HTTP-date</a> = <HTTP-date, defined in <a href="#Part2" id="rfc.xref.Part2.2"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content">[Part2]</cite></a>, <a href="p2-semantics.html#http.date" title="Date/Time Formats">Section 7.1.1.1</a>>1247 <div id="rfc.figure.u.28"></div><pre class="inline"> <a href="#imported.abnf" class="smpl">HTTP-date</a> = <HTTP-date, defined in <a href="#Part2" id="rfc.xref.Part2.2"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content">[Part2]</cite></a>, <a href="p2-semantics.html#http.date" title="Date/Time Formats">Section 7.1.1.1</a>> 1242 1248 <a href="#imported.abnf" class="smpl">entity-tag</a> = <entity-tag, defined in <a href="#Part4" id="rfc.xref.Part4.6"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests">[Part4]</cite></a>, <a href="p4-conditional.html#header.etag" title="ETag">Section 2.3</a>> 1243 1249 </pre><h1 id="rfc.section.D"><a href="#rfc.section.D">D.</a> <a id="collected.abnf" href="#collected.abnf">Collected ABNF</a></h1> 1244 <div id="rfc.figure.u.2 6"></div> <pre class="inline"><a href="#header.accept-ranges" class="smpl">Accept-Ranges</a> = acceptable-ranges1245 1246 <a href="#header.content-range" class="smpl">Content-Range</a> = byte-content-range -spec / other-content-range-spec1250 <div id="rfc.figure.u.29"></div> <pre class="inline"><a href="#header.accept-ranges" class="smpl">Accept-Ranges</a> = acceptable-ranges 1251 1252 <a href="#header.content-range" class="smpl">Content-Range</a> = byte-content-range / other-content-range 1247 1253 1248 1254 <a href="#imported.abnf" class="smpl">HTTP-date</a> = <HTTP-date, defined in [Part2], Section 7.1.1.1> … … 1257 1263 range-unit ] ) ) / "none" 1258 1264 1259 <a href="#header.content-range" class="smpl">byte-content-range-spec</a> = bytes-unit SP byte-range-resp-spec "/" ( 1260 instance-length / "*" ) 1261 <a href="#header.content-range" class="smpl">byte-range-resp-spec</a> = ( first-byte-pos "-" last-byte-pos ) / "*" 1265 <a href="#header.content-range" class="smpl">byte-content-range</a> = bytes-unit SP ( byte-range-resp "/" 1266 unsatisfied-range ) 1267 <a href="#header.content-range" class="smpl">byte-range</a> = first-byte-pos "-" last-byte-pos 1268 <a href="#header.content-range" class="smpl">byte-range-resp</a> = byte-range "/" ( complete-length / "*" ) 1262 1269 <a href="#rule.ranges-specifier" class="smpl">byte-range-set</a> = *( "," OWS ) ( byte-range-spec / 1263 1270 suffix-byte-range-spec ) *( OWS "," [ OWS ( byte-range-spec / … … 1267 1274 <a href="#range.units" class="smpl">bytes-unit</a> = "bytes" 1268 1275 1276 <a href="#header.content-range" class="smpl">complete-length</a> = 1*DIGIT 1277 1269 1278 <a href="#imported.abnf" class="smpl">entity-tag</a> = <entity-tag, defined in [Part4], Section 2.3> 1270 1279 1271 1280 <a href="#rule.ranges-specifier" class="smpl">first-byte-pos</a> = 1*DIGIT 1272 1281 1273 <a href="#header.content-range" class="smpl">instance-length</a> = 1*DIGIT1274 1275 1282 <a href="#rule.ranges-specifier" class="smpl">last-byte-pos</a> = 1*DIGIT 1276 1283 1277 <a href="#header.content-range" class="smpl">other-content-range -spec</a> = other-range-unit SP other-range-resp-spec1278 <a href="#header.content-range" class="smpl">other-range-resp -spec</a> = *CHAR1284 <a href="#header.content-range" class="smpl">other-content-range</a> = other-range-unit SP other-range-resp 1285 <a href="#header.content-range" class="smpl">other-range-resp</a> = *CHAR 1279 1286 <a href="#range.retrieval.requests" class="smpl">other-range-set</a> = 1*CHAR 1280 1287 <a href="#range.units" class="smpl">other-range-unit</a> = token … … 1287 1294 1288 1295 <a href="#imported.abnf" class="smpl">token</a> = <token, defined in [Part1], Section 3.2.6> 1296 1297 <a href="#header.content-range" class="smpl">unsatisfied-range</a> = "*/" complete-length 1289 1298 </pre> <h1 id="rfc.section.E"><a href="#rfc.section.E">E.</a> <a id="change.log" href="#change.log">Change Log (to be removed by RFC Editor before publication)</a></h1> 1290 1299 <p id="rfc.section.E.p.1">Changes up to the first Working Group Last Call draft are summarized in <<a href="http://tools.ietf.org/html/draft-ietf-httpbis-p5-range-19#appendix-D">http://tools.ietf.org/html/draft-ietf-httpbis-p5-range-19#appendix-D</a>>. … … 1342 1351 <li><tt>Accept-Ranges</tt> <a href="#rfc.iref.g.4"><b>5.1</b></a></li> 1343 1352 <li><tt>acceptable-ranges</tt> <a href="#rfc.iref.g.5"><b>5.1</b></a></li> 1344 <li><tt>byte-content-range-spec</tt> <a href="#rfc.iref.g.7"><b>5.2</b></a></li> 1345 <li><tt>byte-range-resp-spec</tt> <a href="#rfc.iref.g.8"><b>5.2</b></a></li> 1346 <li><tt>byte-range-set</tt> <a href="#rfc.iref.g.13"><b>5.4.1</b></a></li> 1347 <li><tt>byte-range-spec</tt> <a href="#rfc.iref.g.14"><b>5.4.1</b></a></li> 1348 <li><tt>byte-ranges-specifier</tt> <a href="#rfc.iref.g.12"><b>5.4.1</b></a></li> 1353 <li><tt>byte-content-range</tt> <a href="#rfc.iref.g.7"><b>5.2</b></a></li> 1354 <li><tt>byte-range</tt> <a href="#rfc.iref.g.9"><b>5.2</b></a></li> 1355 <li><tt>byte-range-resp</tt> <a href="#rfc.iref.g.8"><b>5.2</b></a></li> 1356 <li><tt>byte-range-set</tt> <a href="#rfc.iref.g.17"><b>5.4.1</b></a></li> 1357 <li><tt>byte-range-spec</tt> <a href="#rfc.iref.g.18"><b>5.4.1</b></a></li> 1358 <li><tt>byte-ranges-specifier</tt> <a href="#rfc.iref.g.16"><b>5.4.1</b></a></li> 1349 1359 <li><tt>bytes-unit</tt> <a href="#rfc.iref.g.2"><b>2</b></a></li> 1360 <li><tt>complete-length</tt> <a href="#rfc.iref.g.13"><b>5.2</b></a></li> 1350 1361 <li><tt>Content-Range</tt> <a href="#rfc.iref.g.6"><b>5.2</b></a></li> 1351 <li><tt>first-byte-pos</tt> <a href="#rfc.iref.g.15"><b>5.4.1</b></a></li> 1352 <li><tt>If-Range</tt> <a href="#rfc.iref.g.10"><b>5.3</b></a></li> 1353 <li><tt>instance-length</tt> <a href="#rfc.iref.g.9"><b>5.2</b></a></li> 1354 <li><tt>last-byte-pos</tt> <a href="#rfc.iref.g.16"><b>5.4.1</b></a></li> 1362 <li><tt>first-byte-pos</tt> <a href="#rfc.iref.g.19"><b>5.4.1</b></a></li> 1363 <li><tt>If-Range</tt> <a href="#rfc.iref.g.14"><b>5.3</b></a></li> 1364 <li><tt>last-byte-pos</tt> <a href="#rfc.iref.g.20"><b>5.4.1</b></a></li> 1365 <li><tt>other-content-range</tt> <a href="#rfc.iref.g.11"><b>5.2</b></a></li> 1366 <li><tt>other-range-resp</tt> <a href="#rfc.iref.g.12"><b>5.2</b></a></li> 1355 1367 <li><tt>other-range-unit</tt> <a href="#rfc.iref.g.3"><b>2</b></a></li> 1356 <li><tt>Range</tt> <a href="#rfc.iref.g. 19"><b>5.4.2</b></a></li>1368 <li><tt>Range</tt> <a href="#rfc.iref.g.23"><b>5.4.2</b></a></li> 1357 1369 <li><tt>range-unit</tt> <a href="#rfc.iref.g.1"><b>2</b></a></li> 1358 <li><tt>ranges-specifier</tt> <a href="#rfc.iref.g.11"><b>5.4.1</b></a></li> 1359 <li><tt>suffix-byte-range-spec</tt> <a href="#rfc.iref.g.17"><b>5.4.1</b></a></li> 1360 <li><tt>suffix-length</tt> <a href="#rfc.iref.g.18"><b>5.4.1</b></a></li> 1370 <li><tt>ranges-specifier</tt> <a href="#rfc.iref.g.15"><b>5.4.1</b></a></li> 1371 <li><tt>suffix-byte-range-spec</tt> <a href="#rfc.iref.g.21"><b>5.4.1</b></a></li> 1372 <li><tt>suffix-length</tt> <a href="#rfc.iref.g.22"><b>5.4.1</b></a></li> 1373 <li><tt>unsatisfied-range</tt> <a href="#rfc.iref.g.10"><b>5.2</b></a></li> 1361 1374 </ul> 1362 1375 </li> … … 1403 1416 </li> 1404 1417 <li><a id="rfc.index.R" href="#rfc.index.R"><b>R</b></a><ul> 1405 <li>Range header field <a href="#rfc.xref.header.range.1">2</a>, <a href="#rfc.xref.header.range.2"> 2</a>, <a href="#rfc.xref.header.range.3">3.1</a>, <a href="#rfc.xref.header.range.4">3.2</a>, <a href="#rfc.iref.r.1"><b>5.4</b></a>, <a href="#rfc.xref.header.range.5">6.2</a></li>1418 <li>Range header field <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>, <a href="#rfc.xref.header.range.4">6.2</a></li> 1406 1419 <li><em>RFC2046</em> <a href="#RFC2046"><b>9.1</b></a>, <a href="#rfc.xref.RFC2046.1">A</a>, <a href="#rfc.xref.RFC2046.2">A</a><ul> 1407 1420 <li><em>Section 5.1</em> <a href="#rfc.xref.RFC2046.1">A</a></li> -
draft-ietf-httpbis/latest/p5-range.xml
r2134 r2135 184 184 <x:anchor-alias value="other-range-unit"/> 185 185 <x:anchor-alias value="range-unit"/> 186 <t> 187 HTTP/1.1 allows a client to request that only part (a range) of the 188 representation be included within the response. HTTP/1.1 uses range 189 units in the <x:ref>Range</x:ref> (<xref target="header.range"/>) and 186 <x:anchor-alias value="range unit"/> 187 <t> 188 A representation can be partitioned into subranges according to various 189 structural units, depending on the structure inherent in the 190 representation's media type. Such a <x:dfn>range unit</x:dfn> can be used 191 in the <x:ref>Range</x:ref> (<xref target="header.range"/>) and 190 192 <x:ref>Content-Range</x:ref> (<xref target="header.content-range"/>) 191 header fields . A representation can be broken down into subranges according192 to various structural units.193 header fields to delineate the parts of a representation that are 194 either requested or transferred, respectively. 193 195 </t> 194 196 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="range-unit"/><iref primary="true" item="Grammar" subitem="bytes-unit"/><iref primary="true" item="Grammar" subitem="other-range-unit"/> … … 198 200 </artwork></figure> 199 201 <t> 200 HTTP/1.1 has been designed to allow implementations of applications 201 that do not depend on knowledge of ranges. The only range unit defined 202 by HTTP/1.1 is "bytes". Additional specifiers can be defined as described 203 in <xref target="range.specifier.registry"/>. 204 </t> 205 <t> 206 If a range unit is not understood in a request, a server &MUST; ignore 207 the whole <x:ref>Range</x:ref> header field (<xref target="header.range"/>). 208 If a range unit is not understood in a response, an intermediary 209 &SHOULD; pass the response to the client; a client &MUST; fail. 210 </t> 211 212 <section title="Range Specifier Registry" anchor="range.specifier.registry"> 213 <t> 214 The HTTP Range Specifier Registry defines the name space for the range 215 specifier names. 202 The only range unit defined by HTTP/1.1 is "bytes" 203 (<xref target="byte.ranges"/>). Additional units can be defined as described 204 in <xref target="range.unit.registry"/>. 205 </t> 206 207 <section title="Range Unit Registry" anchor="range.unit.registry"> 208 <t> 209 The HTTP Range Unit Registry defines the name space for the range 210 unit names and refers to their corresponding specifications. 216 211 </t> 217 212 <t> … … 469 464 <section title="Content-Range" anchor="header.content-range"> 470 465 <iref primary="true" item="Content-Range header field" x:for-anchor=""/> 471 <x:anchor-alias value="byte-content-range-spec"/>472 <x:anchor-alias value="byte-range-resp-spec"/>473 466 <x:anchor-alias value="Content-Range"/> 474 <x:anchor-alias value="instance-length"/> 475 <x:anchor-alias value="other-content-range-spec"/> 476 <x:anchor-alias value="other-range-resp-spec"/> 467 <x:anchor-alias value="byte-content-range"/> 468 <x:anchor-alias value="byte-range-resp"/> 469 <x:anchor-alias value="byte-range"/> 470 <x:anchor-alias value="unsatisfied-range"/> 471 <x:anchor-alias value="complete-length"/> 472 <x:anchor-alias value="other-content-range"/> 473 <x:anchor-alias value="other-range-resp"/> 477 474 <t> 478 475 The "Content-Range" header field is sent with a partial representation to … … 480 477 applied. 481 478 </t> 479 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Range"/><iref primary="true" item="Grammar" subitem="byte-content-range"/><iref primary="true" item="Grammar" subitem="byte-range-resp"/><iref primary="true" item="Grammar" subitem="byte-range"/><iref primary="true" item="Grammar" subitem="unsatisfied-range"/><iref primary="true" item="Grammar" subitem="other-content-range"/><iref primary="true" item="Grammar" subitem="other-range-resp"/><iref primary="true" item="Grammar" subitem="complete-length"/> 480 <x:ref>Content-Range</x:ref> = <x:ref>byte-content-range</x:ref> 481 / <x:ref>other-content-range</x:ref> 482 483 <x:ref>byte-content-range</x:ref> = <x:ref>bytes-unit</x:ref> <x:ref>SP</x:ref> 484 ( <x:ref>byte-range-resp</x:ref> "/" <x:ref>unsatisfied-range</x:ref> ) 485 486 <x:ref>byte-range-resp</x:ref> = <x:ref>byte-range</x:ref> "/" ( <x:ref>complete-length</x:ref> / "*" ) 487 <x:ref>byte-range</x:ref> = <x:ref>first-byte-pos</x:ref> "-" <x:ref>last-byte-pos</x:ref> 488 <x:ref>unsatisfied-range</x:ref> = "*/" <x:ref>complete-length</x:ref> 489 490 <x:ref>complete-length</x:ref> = 1*<x:ref>DIGIT</x:ref> 491 492 <x:ref>other-content-range</x:ref> = <x:ref>other-range-unit</x:ref> <x:ref>SP</x:ref> <x:ref>other-range-resp</x:ref> 493 <x:ref>other-range-resp</x:ref> = *<x:ref>CHAR</x:ref> 494 </artwork></figure> 482 495 <t> 483 Range units are defined in <xref target="range.units"/>. 484 </t> 485 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Range"/><iref primary="true" item="Grammar" subitem="byte-content-range-spec"/><iref primary="true" item="Grammar" subitem="byte-range-resp-spec"/><iref primary="true" item="Grammar" subitem="instance-length"/> 486 <x:ref>Content-Range</x:ref> = <x:ref>byte-content-range-spec</x:ref> 487 / <x:ref>other-content-range-spec</x:ref> 488 489 <x:ref>byte-content-range-spec</x:ref> = <x:ref>bytes-unit</x:ref> <x:ref>SP</x:ref> 490 <x:ref>byte-range-resp-spec</x:ref> "/" 491 ( <x:ref>instance-length</x:ref> / "*" ) 492 493 <x:ref>byte-range-resp-spec</x:ref> = (<x:ref>first-byte-pos</x:ref> "-" <x:ref>last-byte-pos</x:ref>) 494 / "*" 495 496 <x:ref>instance-length</x:ref> = 1*<x:ref>DIGIT</x:ref> 497 498 <x:ref>other-content-range-spec</x:ref> = <x:ref>other-range-unit</x:ref> <x:ref>SP</x:ref> 499 <x:ref>other-range-resp-spec</x:ref> 500 <x:ref>other-range-resp-spec</x:ref> = *<x:ref>CHAR</x:ref> 501 </artwork></figure> 502 <t> 503 The header field &SHOULD; indicate the total length of the full representation, 504 unless this length is unknown or difficult to determine. The asterisk 505 "*" character means that the instance-length is unknown at the time 506 when the response was generated. 507 </t> 508 <t> 509 Unlike byte-ranges-specifier values (see <xref target="byte.ranges"/>), a byte-range-resp-spec 510 &MUST; only specify one range, and &MUST; contain 511 absolute byte positions for both the first and last byte of the 512 range. 513 </t> 514 <t> 515 A byte-content-range-spec with a byte-range-resp-spec whose last-byte-pos 516 value is less than its first-byte-pos value, or whose 517 instance-length value is less than or equal to its last-byte-pos 518 value, is invalid. The recipient of an invalid byte-content-range-spec 519 &MUST; ignore it and any content transferred along with it. 520 </t> 521 <t> 522 In the case of a byte range request: a server sending a response with 523 status code <x:ref>416 (Range Not Satisfiable)</x:ref> &SHOULD; send a 524 Content-Range field with a byte-range-resp-spec of "*". 525 The instance-length specifies the current length of the selected resource. 526 A server &MUST-NOT; generate a a Content-Range field with a 527 byte-range-resp-spec of "*" in a <x:ref>206 (Partial Content)</x:ref> 528 response. 529 </t> 530 <t> 531 The "Content-Range" header field has no meaning for status codes that do not 532 explicitly describe its semantic. Currently, only status codes 533 <x:ref>206 (Partial Content)</x:ref> and <x:ref>416 (Range Not Satisfiable)</x:ref> describe 534 the meaning of this header field. 535 </t> 536 <t> 537 Examples of byte-content-range-spec values, assuming that the representation 496 Range units are defined in <xref target="range.units"/>. A recipient of a 497 <x:ref>206 (Partial Content)</x:ref> response containing a 498 <x:ref>Content-Range</x:ref> header field with a <x:ref>range unit</x:ref> 499 that the recipient does not understand &MUST-NOT; attempt to recombine it 500 with a stored representation. A proxy that receives such a message 501 &SHOULD; forward it downstream. 502 </t> 503 <t> 504 For byte ranges, a sender &SHOULD; indicate the complete length of the 505 representation from which the range has been extracted unless the complete 506 length is unknown or difficult to determine. An asterisk character ("*") in 507 place of the complete-length indicates that the representation length was 508 unknown when the header field was generated. 509 </t> 510 <t> 511 A Content-Range field value with a <x:ref>byte-range-resp</x:ref> that has 512 a <x:ref>last-byte-pos</x:ref> value less than its 513 <x:ref>first-byte-pos</x:ref> value, or a <x:ref>complete-length</x:ref> 514 value less than or equal to its <x:ref>last-byte-pos</x:ref> value, is 515 invalid. The recipient of an invalid <x:ref>Content-Range</x:ref> &MUST-NOT; 516 attempt to recombine the received content with a stored representation. 517 </t> 518 <t> 519 A server generating a <x:ref>206 (Partial Content)</x:ref> response to a 520 byte range request &MUST; send, in each body-part of a multipart response 521 or in the header block of a single part response, a Content-Range header 522 field containing a <x:ref>byte-range-resp</x:ref> value that reflects the 523 corresponding range being sent. The following example would apply 524 when the complete length of the selected representation is known by the 525 sender to be 1234 bytes: 526 </t> 527 <figure><artwork type="example"> 528 Content-Range: bytes 42-1233/1234 529 </artwork></figure> 530 <t> 531 or this second example would apply when the complete length is unknown: 532 </t> 533 <figure><artwork type="example"> 534 Content-Range: bytes 42-1233/* 535 </artwork></figure> 536 <t> 537 A server generating a <x:ref>416 (Range Not Satisfiable)</x:ref> response 538 to a byte range request &SHOULD; send a Content-Range header field with an 539 <x:ref>unsatisfied-range</x:ref> value, as in the following example: 540 </t> 541 <figure><artwork type="example"> 542 Content-Range: bytes */1234 543 </artwork></figure> 544 <t> 545 The complete-length in a 416 response indicates the current length of the 546 selected representation, which will be known by the server generating the 547 response because that is how it determined the range to be unsatisfiable. 548 </t> 549 <t> 550 The "Content-Range" header field has no meaning for status codes that do 551 not explicitly describe its semantic. For this specification, only the 552 <x:ref>206 (Partial Content)</x:ref> and 553 <x:ref>416 (Range Not Satisfiable)</x:ref> status codes describe a meaning 554 for Content-Range. 555 </t> 556 <t> 557 More examples of Content-Range values, assuming that the representation 538 558 contains a total of 1234 bytes: 539 559 <list style="symbols"> … … 541 561 The first 500 bytes: 542 562 <figure><artwork type="example" x:indent-with=" "> 543 bytes 0-499/1234563 Content-Range: bytes 0-499/1234 544 564 </artwork></figure> 545 565 </t> … … 547 567 The second 500 bytes: 548 568 <figure><artwork type="example" x:indent-with=" "> 549 bytes 500-999/1234569 Content-Range: bytes 500-999/1234 550 570 </artwork></figure> 551 571 </t> … … 553 573 All except for the first 500 bytes: 554 574 <figure><artwork type="example" x:indent-with=" "> 555 bytes 500-1233/1234575 Content-Range: bytes 500-1233/1234 556 576 </artwork></figure> 557 577 </t> … … 559 579 The last 500 bytes: 560 580 <figure><artwork type="example" x:indent-with=" "> 561 bytes 734-1233/1234581 Content-Range: bytes 734-1233/1234 562 582 </artwork></figure> 563 583 </t> … … 766 786 retrieval of large representations. A server &MUST; ignore a Range header 767 787 field received with a request method other than GET. 788 </t> 789 <t> 790 An origin server &MUST; ignore a <x:ref>Range</x:ref> header field that 791 contains a range unit it does not understand. A proxy &MAY; either discard 792 a <x:ref>Range</x:ref> header field that contains a range unit it does not 793 understand or pass it to the next inbound server when forwarding the 794 request. 768 795 </t> 769 796 <t> … … 868 895 <t> 869 896 The registration procedure for HTTP Range Specifiers is defined by 870 <xref target="range. specifier.registry"/> of this document.897 <xref target="range.unit.registry"/> of this document. 871 898 </t> 872 899 <t> … … 1315 1342 <t> 1316 1343 This specification introduces a Range Specifier Registry. 1317 (<xref target="range. specifier.registry"/>)1344 (<xref target="range.unit.registry"/>) 1318 1345 </t> 1319 1346 </section> … … 1368 1395 <x:ref>Accept-Ranges</x:ref> = acceptable-ranges 1369 1396 1370 <x:ref>Content-Range</x:ref> = byte-content-range -spec / other-content-range-spec1397 <x:ref>Content-Range</x:ref> = byte-content-range / other-content-range 1371 1398 1372 1399 <x:ref>HTTP-date</x:ref> = <HTTP-date, defined in [Part2], Section 7.1.1.1> … … 1381 1408 range-unit ] ) ) / "none" 1382 1409 1383 <x:ref>byte-content-range-spec</x:ref> = bytes-unit SP byte-range-resp-spec "/" ( 1384 instance-length / "*" ) 1385 <x:ref>byte-range-resp-spec</x:ref> = ( first-byte-pos "-" last-byte-pos ) / "*" 1410 <x:ref>byte-content-range</x:ref> = bytes-unit SP ( byte-range-resp "/" 1411 unsatisfied-range ) 1412 <x:ref>byte-range</x:ref> = first-byte-pos "-" last-byte-pos 1413 <x:ref>byte-range-resp</x:ref> = byte-range "/" ( complete-length / "*" ) 1386 1414 <x:ref>byte-range-set</x:ref> = *( "," OWS ) ( byte-range-spec / 1387 1415 suffix-byte-range-spec ) *( OWS "," [ OWS ( byte-range-spec / … … 1391 1419 <x:ref>bytes-unit</x:ref> = "bytes" 1392 1420 1421 <x:ref>complete-length</x:ref> = 1*DIGIT 1422 1393 1423 <x:ref>entity-tag</x:ref> = <entity-tag, defined in [Part4], Section 2.3> 1394 1424 1395 1425 <x:ref>first-byte-pos</x:ref> = 1*DIGIT 1396 1426 1397 <x:ref>instance-length</x:ref> = 1*DIGIT1398 1399 1427 <x:ref>last-byte-pos</x:ref> = 1*DIGIT 1400 1428 1401 <x:ref>other-content-range -spec</x:ref> = other-range-unit SP other-range-resp-spec1402 <x:ref>other-range-resp -spec</x:ref> = *CHAR1429 <x:ref>other-content-range</x:ref> = other-range-unit SP other-range-resp 1430 <x:ref>other-range-resp</x:ref> = *CHAR 1403 1431 <x:ref>other-range-set</x:ref> = 1*CHAR 1404 1432 <x:ref>other-range-unit</x:ref> = token … … 1411 1439 1412 1440 <x:ref>token</x:ref> = <token, defined in [Part1], Section 3.2.6> 1441 1442 <x:ref>unsatisfied-range</x:ref> = "*/" complete-length 1413 1443 </artwork> 1414 1444 </figure>
Note: See TracChangeset
for help on using the changeset viewer.