http 断点续传 range content-range

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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值