curl 分片

查看資源是否支持分片 (https://www.baidu.com)

#方式一
curl -I https://www.baidu.com

#方式二
curl -i --HEAD https://www.baidu.com

### 響應結果 ###
HTTP/1.1 200 OK
Accept-Ranges: bytes
Cache-Control: private, no-cache, no-store, proxy-revalidate, no-transform
Connection: keep-alive
Content-Length: 277
Content-Type: text/html
Date: Tue, 30 Jun 2020 07:37:08 GMT
Etag: "575e1f60-115"
Last-Modified: Mon, 13 Jun 2016 02:50:08 GMT
Pragma: no-cache
Server: bfe/1.0.8.18

查看資源分片信息(https://www.baidu.com)

#方式一
curl https://www.baidu.com -r 0-8 -I

#方式二
curl https://www.baidu.com --header "Range: bytes=0-8"  -I

### 響應結果 ###
HTTP/1.1 206 Partial Content
Cache-Control: private, no-cache, no-store, proxy-revalidate, no-transform
Connection: keep-alive
Content-Length: 9
Content-Range: bytes 0-8/277
Content-Type: text/html
Date: Tue, 30 Jun 2020 08:09:15 GMT
Etag: "575e1f60-115"
Last-Modified: Mon, 13 Jun 2016 02:50:08 GMT
Pragma: no-cache
Server: bfe/1.0.8.18

查看資源分片內容 (https://www.baidu.com)

#方式一
curl https://www.baidu.com -r 0-8

#方式二
curl https://www.baidu.com --header "Range: bytes=0-8" 

下載資源分片 (https://www.baidu.com)

#方式一
curl https://www.baidu.com -r 0-8  --output d:/www.baidu.com.html

#方式二
curl https://www.baidu.com --header "Range: bytes=0-8"  --output d:/www.baidu.com.html

相關鏈接

https://cloud.tencent.com/developer/section/1189987

https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Range_requests

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章