Changeset 229 for draft-ietf-httpbis/latest/p5-range.html
- Timestamp:
- 02/03/08 17:21:57 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
draft-ietf-httpbis/latest/p5-range.html
r228 r229 554 554 <p id="rfc.section.2.p.1">This specification uses the ABNF syntax defined in <a href="p1-messaging.html#notation.abnf" title="Augmented BNF">Section 2.1</a> of <a href="#Part1" id="rfc.xref.Part1.1"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a> and the core rules defined in <a href="p1-messaging.html#basic.rules" title="Basic Rules">Section 2.2</a> of <a href="#Part1" id="rfc.xref.Part1.2"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>: <span class="comment">[abnf.dep: ABNF syntax and basic rules will be adopted from RFC 5234, see <<a href="http://tools.ietf.org/wg/httpbis/trac/ticket/36">http://tools.ietf.org/wg/httpbis/trac/ticket/36</a>>.]</span> 555 555 </p> 556 <div id="rfc.figure.u.1"></div><pre class="inline"> DIGIT= <DIGIT, defined in <a href="#Part1" id="rfc.xref.Part1.3"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>, <a href="p1-messaging.html#basic.rules" title="Basic Rules">Section 2.2</a>>557 SP= <SP, defined in <a href="#Part1" id="rfc.xref.Part1.4"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>, <a href="p1-messaging.html#basic.rules" title="Basic Rules">Section 2.2</a>>558 </pre><div id="rfc.figure.u.2"></div><pre class="inline"> token= <token, defined in <a href="#Part1" id="rfc.xref.Part1.5"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>, <a href="p1-messaging.html#basic.rules" title="Basic Rules">Section 2.2</a>>556 <div id="rfc.figure.u.1"></div><pre class="inline"> <a href="#notation" class="smpl">DIGIT</a> = <DIGIT, defined in <a href="#Part1" id="rfc.xref.Part1.3"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>, <a href="p1-messaging.html#basic.rules" title="Basic Rules">Section 2.2</a>> 557 <a href="#notation" class="smpl">SP</a> = <SP, defined in <a href="#Part1" id="rfc.xref.Part1.4"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>, <a href="p1-messaging.html#basic.rules" title="Basic Rules">Section 2.2</a>> 558 </pre><div id="rfc.figure.u.2"></div><pre class="inline"> <a href="#notation" class="smpl">token</a> = <token, defined in <a href="#Part1" id="rfc.xref.Part1.5"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>, <a href="p1-messaging.html#basic.rules" title="Basic Rules">Section 2.2</a>> 559 559 </pre><div id="abnf.dependencies"> 560 <p id="rfc.section.2.p.4"> The ABNF rules below are defined in other parts:</p>560 <p id="rfc.section.2.p.4"> The ABNF rules below are defined in other parts:</p> 561 561 </div> 562 <div id="rfc.figure.u.3"></div><pre class="inline"> HTTP-date= <HTTP-date, defined in <a href="#Part1" id="rfc.xref.Part1.6"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>, <a href="p1-messaging.html#full.date" title="Full Date">Section 3.3.1</a>>563 </pre><div id="rfc.figure.u.4"></div><pre class="inline"> entity-tag= <entity-tag, defined in <a href="#Part4" id="rfc.xref.Part4.1"><cite title="HTTP/1.1, part 4: Conditional Requests">[Part4]</cite></a>, <a href="p4-conditional.html#entity.tags" title="Entity Tags">Section 3</a>>562 <div id="rfc.figure.u.3"></div><pre class="inline"> <a href="#abnf.dependencies" class="smpl">HTTP-date</a> = <HTTP-date, defined in <a href="#Part1" id="rfc.xref.Part1.6"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>, <a href="p1-messaging.html#full.date" title="Full Date">Section 3.3.1</a>> 563 </pre><div id="rfc.figure.u.4"></div><pre class="inline"> <a href="#abnf.dependencies" class="smpl">entity-tag</a> = <entity-tag, defined in <a href="#Part4" id="rfc.xref.Part4.1"><cite title="HTTP/1.1, part 4: Conditional Requests">[Part4]</cite></a>, <a href="p4-conditional.html#entity.tags" title="Entity Tags">Section 3</a>> 564 564 </pre><h1 id="rfc.section.3"><a href="#rfc.section.3">3.</a> <a id="range.units" href="#range.units">Range Units</a></h1> 565 565 <p id="rfc.section.3.p.1">HTTP/1.1 allows a client to request that only part (a range of) the response entity be included within the response. HTTP/1.1 566 566 uses range units in the Range (<a href="#header.range" id="rfc.xref.header.range.1" title="Range">Section 6.4</a>) and Content-Range (<a href="#header.content-range" id="rfc.xref.header.content-range.1" title="Content-Range">Section 6.2</a>) header fields. An entity can be broken down into subranges according to various structural units. 567 567 </p> 568 <div id="rfc.figure.u.5"></div><pre class="inline"><span id="rfc.iref.g.1"></span><span id="rfc.iref.g.2"></span><span id="rfc.iref.g.3"></span> range-unit = bytes-unit | other-range-unit569 bytes-unit= "bytes"570 other-range-unit = token568 <div id="rfc.figure.u.5"></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> 569 <a href="#range.units" class="smpl">bytes-unit</a> = "bytes" 570 <a href="#range.units" class="smpl">other-range-unit</a> = <a href="#notation" class="smpl">token</a> 571 571 </pre><p id="rfc.section.3.p.3">The only range unit defined by HTTP/1.1 is "bytes". HTTP/1.1 implementations <em class="bcp14">MAY</em> ignore ranges specified using other units. 572 572 </p> … … 631 631 <h2 id="rfc.section.6.1"><a href="#rfc.section.6.1">6.1</a> <a id="header.accept-ranges" href="#header.accept-ranges">Accept-Ranges</a></h2> 632 632 <p id="rfc.section.6.1.p.1">The Accept-Ranges response-header field allows the server to indicate its acceptance of range requests for a resource:</p> 633 <div id="rfc.figure.u.6"></div><pre class="inline"><span id="rfc.iref.g.4"></span><span id="rfc.iref.g.5"></span> Accept-Ranges = "Accept-Ranges" ":" acceptable-ranges634 acceptable-ranges = 1#range-unit| "none"633 <div id="rfc.figure.u.6"></div><pre class="inline"><span id="rfc.iref.g.4"></span><span id="rfc.iref.g.5"></span> <a href="#header.accept-ranges" class="smpl">Accept-Ranges</a> = "Accept-Ranges" ":" <a href="#header.accept-ranges" class="smpl">acceptable-ranges</a> 634 <a href="#header.accept-ranges" class="smpl">acceptable-ranges</a> = 1#<a href="#range.units" class="smpl">range-unit</a> | "none" 635 635 </pre><p id="rfc.section.6.1.p.3">Origin servers that accept byte-range requests <em class="bcp14">MAY</em> send 636 636 </p> … … 648 648 should be applied. Range units are defined in <a href="#range.units" title="Range Units">Section 3</a>. 649 649 </p> 650 <div id="rfc.figure.u.9"></div><pre class="inline"><span id="rfc.iref.g.6"></span><span id="rfc.iref.g.7"></span><span id="rfc.iref.g.8"></span><span id="rfc.iref.g.9"></span><span id="rfc.iref.g.10"></span> Content-Range = "Content-Range" ":" content-range-spec650 <div id="rfc.figure.u.9"></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> <a href="#header.content-range" class="smpl">Content-Range</a> = "Content-Range" ":" <a href="#header.content-range" class="smpl">content-range-spec</a> 651 651 652 content-range-spec = byte-content-range-spec653 byte-content-range-spec = bytes-unit SP654 byte-range-resp-spec"/"655 ( instance-length| "*" )652 <a href="#header.content-range" class="smpl">content-range-spec</a> = <a href="#header.content-range" class="smpl">byte-content-range-spec</a> 653 <a href="#header.content-range" class="smpl">byte-content-range-spec</a> = <a href="#range.units" class="smpl">bytes-unit</a> <a href="#notation" class="smpl">SP</a> 654 <a href="#header.content-range" class="smpl">byte-range-resp-spec</a> "/" 655 ( <a href="#header.content-range" class="smpl">instance-length</a> | "*" ) 656 656 657 byte-range-resp-spec = (first-byte-pos "-" last-byte-pos)657 <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>) 658 658 | "*" 659 instance-length = 1*DIGIT659 <a href="#header.content-range" class="smpl">instance-length</a> = 1*<a href="#notation" class="smpl">DIGIT</a> 660 660 </pre><p id="rfc.section.6.2.p.3">The header <em class="bcp14">SHOULD</em> indicate the total length of the full entity-body, unless this length is unknown or difficult to determine. The asterisk "*" 661 661 character means that the instance-length is unknown at the time when the response was generated. … … 725 725 send me the part(s) that I am missing; otherwise, send me the entire new entity'. 726 726 </p> 727 <div id="rfc.figure.u.15"></div><pre class="inline"><span id="rfc.iref.g.11"></span> If-Range = "If-Range" ":" ( entity-tag | HTTP-date)727 <div id="rfc.figure.u.15"></div><pre class="inline"><span id="rfc.iref.g.11"></span> <a href="#header.if-range" class="smpl">If-Range</a> = "If-Range" ":" ( <a href="#abnf.dependencies" class="smpl">entity-tag</a> | <a href="#abnf.dependencies" class="smpl">HTTP-date</a> ) 728 728 </pre><p id="rfc.section.6.3.p.4">If the client has no entity tag for an entity, but does have a Last-Modified date, it <em class="bcp14">MAY</em> use that date in an If-Range header. (The server can distinguish between a valid HTTP-date and any form of entity-tag by examining 729 729 no more than two characters.) The If-Range header <em class="bcp14">SHOULD</em> only be used together with a Range header, and <em class="bcp14">MUST</em> be ignored if the request does not include a Range header, or if the server does not support the sub-range operation. … … 740 740 </p> 741 741 <p id="rfc.section.6.4.1.p.2">Byte range specifications in HTTP apply to the sequence of bytes in the entity-body (not necessarily the same as the message-body).</p> 742 <p id="rfc.section.6.4.1.p.3">A byte range operation <em class="bcp14">MAY</em> specify a single range of bytes, or a set of ranges within a single entity. 743 </p> 744 <div id="rfc.figure.u.16"></div><pre class="inline"><span id="rfc.iref.g.12"></span><span id="rfc.iref.g.13"></span><span id="rfc.iref.g.14"></span><span id="rfc.iref.g.15"></span><span id="rfc.iref.g.16"></span><span id="rfc.iref.g.17"></span> ranges-specifier = byte-ranges-specifier 745 byte-ranges-specifier = bytes-unit "=" byte-range-set 746 byte-range-set = 1#( byte-range-spec | suffix-byte-range-spec ) 747 byte-range-spec = first-byte-pos "-" [last-byte-pos] 748 first-byte-pos = 1*DIGIT 749 last-byte-pos = 1*DIGIT 742 <div id="rule.ranges-specifier"> 743 <p id="rfc.section.6.4.1.p.3"> A byte range operation <em class="bcp14">MAY</em> specify a single range of bytes, or a set of ranges within a single entity. 744 </p> 745 </div> 746 <div id="rfc.figure.u.16"></div><pre class="inline"><span id="rfc.iref.g.12"></span><span id="rfc.iref.g.13"></span><span id="rfc.iref.g.14"></span><span id="rfc.iref.g.15"></span><span id="rfc.iref.g.16"></span><span id="rfc.iref.g.17"></span> <a href="#rule.ranges-specifier" class="smpl">ranges-specifier</a> = <a href="#rule.ranges-specifier" class="smpl">byte-ranges-specifier</a> 747 <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> 748 <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> ) 749 <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>] 750 <a href="#rule.ranges-specifier" class="smpl">first-byte-pos</a> = 1*<a href="#notation" class="smpl">DIGIT</a> 751 <a href="#rule.ranges-specifier" class="smpl">last-byte-pos</a> = 1*<a href="#notation" class="smpl">DIGIT</a> 750 752 </pre><p id="rfc.section.6.4.1.p.5">The first-byte-pos value in a byte-range-spec gives the byte-offset of the first byte in a range. The last-byte-pos value 751 753 gives the byte-offset of the last byte in the range; that is, the byte positions specified are inclusive. Byte offsets start … … 759 761 </p> 760 762 <p id="rfc.section.6.4.1.p.8">By its choice of last-byte-pos, a client can limit the number of bytes retrieved without knowing the size of the entity.</p> 761 <div id="rfc.figure.u.17"></div><pre class="inline"><span id="rfc.iref.g.18"></span><span id="rfc.iref.g.19"></span> suffix-byte-range-spec = "-" suffix-length762 suffix-length = 1*DIGIT763 <div id="rfc.figure.u.17"></div><pre class="inline"><span id="rfc.iref.g.18"></span><span id="rfc.iref.g.19"></span> <a href="#rule.ranges-specifier" class="smpl">suffix-byte-range-spec</a> = "-" <a href="#rule.ranges-specifier" class="smpl">suffix-length</a> 764 <a href="#rule.ranges-specifier" class="smpl">suffix-length</a> = 1*<a href="#notation" class="smpl">DIGIT</a> 763 765 </pre><p id="rfc.section.6.4.1.p.10">A suffix-byte-range-spec is used to specify the suffix of the entity-body, of a length given by the suffix-length value. (That 764 766 is, this form specifies the last N bytes of an entity-body.) If the entity is shorter than the specified suffix-length, the … … 783 785 to the entity returned as the result of the request: 784 786 </p> 785 <div id="rfc.figure.u.18"></div><pre class="inline"><span id="rfc.iref.g.20"></span> Range = "Range" ":" ranges-specifier787 <div id="rfc.figure.u.18"></div><pre class="inline"><span id="rfc.iref.g.20"></span> <a href="#range.retrieval.requests" class="smpl">Range</a> = "Range" ":" <a href="#rule.ranges-specifier" class="smpl">ranges-specifier</a> 786 788 </pre><p id="rfc.section.6.4.2.p.3">A server <em class="bcp14">MAY</em> ignore the Range header. However, HTTP/1.1 origin servers and intermediate caches ought to support byte ranges when possible, 787 789 since Range supports efficient recovery from partially failed transfers, and supports efficient partial retrieval of large
Note: See TracChangeset
for help on using the changeset viewer.