...
[plcapi.git] / pycurl / doc / pycurl.html
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml">
5 <head>
6   <title>PycURL Documentation</title>
7   <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
8   <meta name="revisit-after" content="30 days" />
9   <meta name="robots" content="noarchive, index, follow" />
10 </head>
11 <body>
12
13 <h1><tt>pycurl</tt> &mdash; A Python interface to the cURL library</h1>
14
15 <p>The pycurl package is a Python interface to libcurl (<a
16 href="http://curl.haxx.se/libcurl/">http://curl.haxx.se/libcurl/</a>). pycurl
17 has been successfully built and tested with Python versions from
18 2.2 to the current 2.4.x releases.</p>
19
20 <p>libcurl is a client-side URL transfer library supporting FTP, FTPS,
21 HTTP, HTTPS, GOPHER, TELNET, DICT, FILE and LDAP.  libcurl
22 also supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploads, proxies,
23 cookies, basic authentication, file transfer resume of FTP sessions, HTTP
24 proxy tunneling and more.</p>
25
26 <p>All the functionality provided by libcurl can used through the
27 pycurl interface. The following subsections describe how to use the
28 pycurl interface, and assume familiarity with how libcurl works.  For
29 information on how libcurl works, please consult the curl library web pages
30 (<a href="http://curl.haxx.se/libcurl/c/">http://curl.haxx.se/libcurl/c/</a>).</p>
31
32 <hr/>
33
34 <h1>Module Functionality</h1>
35
36 <dl>
37 <dt><code>pycurl.global_init(</code><em>option</em><code>)</code> -&gt;<em>None</em></dt>
38
39 <dd><p><em>option</em> is one of the constants
40 pycurl.GLOBAL_SSL, pycurl.GLOBAL_WIN32, pycurl.GLOBAL_ALL,
41 pycurl.GLOBAL_NOTHING, pycurl.GLOBAL_DEFAULT.  Corresponds to
42 <a href="http://curl.haxx.se/libcurl/c/curl_global_init.html"><code>curl_global_init()</code></a> in libcurl.</p>
43 </dd>
44
45 <dt><code>pycurl.global_cleanup()</code> -&gt; <em>None</em></dt>
46 <dd>
47 <p>Corresponds to
48 <a href="http://curl.haxx.se/libcurl/c/curl_global_cleanup.html"><code>curl_global_cleanup()</code></a> in libcurl.</p>
49 </dd>
50
51 <dt><code>pycurl.version</code></dt>
52
53 <dd><p>This is a string with version information on libcurl,
54 corresponding to
55 <a href="http://curl.haxx.se/libcurl/c/curl_version.html"><code>curl_version()</code></a> in libcurl.</p>
56
57 <p>Example usage:</p>
58 <pre>
59 >>> import pycurl
60 >>> pycurl.version
61 'libcurl/7.12.3 OpenSSL/0.9.7e zlib/1.2.2.1 libidn/0.5.12'
62 </pre>
63 </dd>
64
65 <dt><code>pycurl.version_info()</code> -&gt; <em>Tuple</em></dt>
66 <dd>
67 <p>Corresponds to
68 <a href="http://curl.haxx.se/libcurl/c/curl_version_info.html"><code>curl_version_info()</code></a> in libcurl.
69 Returns a tuple of information which is similar to the
70 <code>curl_version_info_data</code> struct returned by
71 <code>curl_version_info()</code> in libcurl.</p>
72
73 <p>Example usage:</p>
74 <pre>
75 >>> import pycurl
76 >>> pycurl.version_info()
77 (2, '7.12.3', 461827, 'i586-pc-linux-gnu', 1565, 'OpenSSL/0.9.7e', 9465951,
78 '1.2.2.1', ('ftp', 'gopher', 'telnet', 'dict', 'ldap', 'http', 'file',
79 'https', 'ftps'), None, 0, '0.5.12')
80 </pre>
81 </dd>
82
83 <dt><code>pycurl.Curl()</code> -&gt; <em>Curl object</em></dt>
84 <dd>
85 <p>This function creates a new
86 <a href="curlobject.html">Curl object</a> which corresponds to a
87 <code>CURL</code> handle in libcurl. Curl objects automatically
88 set CURLOPT_VERBOSE to 0, CURLOPT_NOPROGRESS to 1,
89 provide a default CURLOPT_USERAGENT and setup
90 CURLOPT_ERRORBUFFER to point to a private error buffer.</p>
91 </dd>
92
93 <dt><code>pycurl.CurlMulti()</code> -&gt; <em>CurlMulti object</em></dt>
94 <dd>
95 <p>This function creates a new
96 <a href="curlmultiobject.html">CurlMulti object</a> which corresponds to
97 a <code>CURLM</code> handle in libcurl.</p>
98 </dd>
99 </dl>
100
101 <hr/>
102
103 <h1>Subsections</h1>
104
105 <ul>
106   <li><a href="curlobject.html">Curl objects</a></li>
107   <li><a href="curlmultiobject.html">CurlMulti objects</a></li>
108   <li><a href="callbacks.html">Callbacks</a></li>
109 </ul>
110
111 <hr />
112 <p>
113   <a href="http://validator.w3.org/check/referer"><img align="right"
114      src="http://www.w3.org/Icons/valid-xhtml10"
115      alt="Valid XHTML 1.0!" height="31" width="88" border="0" /></a>
116   $Id$
117 </p>
118
119 </body>
120 </html>