The client will send a Range
header defining the absolute start and end bytes, followed by the total file length or "*".
Examples:
. The first 500 bytes: bytes 0-499/1234 . The second 500 bytes: bytes 500-999/1234 . All except for the first 500 bytes: bytes 500-1233/1234 . The last 500 bytes: bytes 734-1233/1234
Then the server should return a response code 206
(partial content), and the Content-Length
should be only the amount of data transferred.
In the case of an invalid range, the server should either return 416
(the requested range is not feasible) with the Content-Range
bytes */*
field, or ignore the range request and return 200
with the entire body of the file.
The server must also send an Accept-Ranges
field with the value of the accepted range range, in this case bytes
. But the range block can be any custom range that you want.
Source: rfc2616
fent
source share