# 指定请求方法
curl -X POST https://www.example.com
# 显示详细信息
curl -v https://www.example.com
# 将服务器回应保存成文件
curl -O https://www.example.com/foo/bar.html
# 限制带宽
curl --limit-rate 200k https://example.com
# 设置HTTP请求头
curl -d '{"login": "emma", "pass": "123"}' -H 'Content-Type: application/json' https://example.com/login
# 构造查询字符串
curl -G --data-urlencode 'comment=hello world' https://www.example.com
# 上传文件
curl -F 'file=@photo.png;filename=me.png' https://example.com/profile
# 发送POST请求的数据体
curl -d 'login=emma' -d 'password=123' -X POST https://example.com/login
curl -d '@data.txt' https://example.com/login
# 将服务器设置的Cookie写入文件
curl -c cookies.txt https://www.example.com
# 向服务器发送Cookie
curl -b 'foo1=bar;foo2=bar2' https://example.com
curl -b cookies.txt https://www.example.com
# 设置User-Agent
curl -H 'User-Agent: php/1.0' https://example.com
参考网站,转侵删