summaryrefslogtreecommitdiff
path: root/doc/curlshareobject.html
blob: a624f4828d419312c0e22b07aa683571c3b6bf85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?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: CurlShare 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>CurlShare Object</h1>

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

<dl>
<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_share_setopt.html"><code>curl_share_setopt</code></a> in libcurl, where
<em>option</em> is specified with the CURLSHOPT_* constants in libcurl,
except that the CURLSHOPT_ prefix has been changed to SH_.  Currently,
<em>value</em> must be either LOCK_DATA_COOKIE or LOCK_DATA_DNS.</p>

<p>Example usage:</p>

<pre>
import pycurl
curl = pycurl.Curl()
s = pycurl.CurlShare()
s.setopt(pycurl.SH_SHARE, pycurl.LOCK_DATA_COOKIE)
s.setopt(pycurl.SH_SHARE, pycurl.LOCK_DATA_DNS)
curl.setopt(pycurl.URL, 'http://curl.haxx.se')
curl.setopt(pycurl.SHARE, s)
curl.perform()
curl.close()
</pre>
</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>
</p>

</body>
</html>