OM_curl


curl www.baidu.com					;;list on the screen
curl -o  bd.html 	www.baidu.com 	;;keep html code in the file "bd.html"

curl -x 123.45.67.89:1080 bd.html 	www.baidu.com 	;;with proxy

curl -x 123.45.67.89:1080 -o bd.html -D cookie0001.txt 	www.baidu.com		;;with keep session
curl -x 123.45.67.89:1080 -o bd2.html -D cookie0002.txt -b cookie0001.txt www.baidu.com		;;with read session and keep session again

;;with client infomation
curl -A "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" -x 123.45.67.89:1080 -o bd.html -D cookie0001.txt www.baidu.com
	
;;visit "mail.baidu.com"  with the click from "www.baidu.com"
curl -A "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" -x 123.45.67.89:1080 -e "mail.baidu.com" -o bd.html -D cookie0001.txt www.baidu.com


curl -O  http://www.baidu.com/logo.jpg		;;get the file 
curl -O  http://www.baidu.com/logo[1-10].jpg	;;get the file logo1.jpg~logo10.jpg
curl -o #2_#1.jpg http://{img3,img5}.baidu.com/logo[1-10].jpg	;;get img3 and img5  logo1.jpg~logo10.jpg,total 10 files.

curl -c -O http://www.baidu.com/logo.jpg 	;;get the file is stoped
curl -u name:passwd ftp://ip:port/path/file	;;ftp download
 
curl http://www.baidu.com/login.cgi?user=nickwolfe&password=12345		;;get send data
curl -d "user=11111&password=66666" http://www.baidu.com/login.cgi		;;post send data

curl dict://dict.org/d:computer			;;dict words


i参数可以显示http response的头信息,连同网页代码一起。
-v参数可以显示一次http通信的整个过程,包括端口连接和http request头信息。
	curl --trace output.txt www.baidu.com
	curl --trace-ascii output.txt www.baidu.com

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值