source: draft-ietf-httpbis/02/draft-ietf-httpbis-p5-range-02.txt @ 377

Last change on this file since 377 was 219, checked in by julian.reschke@…, 12 years ago

Prepare for release of draft 02 on Monday, Feb 24.

  • Property svn:executable set to *
File size: 41.2 KB
Line 
1
2
3
4Network Working Group                                   R. Fielding, Ed.
5Internet-Draft                                              Day Software
6Obsoletes: 2616 (if approved)                                  J. Gettys
7Intended status: Standards Track                    One Laptop per Child
8Expires: August 27, 2008                                        J. Mogul
9                                                                      HP
10                                                              H. Frystyk
11                                                               Microsoft
12                                                             L. Masinter
13                                                           Adobe Systems
14                                                                P. Leach
15                                                               Microsoft
16                                                          T. Berners-Lee
17                                                                 W3C/MIT
18                                                           Y. Lafon, Ed.
19                                                                     W3C
20                                                         J. Reschke, Ed.
21                                                              greenbytes
22                                                       February 24, 2008
23
24
25         HTTP/1.1, part 5: Range Requests and Partial Responses
26                     draft-ietf-httpbis-p5-range-02
27
28Status of this Memo
29
30   By submitting this Internet-Draft, each author represents that any
31   applicable patent or other IPR claims of which he or she is aware
32   have been or will be disclosed, and any of which he or she becomes
33   aware will be disclosed, in accordance with Section 6 of BCP 79.
34
35   Internet-Drafts are working documents of the Internet Engineering
36   Task Force (IETF), its areas, and its working groups.  Note that
37   other groups may also distribute working documents as Internet-
38   Drafts.
39
40   Internet-Drafts are draft documents valid for a maximum of six months
41   and may be updated, replaced, or obsoleted by other documents at any
42   time.  It is inappropriate to use Internet-Drafts as reference
43   material or to cite them other than as "work in progress."
44
45   The list of current Internet-Drafts can be accessed at
46   http://www.ietf.org/ietf/1id-abstracts.txt.
47
48   The list of Internet-Draft Shadow Directories can be accessed at
49   http://www.ietf.org/shadow.html.
50
51   This Internet-Draft will expire on August 27, 2008.
52
53
54
55Fielding, et al.         Expires August 27, 2008                [Page 1]
56
57Internet-Draft              HTTP/1.1, Part 5               February 2008
58
59
60Copyright Notice
61
62   Copyright (C) The IETF Trust (2008).
63
64Abstract
65
66   The Hypertext Transfer Protocol (HTTP) is an application-level
67   protocol for distributed, collaborative, hypermedia information
68   systems.  HTTP has been in use by the World Wide Web global
69   information initiative since 1990.  This document is Part 5 of the
70   seven-part specification that defines the protocol referred to as
71   "HTTP/1.1" and, taken together, obsoletes RFC 2616.  Part 5 defines
72   range-specific requests and the rules for constructing and combining
73   responses to those requests.
74
75Editorial Note (To be removed by RFC Editor)
76
77   Discussion of this draft should take place on the HTTPBIS working
78   group mailing list (ietf-http-wg@w3.org).  The current issues list is
79   at <http://www.tools.ietf.org/wg/httpbis/trac/report/11> and related
80   documents (including fancy diffs) can be found at
81   <http://www.tools.ietf.org/wg/httpbis/>.
82
83   This draft incorporates those issue resolutions that were either
84   collected in the original RFC2616 errata list
85   (<http://purl.org/NET/http-errata>), or which were agreed upon on the
86   mailing list between October 2006 and November 2007 (as published in
87   "draft-lafon-rfc2616bis-03").
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111Fielding, et al.         Expires August 27, 2008                [Page 2]
112
113Internet-Draft              HTTP/1.1, Part 5               February 2008
114
115
116Table of Contents
117
118   1.  Introduction . . . . . . . . . . . . . . . . . . . . . . . . .  4
119     1.1.  Requirements . . . . . . . . . . . . . . . . . . . . . . .  4
120   2.  Notational Conventions and Generic Grammar . . . . . . . . . .  4
121   3.  Range Units  . . . . . . . . . . . . . . . . . . . . . . . . .  5
122   4.  Status Code Definitions  . . . . . . . . . . . . . . . . . . .  5
123     4.1.  206 Partial Content  . . . . . . . . . . . . . . . . . . .  5
124     4.2.  416 Requested Range Not Satisfiable  . . . . . . . . . . .  6
125   5.  Combining Byte Ranges  . . . . . . . . . . . . . . . . . . . .  6
126   6.  Header Field Definitions . . . . . . . . . . . . . . . . . . .  7
127     6.1.  Accept-Ranges  . . . . . . . . . . . . . . . . . . . . . .  7
128     6.2.  Content-Range  . . . . . . . . . . . . . . . . . . . . . .  8
129     6.3.  If-Range . . . . . . . . . . . . . . . . . . . . . . . . . 10
130     6.4.  Range  . . . . . . . . . . . . . . . . . . . . . . . . . . 10
131       6.4.1.  Byte Ranges  . . . . . . . . . . . . . . . . . . . . . 10
132       6.4.2.  Range Retrieval Requests . . . . . . . . . . . . . . . 12
133   7.  IANA Considerations  . . . . . . . . . . . . . . . . . . . . . 13
134   8.  Security Considerations  . . . . . . . . . . . . . . . . . . . 13
135   9.  Acknowledgments  . . . . . . . . . . . . . . . . . . . . . . . 13
136   10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 13
137     10.1. Normative References . . . . . . . . . . . . . . . . . . . 13
138     10.2. Informative References . . . . . . . . . . . . . . . . . . 14
139   Appendix A.  Internet Media Type multipart/byteranges  . . . . . . 14
140   Appendix B.  Compatibility with Previous Versions  . . . . . . . . 16
141     B.1.  Changes from RFC 2068  . . . . . . . . . . . . . . . . . . 16
142     B.2.  Changes from RFC 2616  . . . . . . . . . . . . . . . . . . 17
143   Appendix C.  Change Log (to be removed by RFC Editor before
144                publication)  . . . . . . . . . . . . . . . . . . . . 17
145     C.1.  Since RFC2616  . . . . . . . . . . . . . . . . . . . . . . 17
146     C.2.  Since draft-ietf-httpbis-p5-range-00 . . . . . . . . . . . 17
147     C.3.  Since draft-ietf-httpbis-p5-range-01 . . . . . . . . . . . 17
148   Index  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
149   Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 19
150   Intellectual Property and Copyright Statements . . . . . . . . . . 22
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167Fielding, et al.         Expires August 27, 2008                [Page 3]
168
169Internet-Draft              HTTP/1.1, Part 5               February 2008
170
171
1721.  Introduction
173
174   HTTP clients often encounter interrupted data transfers as a result
175   of cancelled requests or dropped connections.  When a cache has
176   stored a partial representation, it is desirable to request the
177   remainder of that representation in a subsequent request rather than
178   transfer the entire representation.  There are also a number of Web
179   applications that benefit from being able to request only a subset of
180   a larger representation, such as a single page of a very large
181   document or only part of an image to be rendered by a device with
182   limited local storage.
183
184   This document defines HTTP/1.1 range requests, partial responses, and
185   the multipart/byteranges media type.  The protocol for range requests
186   is an OPTIONAL feature of HTTP, designed so resources or recipients
187   that do not implement this feature can respond as if it is a normal
188   GET request without impacting interoperability.  Partial responses
189   are indicated by a distinct status code to not be mistaken for full
190   responses by intermediate caches that might not implement the
191   feature.
192
193   Although the HTTP range request mechanism is designed to allow for
194   extensible range types, this specification only defines requests for
195   byte ranges.
196
1971.1.  Requirements
198
199   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
200   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
201   document are to be interpreted as described in [RFC2119].
202
203   An implementation is not compliant if it fails to satisfy one or more
204   of the MUST or REQUIRED level requirements for the protocols it
205   implements.  An implementation that satisfies all the MUST or
206   REQUIRED level and all the SHOULD level requirements for its
207   protocols is said to be "unconditionally compliant"; one that
208   satisfies all the MUST level requirements but not all the SHOULD
209   level requirements for its protocols is said to be "conditionally
210   compliant."
211
212
2132.  Notational Conventions and Generic Grammar
214
215   This specification uses the ABNF syntax defined in Section 2.1 of
216   [Part1] and the core rules defined in Section 2.2 of [Part1]:
217   [[abnf.dep: ABNF syntax and basic rules will be adopted from RFC
218   5234, see <http://tools.ietf.org/wg/httpbis/trac/ticket/36>.]]
219
220
221
222
223Fielding, et al.         Expires August 27, 2008                [Page 4]
224
225Internet-Draft              HTTP/1.1, Part 5               February 2008
226
227
228     DIGIT      = <DIGIT, defined in [Part1], Section 2.2>
229     SP         = <SP, defined in [Part1], Section 2.2>
230
231
232     token      = <token, defined in [Part1], Section 2.2>
233
234   The ABNF rules below are defined in other parts:
235
236     HTTP-date  = <HTTP-date, defined in [Part1], Section 3.3.1>
237
238
239     entity-tag = <entity-tag, defined in [Part4], Section 3>
240
241
2423.  Range Units
243
244   HTTP/1.1 allows a client to request that only part (a range of) the
245   response entity be included within the response.  HTTP/1.1 uses range
246   units in the Range (Section 6.4) and Content-Range (Section 6.2)
247   header fields.  An entity can be broken down into subranges according
248   to various structural units.
249
250     range-unit       = bytes-unit | other-range-unit
251     bytes-unit       = "bytes"
252     other-range-unit = token
253
254   The only range unit defined by HTTP/1.1 is "bytes".  HTTP/1.1
255   implementations MAY ignore ranges specified using other units.
256
257   HTTP/1.1 has been designed to allow implementations of applications
258   that do not depend on knowledge of ranges.
259
260
2614.  Status Code Definitions
262
2634.1.  206 Partial Content
264
265   The server has fulfilled the partial GET request for the resource.
266   The request MUST have included a Range header field (Section 6.4)
267   indicating the desired range, and MAY have included an If-Range
268   header field (Section 6.3) to make the request conditional.
269
270   The response MUST include the following header fields:
271
272   o  Either a Content-Range header field (Section 6.2) indicating the
273      range included with this response, or a multipart/byteranges
274      Content-Type including Content-Range fields for each part.  If a
275      Content-Length header field is present in the response, its value
276
277
278
279Fielding, et al.         Expires August 27, 2008                [Page 5]
280
281Internet-Draft              HTTP/1.1, Part 5               February 2008
282
283
284      MUST match the actual number of OCTETs transmitted in the message-
285      body.
286
287   o  Date
288
289   o  ETag and/or Content-Location, if the header would have been sent
290      in a 200 response to the same request
291
292   o  Expires, Cache-Control, and/or Vary, if the field-value might
293      differ from that sent in any previous response for the same
294      variant
295
296   If the 206 response is the result of an If-Range request, the
297   response SHOULD NOT include other entity-headers.  Otherwise, the
298   response MUST include all of the entity-headers that would have been
299   returned with a 200 (OK) response to the same request.
300
301   A cache MUST NOT combine a 206 response with other previously cached
302   content if the ETag or Last-Modified headers do not match exactly,
303   see Section 5.
304
305   A cache that does not support the Range and Content-Range headers
306   MUST NOT cache 206 (Partial Content) responses.
307
3084.2.  416 Requested Range Not Satisfiable
309
310   A server SHOULD return a response with this status code if a request
311   included a Range request-header field (Section 6.4), and none of the
312   range-specifier values in this field overlap the current extent of
313   the selected resource, and the request did not include an If-Range
314   request-header field.  (For byte-ranges, this means that the first-
315   byte-pos of all of the byte-range-spec values were greater than the
316   current length of the selected resource.)
317
318   When this status code is returned for a byte-range request, the
319   response SHOULD include a Content-Range entity-header field
320   specifying the current length of the selected resource (see
321   Section 6.2).  This response MUST NOT use the multipart/byteranges
322   content-type.
323
324
3255.  Combining Byte Ranges
326
327   A response might transfer only a subrange of the bytes of an entity-
328   body, either because the request included one or more Range
329   specifications, or because a connection was broken prematurely.
330   After several such transfers, a cache might have received several
331   ranges of the same entity-body.
332
333
334
335Fielding, et al.         Expires August 27, 2008                [Page 6]
336
337Internet-Draft              HTTP/1.1, Part 5               February 2008
338
339
340   If a cache has a stored non-empty set of subranges for an entity, and
341   an incoming response transfers another subrange, the cache MAY
342   combine the new subrange with the existing set if both the following
343   conditions are met:
344
345   o  Both the incoming response and the cache entry have a cache
346      validator.
347
348   o  The two cache validators match using the strong comparison
349      function (see Section 5 of [Part4]).
350
351   If either requirement is not met, the cache MUST use only the most
352   recent partial response (based on the Date values transmitted with
353   every response, and using the incoming response if these values are
354   equal or missing), and MUST discard the other partial information.
355
356
3576.  Header Field Definitions
358
359   This section defines the syntax and semantics of HTTP/1.1 header
360   fields related to range requests and partial responses.
361
362   For entity-header fields, both sender and recipient refer to either
363   the client or the server, depending on who sends and who receives the
364   entity.
365
3666.1.  Accept-Ranges
367
368   The Accept-Ranges response-header field allows the server to indicate
369   its acceptance of range requests for a resource:
370
371     Accept-Ranges     = "Accept-Ranges" ":" acceptable-ranges
372     acceptable-ranges = 1#range-unit | "none"
373
374   Origin servers that accept byte-range requests MAY send
375
376          Accept-Ranges: bytes
377
378   but are not required to do so.  Clients MAY generate byte-range
379   requests without having received this header for the resource
380   involved.  Range units are defined in Section 3.
381
382   Servers that do not accept any kind of range request for a resource
383   MAY send
384
385          Accept-Ranges: none
386
387   to advise the client not to attempt a range request.
388
389
390
391Fielding, et al.         Expires August 27, 2008                [Page 7]
392
393Internet-Draft              HTTP/1.1, Part 5               February 2008
394
395
3966.2.  Content-Range
397
398   The Content-Range entity-header is sent with a partial entity-body to
399   specify where in the full entity-body the partial body should be
400   applied.  Range units are defined in Section 3.
401
402     Content-Range = "Content-Range" ":" content-range-spec
403
404     content-range-spec      = byte-content-range-spec
405     byte-content-range-spec = bytes-unit SP
406                               byte-range-resp-spec "/"
407                               ( instance-length | "*" )
408
409     byte-range-resp-spec = (first-byte-pos "-" last-byte-pos)
410                                    | "*"
411     instance-length           = 1*DIGIT
412
413   The header SHOULD indicate the total length of the full entity-body,
414   unless this length is unknown or difficult to determine.  The
415   asterisk "*" character means that the instance-length is unknown at
416   the time when the response was generated.
417
418   Unlike byte-ranges-specifier values (see Section 6.4.1), a byte-
419   range-resp-spec MUST only specify one range, and MUST contain
420   absolute byte positions for both the first and last byte of the
421   range.
422
423   A byte-content-range-spec with a byte-range-resp-spec whose last-
424   byte-pos value is less than its first-byte-pos value, or whose
425   instance-length value is less than or equal to its last-byte-pos
426   value, is invalid.  The recipient of an invalid byte-content-range-
427   spec MUST ignore it and any content transferred along with it.
428
429   A server sending a response with status code 416 (Requested range not
430   satisfiable) SHOULD include a Content-Range field with a byte-range-
431   resp-spec of "*".  The instance-length specifies the current length
432   of the selected resource.  A response with status code 206 (Partial
433   Content) MUST NOT include a Content-Range field with a byte-range-
434   resp-spec of "*".
435
436   Examples of byte-content-range-spec values, assuming that the entity
437   contains a total of 1234 bytes:
438
439   o  The first 500 bytes:
440
441      bytes 0-499/1234
442
443
444
445
446
447Fielding, et al.         Expires August 27, 2008                [Page 8]
448
449Internet-Draft              HTTP/1.1, Part 5               February 2008
450
451
452   o  The second 500 bytes:
453
454      bytes 500-999/1234
455
456   o  All except for the first 500 bytes:
457
458      bytes 500-1233/1234
459
460   o  The last 500 bytes:
461
462      bytes 734-1233/1234
463
464   When an HTTP message includes the content of a single range (for
465   example, a response to a request for a single range, or to a request
466   for a set of ranges that overlap without any holes), this content is
467   transmitted with a Content-Range header, and a Content-Length header
468   showing the number of bytes actually transferred.  For example,
469
470       HTTP/1.1 206 Partial Content
471       Date: Wed, 15 Nov 1995 06:25:24 GMT
472       Last-Modified: Wed, 15 Nov 1995 04:58:08 GMT
473       Content-Range: bytes 21010-47021/47022
474       Content-Length: 26012
475       Content-Type: image/gif
476
477   When an HTTP message includes the content of multiple ranges (for
478   example, a response to a request for multiple non-overlapping
479   ranges), these are transmitted as a multipart message.  The multipart
480   media type used for this purpose is "multipart/byteranges" as defined
481   in Appendix A.  See Appendix B.1 for a compatibility issue.
482
483   A response to a request for a single range MUST NOT be sent using the
484   multipart/byteranges media type.  A response to a request for
485   multiple ranges, whose result is a single range, MAY be sent as a
486   multipart/byteranges media type with one part.  A client that cannot
487   decode a multipart/byteranges message MUST NOT ask for multiple byte-
488   ranges in a single request.
489
490   When a client requests multiple byte-ranges in one request, the
491   server SHOULD return them in the order that they appeared in the
492   request.
493
494   If the server ignores a byte-range-spec because it is syntactically
495   invalid, the server SHOULD treat the request as if the invalid Range
496   header field did not exist.  (Normally, this means return a 200
497   response containing the full entity).
498
499   If the server receives a request (other than one including an If-
500
501
502
503Fielding, et al.         Expires August 27, 2008                [Page 9]
504
505Internet-Draft              HTTP/1.1, Part 5               February 2008
506
507
508   Range request-header field) with an unsatisfiable Range request-
509   header field (that is, all of whose byte-range-spec values have a
510   first-byte-pos value greater than the current length of the selected
511   resource), it SHOULD return a response code of 416 (Requested range
512   not satisfiable) (Section 4.2).
513
514      Note: clients cannot depend on servers to send a 416 (Requested
515      range not satisfiable) response instead of a 200 (OK) response for
516      an unsatisfiable Range request-header, since not all servers
517      implement this request-header.
518
5196.3.  If-Range
520
521   If a client has a partial copy of an entity in its cache, and wishes
522   to have an up-to-date copy of the entire entity in its cache, it
523   could use the Range request-header with a conditional GET (using
524   either or both of If-Unmodified-Since and If-Match.)  However, if the
525   condition fails because the entity has been modified, the client
526   would then have to make a second request to obtain the entire current
527   entity-body.
528
529   The If-Range header allows a client to "short-circuit" the second
530   request.  Informally, its meaning is `if the entity is unchanged,
531   send me the part(s) that I am missing; otherwise, send me the entire
532   new entity'.
533
534     If-Range = "If-Range" ":" ( entity-tag | HTTP-date )
535
536   If the client has no entity tag for an entity, but does have a Last-
537   Modified date, it MAY use that date in an If-Range header.  (The
538   server can distinguish between a valid HTTP-date and any form of
539   entity-tag by examining no more than two characters.)  The If-Range
540   header SHOULD only be used together with a Range header, and MUST be
541   ignored if the request does not include a Range header, or if the
542   server does not support the sub-range operation.
543
544   If the entity tag given in the If-Range header matches the current
545   entity tag for the entity, then the server SHOULD provide the
546   specified sub-range of the entity using a 206 (Partial Content)
547   response.  If the entity tag does not match, then the server SHOULD
548   return the entire entity using a 200 (OK) response.
549
5506.4.  Range
551
5526.4.1.  Byte Ranges
553
554   Since all HTTP entities are represented in HTTP messages as sequences
555   of bytes, the concept of a byte range is meaningful for any HTTP
556
557
558
559Fielding, et al.         Expires August 27, 2008               [Page 10]
560
561Internet-Draft              HTTP/1.1, Part 5               February 2008
562
563
564   entity.  (However, not all clients and servers need to support byte-
565   range operations.)
566
567   Byte range specifications in HTTP apply to the sequence of bytes in
568   the entity-body (not necessarily the same as the message-body).
569
570   A byte range operation MAY specify a single range of bytes, or a set
571   of ranges within a single entity.
572
573     ranges-specifier = byte-ranges-specifier
574     byte-ranges-specifier = bytes-unit "=" byte-range-set
575     byte-range-set  = 1#( byte-range-spec | suffix-byte-range-spec )
576     byte-range-spec = first-byte-pos "-" [last-byte-pos]
577     first-byte-pos  = 1*DIGIT
578     last-byte-pos   = 1*DIGIT
579
580   The first-byte-pos value in a byte-range-spec gives the byte-offset
581   of the first byte in a range.  The last-byte-pos value gives the
582   byte-offset of the last byte in the range; that is, the byte
583   positions specified are inclusive.  Byte offsets start at zero.
584
585   If the last-byte-pos value is present, it MUST be greater than or
586   equal to the first-byte-pos in that byte-range-spec, or the byte-
587   range-spec is syntactically invalid.  The recipient of a byte-range-
588   set that includes one or more syntactically invalid byte-range-spec
589   values MUST ignore the header field that includes that byte-range-
590   set.
591
592   If the last-byte-pos value is absent, or if the value is greater than
593   or equal to the current length of the entity-body, last-byte-pos is
594   taken to be equal to one less than the current length of the entity-
595   body in bytes.
596
597   By its choice of last-byte-pos, a client can limit the number of
598   bytes retrieved without knowing the size of the entity.
599
600     suffix-byte-range-spec = "-" suffix-length
601     suffix-length = 1*DIGIT
602
603   A suffix-byte-range-spec is used to specify the suffix of the entity-
604   body, of a length given by the suffix-length value.  (That is, this
605   form specifies the last N bytes of an entity-body.)  If the entity is
606   shorter than the specified suffix-length, the entire entity-body is
607   used.
608
609   If a syntactically valid byte-range-set includes at least one byte-
610   range-spec whose first-byte-pos is less than the current length of
611   the entity-body, or at least one suffix-byte-range-spec with a non-
612
613
614
615Fielding, et al.         Expires August 27, 2008               [Page 11]
616
617Internet-Draft              HTTP/1.1, Part 5               February 2008
618
619
620   zero suffix-length, then the byte-range-set is satisfiable.
621   Otherwise, the byte-range-set is unsatisfiable.  If the byte-range-
622   set is unsatisfiable, the server SHOULD return a response with a
623   status of 416 (Requested range not satisfiable).  Otherwise, the
624   server SHOULD return a response with a status of 206 (Partial
625   Content) containing the satisfiable ranges of the entity-body.
626
627   Examples of byte-ranges-specifier values (assuming an entity-body of
628   length 10000):
629
630   o  The first 500 bytes (byte offsets 0-499, inclusive): bytes=0-499
631
632   o  The second 500 bytes (byte offsets 500-999, inclusive): bytes=500-
633      999
634
635   o  The final 500 bytes (byte offsets 9500-9999, inclusive): bytes=-
636      500
637
638   o  Or bytes=9500-
639
640   o  The first and last bytes only (bytes 0 and 9999): bytes=0-0,-1
641
642   o  Several legal but not canonical specifications of the second 500
643      bytes (byte offsets 500-999, inclusive):
644      bytes=500-600,601-999
645      bytes=500-700,601-999
646
6476.4.2.  Range Retrieval Requests
648
649   HTTP retrieval requests using conditional or unconditional GET
650   methods MAY request one or more sub-ranges of the entity, instead of
651   the entire entity, using the Range request header, which applies to
652   the entity returned as the result of the request:
653
654     Range = "Range" ":" ranges-specifier
655
656   A server MAY ignore the Range header.  However, HTTP/1.1 origin
657   servers and intermediate caches ought to support byte ranges when
658   possible, since Range supports efficient recovery from partially
659   failed transfers, and supports efficient partial retrieval of large
660   entities.
661
662   If the server supports the Range header and the specified range or
663   ranges are appropriate for the entity:
664
665   o  The presence of a Range header in an unconditional GET modifies
666      what is returned if the GET is otherwise successful.  In other
667      words, the response carries a status code of 206 (Partial Content)
668
669
670
671Fielding, et al.         Expires August 27, 2008               [Page 12]
672
673Internet-Draft              HTTP/1.1, Part 5               February 2008
674
675
676      instead of 200 (OK).
677
678   o  The presence of a Range header in a conditional GET (a request
679      using one or both of If-Modified-Since and If-None-Match, or one
680      or both of If-Unmodified-Since and If-Match) modifies what is
681      returned if the GET is otherwise successful and the condition is
682      true.  It does not affect the 304 (Not Modified) response returned
683      if the conditional is false.
684
685   In some cases, it might be more appropriate to use the If-Range
686   header (see Section 6.3) in addition to the Range header.
687
688   If a proxy that supports ranges receives a Range request, forwards
689   the request to an inbound server, and receives an entire entity in
690   reply, it SHOULD only return the requested range to its client.  It
691   SHOULD store the entire received response in its cache if that is
692   consistent with its cache allocation policies.
693
694
6957.  IANA Considerations
696
697   [[anchor2: TBD.]]
698
699
7008.  Security Considerations
701
702   No additional security considerations have been identified beyond
703   those applicable to HTTP in general [Part1].
704
705
7069.  Acknowledgments
707
708   Most of the specification of ranges is based on work originally done
709   by Ari Luotonen and John Franks, with additional input from Steve
710   Zilles, Daniel W. Connolly, Roy T. Fielding, Jim Gettys, Martin
711   Hamilton, Koen Holtman, Shel Kaplan, Paul Leach, Alex Lopez-Ortiz,
712   Larry Masinter, Jeff Mogul, Lou Montulli, David W. Morris, Luigi
713   Rizzo, and Bill Weihl.
714
715
71610.  References
717
71810.1.  Normative References
719
720   [Part1]    Fielding, R., Ed., Gettys, J., Mogul, J., Frystyk, H.,
721              Masinter, L., Leach, P., Berners-Lee, T., Lafon, Y., Ed.,
722              and J. Reschke, Ed., "HTTP/1.1, part 1: URIs, Connections,
723              and Message Parsing", draft-ietf-httpbis-p1-messaging-02
724
725
726
727Fielding, et al.         Expires August 27, 2008               [Page 13]
728
729Internet-Draft              HTTP/1.1, Part 5               February 2008
730
731
732              (work in progress), February 2008.
733
734   [Part3]    Fielding, R., Ed., Gettys, J., Mogul, J., Frystyk, H.,
735              Masinter, L., Leach, P., Berners-Lee, T., Lafon, Y., Ed.,
736              and J. Reschke, Ed., "HTTP/1.1, part 3: Message Payload
737              and Content Negotiation", draft-ietf-httpbis-p3-payload-02
738              (work in progress), February 2008.
739
740   [Part4]    Fielding, R., Ed., Gettys, J., Mogul, J., Frystyk, H.,
741              Masinter, L., Leach, P., Berners-Lee, T., Lafon, Y., Ed.,
742              and J. Reschke, Ed., "HTTP/1.1, part 4: Conditional
743              Requests", draft-ietf-httpbis-p4-conditional-02 (work in
744              progress), February 2008.
745
746   [Part6]    Fielding, R., Ed., Gettys, J., Mogul, J., Frystyk, H.,
747              Masinter, L., Leach, P., Berners-Lee, T., Lafon, Y., Ed.,
748              and J. Reschke, Ed., "HTTP/1.1, part 6: Caching",
749              draft-ietf-httpbis-p6-cache-02 (work in progress),
750              February 2008.
751
752   [RFC2046]  Freed, N. and N. Borenstein, "Multipurpose Internet Mail
753              Extensions (MIME) Part Two: Media Types", RFC 2046,
754              November 1996.
755
756   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
757              Requirement Levels", BCP 14, RFC 2119, March 1997.
758
75910.2.  Informative References
760
761   [RFC2616]  Fielding, R., Gettys, J., Mogul, J., Frystyk, H.,
762              Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext
763              Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999.
764
765   [RFC4288]  Freed, N. and J. Klensin, "Media Type Specifications and
766              Registration Procedures", BCP 13, RFC 4288, December 2005.
767
768
769Appendix A.  Internet Media Type multipart/byteranges
770
771   When an HTTP 206 (Partial Content) response message includes the
772   content of multiple ranges (a response to a request for multiple non-
773   overlapping ranges), these are transmitted as a multipart message-
774   body [RFC2046].  The media type for this purpose is called
775   "multipart/byteranges".  The following is to be registered with IANA
776   [RFC4288].
777
778   The multipart/byteranges media type includes two or more parts, each
779   with its own Content-Type and Content-Range fields.  The required
780
781
782
783Fielding, et al.         Expires August 27, 2008               [Page 14]
784
785Internet-Draft              HTTP/1.1, Part 5               February 2008
786
787
788   boundary parameter specifies the boundary string used to separate
789   each body-part.
790
791   Type name:  multipart
792
793   Subtype name:  byteranges
794
795   Required parameters:  boundary
796
797   Optional parameters:  none
798
799   Encoding considerations:  only "7bit", "8bit", or "binary" are
800      permitted
801
802   Security considerations:  none
803
804   Interoperability considerations:  none
805
806   Published specification:  This specification (see Appendix A).
807
808   Applications that use this media type:
809
810   Additional information:
811
812      Magic number(s):  none
813
814      File extension(s):  none
815
816      Macintosh file type code(s):  none
817
818   Person and email address to contact for further information:  See
819      Authors Section.
820
821   Intended usage:  COMMON
822
823   Restrictions on usage:  none
824
825   Author/Change controller:  IESG
826
827
828
829
830
831
832
833
834
835
836
837
838
839Fielding, et al.         Expires August 27, 2008               [Page 15]
840
841Internet-Draft              HTTP/1.1, Part 5               February 2008
842
843
844   For example:
845
846      HTTP/1.1 206 Partial Content
847      Date: Wed, 15 Nov 1995 06:25:24 GMT
848      Last-Modified: Wed, 15 Nov 1995 04:58:08 GMT
849      Content-type: multipart/byteranges; boundary=THIS_STRING_SEPARATES
850
851      --THIS_STRING_SEPARATES
852      Content-type: application/pdf
853      Content-range: bytes 500-999/8000
854
855      ...the first range...
856      --THIS_STRING_SEPARATES
857      Content-type: application/pdf
858      Content-range: bytes 7000-7999/8000
859
860      ...the second range
861      --THIS_STRING_SEPARATES--
862
863   Notes:
864
865   1.  Additional CRLFs may precede the first boundary string in the
866       entity.
867
868   2.  Although [RFC2046] permits the boundary string to be quoted, some
869       existing implementations handle a quoted boundary string
870       incorrectly.
871
872   3.  A number of browsers and servers were coded to an early draft of
873       the byteranges specification to use a media type of multipart/
874       x-byteranges, which is almost, but not quite compatible with the
875       version documented in HTTP/1.1.
876
877
878Appendix B.  Compatibility with Previous Versions
879
880B.1.  Changes from RFC 2068
881
882   Transfer-coding and message lengths all interact in ways that
883   required fixing exactly when chunked encoding is used (to allow for
884   transfer encoding that may not be self delimiting); it was important
885   to straighten out exactly how message lengths are computed.
886   (Section 6.2, see also [Part1], [Part3] and [Part6])
887
888   There are situations where a server (especially a proxy) does not
889   know the full length of a response but is capable of serving a
890   byterange request.  We therefore need a mechanism to allow byteranges
891   with a content-range not indicating the full length of the message.
892
893
894
895Fielding, et al.         Expires August 27, 2008               [Page 16]
896
897Internet-Draft              HTTP/1.1, Part 5               February 2008
898
899
900   (Section 6.2)
901
902   Range request responses would become very verbose if all meta-data
903   were always returned; by allowing the server to only send needed
904   headers in a 206 response, this problem can be avoided.  (Section 4.1
905   and 6.3)
906
907   Fix problem with unsatisfiable range requests; there are two cases:
908   syntactic problems, and range doesn't exist in the document.  The 416
909   status code was needed to resolve this ambiguity needed to indicate
910   an error for a byte range request that falls outside of the actual
911   contents of a document.  (Section 4.2, 6.2)
912
913B.2.  Changes from RFC 2616
914
915   Clarify that it is not ok to use a weak cache validator in a 206
916   response.  (Section 4.1)
917
918
919Appendix C.  Change Log (to be removed by RFC Editor before publication)
920
921C.1.  Since RFC2616
922
923   Extracted relevant partitions from [RFC2616].
924
925C.2.  Since draft-ietf-httpbis-p5-range-00
926
927   Closed issues:
928
929   o  <http://www3.tools.ietf.org/wg/httpbis/trac/ticket/18>: "Cache
930      validators in 206 responses"
931      (<http://purl.org/NET/http-errata#ifrange206>)
932
933   o  <http://www3.tools.ietf.org/wg/httpbis/trac/ticket/35>: "Normative
934      and Informative references"
935
936   o  <http://www3.tools.ietf.org/wg/httpbis/trac/ticket/86>: "Normative
937      up-to-date references"
938
939C.3.  Since draft-ietf-httpbis-p5-range-01
940
941   Closed issues:
942
943   o  <http://www3.tools.ietf.org/wg/httpbis/trac/ticket/55>: "Updating
944      to RFC4288"
945
946   Ongoing work on ABNF conversion
947   (<http://www3.tools.ietf.org/wg/httpbis/trac/ticket/36>):
948
949
950
951Fielding, et al.         Expires August 27, 2008               [Page 17]
952
953Internet-Draft              HTTP/1.1, Part 5               February 2008
954
955
956   o  Add explicit references to BNF syntax and rules imported from
957      other parts of the specification.
958
959
960Index
961
962   2
963      206 Partial Content (status code)  5
964
965   4
966      416 Requested Range Not Satisfiable (status code)  6
967
968   A
969      Accept-Ranges header  7
970
971   C
972      Content-Range header  8
973
974   G
975      Grammar
976         Accept-Ranges  7
977         acceptable-ranges  7
978         byte-content-range-spec  8
979         byte-range-resp-spec  8
980         byte-range-set  11
981         byte-range-spec  11
982         byte-ranges-specifier  11
983         bytes-unit  5
984         Content-Range  8
985         content-range-spec  8
986         first-byte-pos  11
987         If-Range  10
988         instance-length  8
989         last-byte-pos  11
990         other-range-unit  5
991         Range  12
992         range-unit  5
993         ranges-specifier  11
994         suffix-byte-range-spec  11
995         suffix-length  11
996
997   H
998      Headers
999         Accept-Ranges  7
1000         Content-Range  8
1001         If-Range  10
1002         Range  10
1003
1004
1005
1006
1007Fielding, et al.         Expires August 27, 2008               [Page 18]
1008
1009Internet-Draft              HTTP/1.1, Part 5               February 2008
1010
1011
1012   I
1013      If-Range header  10
1014
1015   M
1016      Media Type
1017         multipart/byteranges  14
1018         multipart/x-byteranges  16
1019      multipart/byteranges Media Type  14
1020      multipart/x-byteranges Media Type  16
1021
1022   R
1023      Range header  10
1024
1025   S
1026      Status Codes
1027         206 Partial Content  5
1028         416 Requested Range Not Satisfiable  6
1029
1030
1031Authors' Addresses
1032
1033   Roy T. Fielding (editor)
1034   Day Software
1035   23 Corporate Plaza DR, Suite 280
1036   Newport Beach, CA  92660
1037   USA
1038
1039   Phone: +1-949-706-5300
1040   Fax:   +1-949-706-5305
1041   Email: fielding@gbiv.com
1042   URI:   http://roy.gbiv.com/
1043
1044
1045   Jim Gettys
1046   One Laptop per Child
1047   21 Oak Knoll Road
1048   Carlisle, MA  01741
1049   USA
1050
1051   Email: jg@laptop.org
1052   URI:   http://www.laptop.org/
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063Fielding, et al.         Expires August 27, 2008               [Page 19]
1064
1065Internet-Draft              HTTP/1.1, Part 5               February 2008
1066
1067
1068   Jeffrey C. Mogul
1069   Hewlett-Packard Company
1070   HP Labs, Large Scale Systems Group
1071   1501 Page Mill Road, MS 1177
1072   Palo Alto, CA  94304
1073   USA
1074
1075   Email: JeffMogul@acm.org
1076
1077
1078   Henrik Frystyk Nielsen
1079   Microsoft Corporation
1080   1 Microsoft Way
1081   Redmond, WA  98052
1082   USA
1083
1084   Email: henrikn@microsoft.com
1085
1086
1087   Larry Masinter
1088   Adobe Systems, Incorporated
1089   345 Park Ave
1090   San Jose, CA  95110
1091   USA
1092
1093   Email: LMM@acm.org
1094   URI:   http://larry.masinter.net/
1095
1096
1097   Paul J. Leach
1098   Microsoft Corporation
1099   1 Microsoft Way
1100   Redmond, WA  98052
1101
1102   Email: paulle@microsoft.com
1103
1104
1105   Tim Berners-Lee
1106   World Wide Web Consortium
1107   MIT Computer Science and Artificial Intelligence Laboratory
1108   The Stata Center, Building 32
1109   32 Vassar Street
1110   Cambridge, MA  02139
1111   USA
1112
1113   Email: timbl@w3.org
1114   URI:   http://www.w3.org/People/Berners-Lee/
1115
1116
1117
1118
1119Fielding, et al.         Expires August 27, 2008               [Page 20]
1120
1121Internet-Draft              HTTP/1.1, Part 5               February 2008
1122
1123
1124   Yves Lafon (editor)
1125   World Wide Web Consortium
1126   W3C / ERCIM
1127   2004, rte des Lucioles
1128   Sophia-Antipolis, AM  06902
1129   France
1130
1131   Email: ylafon@w3.org
1132   URI:   http://www.raubacapeu.net/people/yves/
1133
1134
1135   Julian F. Reschke (editor)
1136   greenbytes GmbH
1137   Hafenweg 16
1138   Muenster, NW  48155
1139   Germany
1140
1141   Phone: +49 251 2807760
1142   Fax:   +49 251 2807761
1143   Email: julian.reschke@greenbytes.de
1144   URI:   http://greenbytes.de/tech/webdav/
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175Fielding, et al.         Expires August 27, 2008               [Page 21]
1176
1177Internet-Draft              HTTP/1.1, Part 5               February 2008
1178
1179
1180Full Copyright Statement
1181
1182   Copyright (C) The IETF Trust (2008).
1183
1184   This document is subject to the rights, licenses and restrictions
1185   contained in BCP 78, and except as set forth therein, the authors
1186   retain all their rights.
1187
1188   This document and the information contained herein are provided on an
1189   "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
1190   OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND
1191   THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS
1192   OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF
1193   THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
1194   WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
1195
1196
1197Intellectual Property
1198
1199   The IETF takes no position regarding the validity or scope of any
1200   Intellectual Property Rights or other rights that might be claimed to
1201   pertain to the implementation or use of the technology described in
1202   this document or the extent to which any license under such rights
1203   might or might not be available; nor does it represent that it has
1204   made any independent effort to identify any such rights.  Information
1205   on the procedures with respect to rights in RFC documents can be
1206   found in BCP 78 and BCP 79.
1207
1208   Copies of IPR disclosures made to the IETF Secretariat and any
1209   assurances of licenses to be made available, or the result of an
1210   attempt made to obtain a general license or permission for the use of
1211   such proprietary rights by implementers or users of this
1212   specification can be obtained from the IETF on-line IPR repository at
1213   http://www.ietf.org/ipr.
1214
1215   The IETF invites any interested party to bring to its attention any
1216   copyrights, patents or patent applications, or other proprietary
1217   rights that may cover technology that may be required to implement
1218   this standard.  Please address the information to the IETF at
1219   ietf-ipr@ietf.org.
1220
1221
1222Acknowledgment
1223
1224   Funding for the RFC Editor function is provided by the IETF
1225   Administrative Support Activity (IASA).
1226
1227
1228
1229
1230
1231Fielding, et al.         Expires August 27, 2008               [Page 22]
1232
Note: See TracBrowser for help on using the repository browser.