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?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You should use the
Rangeheader in the request. But you may use it only if the server informs you that it accept range request byAccept-Rangesresponse header.This is an example session. Suppose we are interested in getting a part of this picture. First, we send a HTTP
HEADrequest to determine: a) if the server supports byte ranges, b) the content-length:Next, we send a
GETrequest with theRangeheader 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.