如果你再*nix机器下,运行man curl
命令查看具体的使用用法。
curl is a tool to transfer data from or to a server, using one of the supported protocols (http, https, ftp, ftps...). The command is designed to work without user interaction.
curl offers a busload of useful tricks like proxy support, user authentication, ftp upload, http post, ssl connections, cookies, file transfer resum and more.
curl [options] [URL...]
// 查看请求信息
curl -I www.baidu.com
// 批量
curl http://(tieba, fm, zhidao).baidu.com/
curl http://sports.tumblr.com/page/[5-10]
// GET请求
curl 'www.a.com/junk.cgi?name1=value1&name2=value2'
// POST请求
curl -d 'name=value1&password=pass1' www.a.com/junk.cgi
// 上传文件
curl -F upload=@localfilename -F press=OK [URL]
//保存页面
curl http://www.yahoo.com > page.html
curl -o page.html http://www.yahoo.com
//批量下载图片
curl -O http://cgi2.tky.3web.ne.jp/~zzh/screen[1-10].JPG
curl -o #2_#1.jpg http://cgi2.tky.3web.ne.jp/~{zzh,nick}/[001-201].JPG
//验证
curl -u name:password www.secrets.com
//代理
curl -U proxyuser:proxypassword http://curl.haxx.se