Code-Hex / pget

The fastest, resumable file download client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why must need "Accept-Ranges" header ?

monotone opened this issue · comments

if res.Header.Get("Accept-Ranges") != "bytes" {

This header allows the file to be downloaded in parts. It allows the server to respond to partial requests.
Consider it like you have a 100kB file, and wish to download in 10 parts. 0-10 bytes, 11-20 bytes, 21-30 bytes and so on.
In case the server does accept partial requests, this returns "bytes", else ""
This link might help a bit

@Arkoprabho @Code-Hex thanks first.

but when the server not respond this header, pget return error like "not supported range access *** ".

wget do this all right. so that`s what I really ask.