工具_curl

  • post

curl -d "user=nickwolfe&password=12345" http://www.yahoo.com/login.cgi

 

curl -d@"/home/lin_jianke/json.txt" "http://"

 

  • 保存到文件:

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

 

  • Header

 

curl -H"Authorization: 1e058e2471b07678b01a0ba36bbcdb51" -H"Content-Type: application/json" "http://192.168.1.131:8080/browseTitleServer/api/title/browse/json?id=1"

 

  • 代理

curl -x 192.168.200.253:3128 "http://www.facebook.com/home.php"

 

  • cookie

$ curl -x 123.45.67.89:1080 -o page.html -D cookie0001.txt http://www.linuxidc.com

这样,当页面被存到page.html的同时,cookie信息也被存到了cookie0001.txt里面了

 

 

这次我们使用这个option来把上次的cookie信息追加到http request里面去: -b

$ curl -x 123.45.67.89:1080 -o page1.html -D cookie0002.txt -b cookie0001.txt http://www.linuxidc.com

 

 

  • 保存文件

$ curl -O http://cgi2.tky.3web.ne.jp/~zzh/screen1.JPG

这样,就可以按照服务器上的文件名,自动存在本地了!

猜你喜欢

转载自lelglin.iteye.com/blog/1975053