0

linux下用curl命令post东西(摘)

Posted in Linux at 七月 22nd, 2010 / No Comments »

linux下写shell脚本程序

经常会遇到需要post提交东西的时候

这时候用curl是非常方便的

我举一个例子:

curl -A “Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)” \
-e “http://www.xxx.com/poll.shtml” \
-d “2880[]=105&pid=2880&p=最佳&count=1&receipt=1&poll=投票” \

http://survey.xxx.com/poll/poll.php

这里
-A “Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)”
的意思就是申明自己用的是windows2000下的ie6的浏览器;

-e “http://www.xxx.com/poll.shtml”的意思就是refer是这个页面;

-d后面的参数都是将用post方式提交到服务器去的

最后面的就是将要post到的url地址

这里提到了-A、-e和-d参数,
其实用的比较多的还有
-x(后面用ip:port方式接代理服务器)等等,
这里就不一一列举了,可以参考man curl

http://hi.baidu.com/usoa/blog/item/b1ef5936f3d066daa2cc2b09.html

Published in Linux
Tags:

No Responses to “linux下用curl命令post东西(摘)”

Leave a Reply

请输入算式结果(看不清请点击图片)
(必须)