pycurl — A Python interface to the cURL library

PycURL Documentation

pycurl — A Python interface to the cURL library

The pycurl package is a Python interface to libcurl (http://curl.haxx.se/libcurl/). pycurl
has been successfully built and tested with Python versions from
2.2 to the current 2.5.x releases.

libcurl is a client-side URL transfer library supporting FTP, FTPS,
HTTP, HTTPS, GOPHER, TELNET, DICT, FILE and LDAP. libcurl
also supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploads, proxies,
cookies, basic authentication, file transfer resume of FTP sessions, HTTP
proxy tunneling and more.

All the functionality provided by libcurl can used through the
pycurl interface. The following subsections describe how to use the
pycurl interface, and assume familiarity with how libcurl works. For
information on how libcurl works, please consult the curl library web pages
(http://curl.haxx.se/libcurl/c/).

 


 

Module Functionality

pycurl.global_init( option ) -> None

option is one of the constants
pycurl.GLOBAL_SSL, pycurl.GLOBAL_WIN32, pycurl.GLOBAL_ALL,
pycurl.GLOBAL_NOTHING, pycurl.GLOBAL_DEFAULT. Corresponds to
curl_global_init() in libcurl.

pycurl.global_cleanup() -> None

Corresponds to
curl_global_cleanup() in libcurl.

pycurl.version

This is a string with version information on libcurl,
corresponding to
curl_version() in libcurl.

Example usage:

>>> import pycurl
>>> pycurl.version
'libcurl/7.12.3 OpenSSL/0.9.7e zlib/1.2.2.1 libidn/0.5.12'
pycurl.version_info() -> Tuple

Corresponds to
curl_version_info() in libcurl.
Returns a tuple of information which is similar to the
curl_version_info_data struct returned by
curl_version_info() in libcurl.

Example usage:

>>> import pycurl
>>> pycurl.version_info()
(2, '7.12.3', 461827, 'i586-pc-linux-gnu', 1565, 'OpenSSL/0.9.7e', 9465951,
'1.2.2.1', ('ftp', 'gopher', 'telnet', 'dict', 'ldap', 'http', 'file',
'https', 'ftps'), None, 0, '0.5.12')
pycurl.Curl() -> Curl object

This function creates a new
Curl object which corresponds to a
CURL handle in libcurl. Curl objects automatically
set CURLOPT_VERBOSE to 0, CURLOPT_NOPROGRESS to 1,
provide a default CURLOPT_USERAGENT and setup
CURLOPT_ERRORBUFFER to point to a private error buffer.

pycurl.CurlMulti() -> CurlMulti object

This function creates a new
CurlMulti object which corresponds to
a CURLM handle in libcurl.

pycurl.CurlShare() -> CurlShare object

This function creates a new
CurlShare object which corresponds to
a CURLSH handle in libcurl. CurlShare objects is what you
pass as an argument to the SHARE option on Curl objects.

 


 

Subsections

posted on 2012-02-28 16:56  lexus 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/lexus/archive/2012/02/28/2371800.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值