<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[curl 模拟浏览器头和refer及Curl模仿http浏览器常见命令。]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[Php/Js/Shell/Go]]></category>
<pubDate>Fri, 06 Sep 2013 10:03:04 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	linux下shell终端curl的post数据<br/>curl -A &quot;Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)&quot; -e &quot;http://post.html&quot;&nbsp;&nbsp;-d &quot;2880[]=105&amp;pid=2880&amp;p=最佳&amp;count=1&amp;receipt=1&amp;poll=投票&quot; http://post.php<br/>注释：<br/>-A &quot;Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)&quot;<br/>的意思就是申明客户端是windows2000下的ie6的浏览器；<br/>-e &quot;http://post.html&quot;的意思就是refer是这个页面；<br/>-d后面的参数都是将用post方式提交到服务器去的<br/>最后面的就是将要post到的url地址<br/>这里提到了-A、-e和-d参数，<br/>其实用的比较多的还有<br/>-x(后面用ip:port方式接代理服务器)等等，<br/>这里就不一一列举了，可以参考man curl<br/><br/>demo<br/>curl $URL -d &quot;2880[]=105&amp;pid=2880&amp;p=最佳&amp;count=1&amp;receipt=1&amp;poll=投票&quot;<br/><br/>结果<br/>Array<br/>(<br/>&nbsp;&nbsp;&nbsp;&nbsp;[2880] =&gt; Array<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[0] =&gt; 105<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;[pid] =&gt; 2880<br/>&nbsp;&nbsp;&nbsp;&nbsp;[p] =&gt; 最佳<br/>&nbsp;&nbsp;&nbsp;&nbsp;[count] =&gt; 1<br/>&nbsp;&nbsp;&nbsp;&nbsp;[receipt] =&gt; 1<br/>&nbsp;&nbsp;&nbsp;&nbsp;[poll] =&gt; 投票<br/>)<br/><br/>4.模拟指定浏览器<br/><br/>有些变态的站点,限制了使用浏览器的类型.一样难不倒curl.<br/><br/>curl -A “Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)” [URL]<br/>这个就是一个模拟,win2k的ie5.0的一个访问.<br/><br/><br/><br/>3.认证<br/><br/>比如某些网站需要使用认证.可以使用如下命令.比如论坛什么的.<br/><br/>curl -u name:password www.secrets.com<br/><br/>4.模拟指定浏览器<br/><br/>有些变态的站点,限制了使用浏览器的类型.一样难不倒curl.<br/><br/>curl -A “Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)” [URL]<br/>这个就是一个模拟,win2k的ie5.0的一个访问.<br/><br/>5.Cookies<br/><br/>大部分网站都使用cookies,来记录浏览中的信息,识别用户等.自然使用curl也是可以做到的.<br/>比如保存cookies.<br/>curl -D head_cookies http://bbs.it580.com<br/>这样将保存bbs.it580.com的cookies到运行命令的目录下,并命名为head_cookies.<br/><br/>保存了自然要下次使用的.如何使用呢?<br/>curl -b head_cookies http://bbs.it580.com<br/><br/>6.使用代理<br/><br/>很多站点限制了访问的ip，或者说投票的时候发现只能一票一投。就要使用到这个了。<br/>curl -x proxy.test.org:80 http://bbs.it580.com<br/>这样就使用proxy.text.org代理，来访问http://bbs.it580.com了。<br/><br/>来自：http://blog.it580.com/curlhttp/<br/>http://www.cnblogs.com/rootq/articles/1393933.html
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] curl 模拟浏览器头和refer及Curl模仿http浏览器常见命令。]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>