curl 基本使用

循环下载

curl -O http://domain/[0-9].JPG

匹配下载

curl -O http://domian/~{a,b}/[001-201].JPG  # >like a/001.JPG

GET 

curl http://www.baidu.com

POST

curl -d "user=user&password=passwd" domain

POST 文件

curl -F upload= $filePath  -F $name=$value domain

通过代理

curl -x proxydomain  domain

使用refer

curl -A "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" -x proxy -e"refer" domain

获取页面

curl -o local.html  http://www.baidu.com

模拟表单信息,保存cookie

curl -c localfile -F param=vaalue domain

模拟表单信息,保存头信息

curl -D localfile -F param=vaalue domain

使用cookie文件

curl -b localfile  domain

保存cookie

curl -x proxy -o output -D remotecookie domain

使用cookie

curl -x proxy -o output -D remoteCookie -b localCookie domian
原文地址:https://www.cnblogs.com/avalon-merlin/p/10517870.html