How can I read file from server starting with some offset (Similar behavior to wget -c)? What headers I must send to server? What futures must server support?
相关问题
- Angular RxJS mergeMap types
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
In http://www.gnu.org/software/wget/manual/wget.html
In http://tools.ietf.org/html/rfc2616
So you should send
You should use the
Range
header in the request. But you may use it only if the server informs you that it accept range request byAccept-Ranges
response header.This is an example session. Suppose we are interested in getting a part of this picture. First, we send a HTTP
HEAD
request to determine: a) if the server supports byte ranges, b) the content-length:Next, we send a
GET
request with theRange
header asking for the first 11 bytes of the picure:This is a hex dump of the first 11 bytes:
For more info see the Range header specification in HTTP RFC 2616.