curl常用命令
curl常用命令行
-
发送请求,默认
get方式curl "url" //网页或json,string会打印到标准输出中,-o 参数可以制定输出位置
-
上传文件
curl -u name:password -T filePath ftp://serverName -
使用代理
curl -x server:port url -
保存
cookiecurl -c cookie.txt url curl -D cookie.txrt url //保存header里的信息 -
使用
cookiecurl -b cookie.txt url -
模拟浏览器
curl -A "Mozilla/4.0(compatible; MSIE 8.0; Windows NT 5.0)" url -
伪造
referercurl -e "www.baidu.com" url //会误以为从百度跳转过来的请求 -
下载文件
curl -o tieba1.jpg http:www.baidu.com/tieba1.JPG curl -O http://www.baidu.com/tieba1.JPG curl -O http://www.baidu.com/tieba[1-5].JPG //循环下载 -
通过
ftp下载curl -O -u name:password ftp://server -
显示错误
curl -f url -
指定
post方式请求curl url -X POST -d "name=user&age=18" curl url -X POST -d {"name":"user","age:18"}

浙公网安备 33010602011771号