Apache/2.4.7 (Ubuntu) Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) safemode : OFF MySQL: ON | Perl: ON | cURL: OFF | WGet: ON > / usr / share / doc / python3-pycurl / html / | server ip : 104.21.89.46 your ip : 172.69.6.234 H O M E |
Filename | /usr/share/doc/python3-pycurl/html/curlobject.html |
Size | 4.2 kb |
Permission | rw-r--r-- |
Owner | root : root |
Create time | 27-Apr-2025 09:56 |
Last modified | 24-Dec-2013 15:16 |
Last accessed | 06-Jul-2025 23:32 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
<?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> -> <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> -> <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> -> <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> -> <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.
(See below for exceptions.)
The type for
<em>value</em> depends on the option, and can be either a string,
integer, long integer, file object, list, or function.</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>-> <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.
(See below for exceptions.)
<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)
...
--> 200 "http://sourceforge.net/"
</pre>
</dd>
<dt><code>pause(</code><em>bitmask</em><code>) </code>-> <em>None</em></dt>
<dd>
<p>Corresponds to
<a href="http://curl.haxx.se/libcurl/c/curl_easy_pause.html"><code>curl_easy_pause</code></a>
in libcurl. The argument should be derived from
the <code>PAUSE_RECV</code>, <code>PAUSE_SEND</code>, <code>PAUSE_ALL</code>
and <code>PAUSE_CONT</code> constants.</p>
<dt><code>errstr()</code> -> <em>String</em></dt>
<dd>
<p>Returns the internal libcurl error buffer of this handle as a string.</p>
</dd>
</dl>
<p>In order to distinguish between similarly-named CURLOPT and
CURLINFO constants, some have <code>OPT_</code>
and <code>INFO_</code> prefixes. These are
<code>INFO_FILETIME</code>, <code>OPT_FILETIME</code>,
<code>INFO_COOKIELIST</code> (but <code>setopt</code> uses <code>COOKIELIST</code>!),
<code>INFO_CERTINFO</code>, and <code>OPT_CERTINFO</code>.</p>
<p>The value returned by <code>getinfo(INFO_CERTINFO)</code> is a list
with one element per certificate in the chain, starting with the leaf;
each element is a sequence
of <code>(</code><em>key</em><code>, </code><em>value</em><code>)</code>
tuples.</p>
<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>
</p>
</body>
</html>
<!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> -> <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> -> <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> -> <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> -> <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.
(See below for exceptions.)
The type for
<em>value</em> depends on the option, and can be either a string,
integer, long integer, file object, list, or function.</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>-> <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.
(See below for exceptions.)
<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)
...
--> 200 "http://sourceforge.net/"
</pre>
</dd>
<dt><code>pause(</code><em>bitmask</em><code>) </code>-> <em>None</em></dt>
<dd>
<p>Corresponds to
<a href="http://curl.haxx.se/libcurl/c/curl_easy_pause.html"><code>curl_easy_pause</code></a>
in libcurl. The argument should be derived from
the <code>PAUSE_RECV</code>, <code>PAUSE_SEND</code>, <code>PAUSE_ALL</code>
and <code>PAUSE_CONT</code> constants.</p>
<dt><code>errstr()</code> -> <em>String</em></dt>
<dd>
<p>Returns the internal libcurl error buffer of this handle as a string.</p>
</dd>
</dl>
<p>In order to distinguish between similarly-named CURLOPT and
CURLINFO constants, some have <code>OPT_</code>
and <code>INFO_</code> prefixes. These are
<code>INFO_FILETIME</code>, <code>OPT_FILETIME</code>,
<code>INFO_COOKIELIST</code> (but <code>setopt</code> uses <code>COOKIELIST</code>!),
<code>INFO_CERTINFO</code>, and <code>OPT_CERTINFO</code>.</p>
<p>The value returned by <code>getinfo(INFO_CERTINFO)</code> is a list
with one element per certificate in the chain, starting with the leaf;
each element is a sequence
of <code>(</code><em>key</em><code>, </code><em>value</em><code>)</code>
tuples.</p>
<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>
</p>
</body>
</html>