-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcurl
51 lines (34 loc) · 1.21 KB
/
curl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Download a single file
curl http://path.to.the/file
# 请求 HTTPS
curl -k https://path.to.the/file
# -o 指定保存文件名字
curl http://example.com/file.zip -o new_file.zip
# -O 用默认的名字保存
curl -O http://example.com/file.zip
# -L 跟踪重定向
curl -L http://example.com/file.zip
# 下载多个文件
curl -O URLOfFirstFile -O URLOfSecondFile
# -C - 断点续传
curl -C - -O http://example.com/file.zip
# 只获取 HTTP Headers
curl -I http://example.com
# 用 curl 做 health check
# -f 返回错误码,不返回 http response 的内容,-s 阻止 curl 自身的输出
curl -Ifs http://example.com
# 使用 cookie, -b 或者 --cookie
curl -b 'KEY=VALUE' http://example.com
# Download all sequentially numbered files (1-24)
curl http://example.com/pic[1-24].jpg
# Download a file and pass HTTP Authentication
curl -u username:password URL
# Download a file with a Proxy
curl -x proxysever.server.com:PORT http://addressiwantto.access
# Download a file from FTP
curl -u username:password -O ftp://example.com/pub/file.zip
# Get an FTP directory listing
curl ftp://username:[email protected]
# Limit the rate of a download
curl --limit-rate 1000B -O http://path.to.the/file
# vim: set ft=sh