<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Curl on EvBackup</title>
    <link>https://forzw.com/tags/curl/</link>
    <description>Recent content in Curl on EvBackup</description>
    <image>
      <title>EvBackup</title>
      <url>https://forzw.com/%3Clink%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E</url>
      <link>https://forzw.com/%3Clink%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E</link>
    </image>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Thu, 25 Mar 2010 07:18:31 +0000</lastBuildDate>
    <atom:link href="https://forzw.com/tags/curl/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>curl</title>
      <link>https://forzw.com/archives/444/</link>
      <pubDate>Thu, 25 Mar 2010 07:18:31 +0000</pubDate>
      <guid>https://forzw.com/archives/444/</guid>
      <description>&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;通过curl直接访问sina网站 curl &lt;a href=&#34;http://www.sina.com.cn&#34;&gt;http://www.sina.com.cn&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;你也可以把sina保存期来 curl &lt;a href=&#34;http://www.sina.com&#34;&gt;http://www.sina.com&lt;/a&gt; &amp;gt; sina 或 curl -o sina &lt;a href=&#34;http://www.sina.com.cn&#34;&gt;http://www.sina.com.cn&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;同时可以通过代理来访问网页 curl -x 10.54.38.18:8080 -o sina.html &lt;a href=&#34;http://www.sina.com.cn&#34;&gt;http://www.sina.com.cn&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;可以把cookies存放到一个文件里 curl -x 10.54.38.18:8080 -o sina.html -D cookie002.txt &lt;a href=&#34;http://www.sina.com.cn&#34;&gt;http://www.sina.com.cn&lt;/a&gt;  5) 下一次访问的时候，如何继续使用上次留下的cookie信息呢？要知道，很多网站都是靠监视你的cookie信息， 来判断你是不是不按规矩访问他们的网站的。 这次我们使用这个option来把上次的cookie信息追加到http request里面去： -b curl -x 10.54.38.18:8080 -o page1.html -D cookie0002.txt -b cookie0001.txt &lt;a href=&#34;http://www.sina.com.cn&#34;&gt;http://www.sina.com.cn&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;6)有些讨厌的网站总要我们使用某些特定的浏览器去访问他们，有时候更过分的是，还要使用某些特定的版本~~~~ 哪里有时间为了它去找这些怪异的浏览器呢！？&lt;/p&gt;
&lt;p&gt;好在curl给我们提供了一个有用的option，可以让我们随意指定自己这次访问所宣称的自己的浏览器信息： -A curl -A &amp;ldquo;Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)&amp;rdquo; -x 10.54.38.18:8080 -o sina.html -D cookie0001.txt &lt;a href=&#34;http://www.sina.com.cn&#34;&gt;http://www.sina.com.cn&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;7） 另外一个服务器端常用的限制方法，就是检查http访问的referer。比如你先访问首页，再访问里面所指定的下载页，这第二次访问的referer地址就是第一次访问成功后的页面地址。这样，服务器端只要发现对下载页面某次访问的referer地址不 是首页的地址，就可以断定那是个盗连了~~~~~&lt;/p&gt;
&lt;p&gt;讨厌讨厌~~~我就是要盗连~~~~~！！ 幸好curl给我们提供了设定referer的option： -e curl -A &amp;ldquo;Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)&amp;rdquo; -x 10.54.38.18:8080 -e &amp;ldquo;&lt;a href=&#34;https://www.sina.com.cn&#34;&gt;www.sina.com.cn&lt;/a&gt;&amp;rdquo; -o page.html -D cookie0001.txt &lt;a href=&#34;http://login.sina.com.cn&#34;&gt;http://login.sina.com.cn&lt;/a&gt;&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
