GIF89a; Mini Shell

Mini Shell

Direktori : /usr/share/doc/python-pycurl-7.19.0/doc/
Upload File :
Current File : //usr/share/doc/python-pycurl-7.19.0/doc/curlobject.html

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>PycURL: Curl Objects</title>
  <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
  <meta name="revisit-after" content="30 days" />
  <meta name="robots" content="noarchive, index, follow" />
</head>
<body>

<h1>Curl Object</h1>

<p>Curl objects have the following methods:</p>

<dl>
<dt><code>close()</code> -&gt; <em>None</em></dt>
<dd>
<p>Corresponds to
<a href="http://curl.haxx.se/libcurl/c/curl_easy_cleanup.html"><code>curl_easy_cleanup</code></a> in libcurl.
This method is automatically called by pycurl when a Curl object no longer has
any references to it, but can also be called explicitly.</p>
</dd>

<dt><code>perform()</code> -&gt; <em>None</em></dt>
<dd>
<p>Corresponds to
<a href="http://curl.haxx.se/libcurl/c/curl_easy_perform.html"><code>curl_easy_perform</code></a> in libcurl.</p>
</dd>

<dt><code>reset()</code> -&gt; <em>None</em></dt>
<dd>
<p>Corresponds to
<a
href="http://curl.haxx.se/libcurl/c/curl_easy_reset.html"><code>curl_easy_reset</code></a> in libcurl.</p>
</dd>


<dt><code>setopt(</code><em>option, value</em><code>)</code> -&gt; <em>None</em></dt>
<dd>

<p>Corresponds to
<a href="http://curl.haxx.se/libcurl/c/curl_easy_setopt.html"><code>curl_easy_setopt</code></a> in libcurl, where
<em>option</em> is specified with the CURLOPT_* constants in libcurl,
except that the CURLOPT_ prefix has been removed. The type for
<em>value</em> depends on the option, and can be either a string,
integer, long integer, file objects, lists, or functions.</p>

<p>Example usage:</p>

<pre>
import pycurl
c = pycurl.Curl()
c.setopt(pycurl.URL, "http://www.python.org/")
c.setopt(pycurl.HTTPHEADER, ["Accept:"])
import StringIO
b = StringIO.StringIO()
c.setopt(pycurl.WRITEFUNCTION, b.write)
c.setopt(pycurl.FOLLOWLOCATION, 1)
c.setopt(pycurl.MAXREDIRS, 5)
c.perform()
print b.getvalue()
...
</pre>
</dd>

<dt><code>getinfo(</code><em>option</em><code>) </code>-&gt; <em>Result</em></dt>
<dd>

<p>Corresponds to
<a href="http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html"><code>curl_easy_getinfo</code></a> in libcurl, where
<em>option</em> is the same as the CURLINFO_* constants in libcurl,
except that the CURLINFO_ prefix has been removed.
<em>Result</em> contains an integer, float or string, depending on
which option is given. The <code>getinfo</code> method should
not be called unless <code>perform</code> has been called and
finished.</p>

<p>Example usage:</p>

<pre>
import pycurl
c = pycurl.Curl()
c.setopt(pycurl.URL, "http://sf.net")
c.setopt(pycurl.FOLLOWLOCATION, 1)
c.perform()
print c.getinfo(pycurl.HTTP_CODE), c.getinfo(pycurl.EFFECTIVE_URL)
...
--&gt; 200 "http://sourceforge.net/"
</pre>
</dd>

<dt><code>errstr()</code> -&gt; <em>String</em></dt>
<dd>
<p>Returns the internal libcurl error buffer of this handle as a string.</p>
</dd>
</dl>


<hr />
<p>
  <a href="http://validator.w3.org/check/referer"><img align="right"
     src="http://www.w3.org/Icons/valid-xhtml10"
     alt="Valid XHTML 1.0!" height="31" width="88" border="0" /></a>
  $Id: curlobject.html,v 1.15 2008/08/05 20:51:13 kjetilja Exp $
</p>

</body>
</html>

./BlackJoker Mini Shell 1.0