http 断点续传 range content-range
curl -i --range 0-9 http://www.baidu.com/img/bdlogo.gif
返回的内容为:
HTTP/1.1 206 Partial Content
Accept-Ranges: bytes
Cache-Control: max-age=315360000
Content-Length: 10
Content-Range: bytes 0-9/1575
Content-Type: image/gif
Date: Mon, 01 Feb 2021 07:04:51 GMT
Etag: "627-4d648041f6b80"
Expires: Thu, 30 Jan 2031 07:04:51 GMT
Last-Modified: Fri, 22 Feb 2013 03:45:02 GMT
P3p: CP=" OTI DSP COR IVA OUR IND COM "
Server: Apache
Set-Cookie: BAIDUID=F50529290EDB18FB8360218A1844B642:FG=1; expires=Tue, 01-Feb-22 07:04:51 GMT; max-age=31536000; path=/; domain=.baidu.com; version=1
GIF89a▒
winhex查看一下
bdlogo.gif 的二进制文件内容:(GIF89a)
更换
curl -i -v --range 0-9 http://www.baidu.com/img/bdlogo.gif
更换
* About to connect() to www.baidu.com port 80 (#0)
* Trying 110.242.68.4...
* Connected to www.baidu.com (110.242.68.4) port 80 (#0)
> GET /img/bdlogo.gif HTTP/1.1
> Range: bytes=0-9
> User-Agent: curl/7.29.0
> Host: www.baidu.com
> Accept: */*
>
< HTTP/1.1 206 Partial Content
HTTP/1.1 206 Partial Content
< Accept-Ranges: bytes
Accept-Ranges: bytes
< Cache-Control: max-age=315360000
Cache-Control: max-age=315360000
< Content-Length: 10
Content-Length: 10
< Content-Range: bytes 0-9/1575
Content-Range: bytes 0-9/1575
< Content-Type: image/gif
Content-Type: image/gif
< Date: Mon, 01 Feb 2021 07:18:32 GMT
Date: Mon, 01 Feb 2021 07:18:32 GMT
< Etag: "627-4d648041f6b80"
Etag: "627-4d648041f6b80"
< Expires: Thu, 30 Jan 2031 07:18:32 GMT
Expires: Thu, 30 Jan 2031 07:18:32 GMT
< Last-Modified: Fri, 22 Feb 2013 03:45:02 GMT
Last-Modified: Fri, 22 Feb 2013 03:45:02 GMT
< P3p: CP=" OTI DSP COR IVA OUR IND COM "
P3p: CP=" OTI DSP COR IVA OUR IND COM "
< Server: Apache
Server: Apache
< Set-Cookie: BAIDUID=29993B6618711491BAB248208A7D565C:FG=1; expires=Tue, 01-Feb-22 07:18:32 GMT; max-age=31536000; path=/; domain=.baidu.com; version=1
Set-Cookie: BAIDUID=29993B6618711491BAB248208A7D565C:FG=1; expires=Tue, 01-Feb-22 07:18:32 GMT; max-age=31536000; path=/; domain=.baidu.com; version=1
<
* Connection #0 to host www.baidu.com left intact
GIF89a▒
更换2
curl -i -v --range 1-3 http://www.baidu.com/img/bdlogo.gif
返回
* About to connect() to www.baidu.com port 80 (#0)
* Trying 110.242.68.3...
* Connected to www.baidu.com (110.242.68.3) port 80 (#0)
> GET /img/bdlogo.gif HTTP/1.1
> Range: bytes=1-3
> User-Agent: curl/7.29.0
> Host: www.baidu.com
> Accept: */*
>
< HTTP/1.1 206 Partial Content
HTTP/1.1 206 Partial Content
< Accept-Ranges: bytes
Accept-Ranges: bytes
< Cache-Control: max-age=315360000
Cache-Control: max-age=315360000
< Content-Length: 3
Content-Length: 3
< Content-Range: bytes 1-3/1575
Content-Range: bytes 1-3/1575
< Content-Type: image/gif
Content-Type: image/gif
< Date: Mon, 01 Feb 2021 07:27:10 GMT
Date: Mon, 01 Feb 2021 07:27:10 GMT
< Etag: "627-4d648041f6b80"
Etag: "627-4d648041f6b80"
< Expires: Thu, 30 Jan 2031 07:27:10 GMT
Expires: Thu, 30 Jan 2031 07:27:10 GMT
< Last-Modified: Fri, 22 Feb 2013 03:45:02 GMT
Last-Modified: Fri, 22 Feb 2013 03:45:02 GMT
< P3p: CP=" OTI DSP COR IVA OUR IND COM "
P3p: CP=" OTI DSP COR IVA OUR IND COM "
< Server: Apache
Server: Apache
< Set-Cookie: BAIDUID=2A8E7C43657E48BED6F1E503E2B948D5:FG=1; expires=Tue, 01-Feb-22 07:27:10 GMT; max-age=31536000; path=/; domain=.baidu.com; version=1
Set-Cookie: BAIDUID=2A8E7C43657E48BED6F1E503E2B948D5:FG=1; expires=Tue, 01-Feb-22 07:27:10 GMT; max-age=31536000; path=/; domain=.baidu.com; version=1
<
* Connection #0 to host www.baidu.com left intact
IF8