feat: Add new gcloud commands, API clients, and third-party libraries across various services.

This commit is contained in:
2026-01-01 20:26:35 +01:00
parent 5e23cbece0
commit a19e592eb7
25221 changed files with 8324611 additions and 0 deletions

View File

@@ -0,0 +1,112 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link rel="STYLESHEET" href="ref.css" type='text/css' />
<link rel="first" href="ref.html" title='The httplib2 Library' />
<link rel='contents' href='contents.html' title="Contents" />
<link rel='last' href='about.html' title='About this document...' />
<link rel='help' href='about.html' title='About this document...' />
<link rel="prev" href="node2.html" />
<link rel="parent" href="ref.html" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name='aesop' content='information' />
<title>About this document ...</title>
</head>
<body>
<div class="navigation">
<div id='top-navigation-panel' xml:id='top-navigation-panel'>
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="1.1.4 Examples"
href="httplib2-example.html"><img src='previous.png'
border='0' height='32' alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="The httplib2 Library"
href="ref.html"><img src='up.png'
border='0' height='32' alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><img src='next.png'
border='0' height='32' alt='Next Page' width='32' /></td>
<td align="center" width="100%">The httplib2 Library</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
href="contents.html"><img src='contents.png'
border='0' height='32' alt='Contents' width='32' /></a></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="httplib2-example.html">1.1.4 Examples</a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="ref.html">The httplib2 Library</a>
</div>
<hr /></div>
</div>
<!--End of Navigation Panel-->
<h1><a name="SECTION003000000000000000000">
About this document ...</a>
</h1>
<strong>The httplib2 Library</strong>,
Mar 8, 2007, Release 0.3
<p> This document was generated using the <a
href="http://saftsack.fs.uni-bayreuth.de/~latex2ht/">
<strong>LaTeX</strong>2<tt>HTML</tt></a> translator.
</p>
<p> <a
href="http://saftsack.fs.uni-bayreuth.de/~latex2ht/">
<strong>LaTeX</strong>2<tt>HTML</tt></a> is Copyright &copy;
1993, 1994, 1995, 1996, 1997, <a
href="http://cbl.leeds.ac.uk/nikos/personal.html">Nikos
Drakos</a>, Computer Based Learning Unit, University of
Leeds, and Copyright &copy; 1997, 1998, <a
href="http://www.maths.mq.edu.au/~ross/">Ross
Moore</a>, Mathematics Department, Macquarie University,
Sydney.
</p>
<p> The application of <a
href="http://saftsack.fs.uni-bayreuth.de/~latex2ht/">
<strong>LaTeX</strong>2<tt>HTML</tt></a> to the Python
documentation has been heavily tailored by Fred L. Drake,
Jr. Original navigation icons were contributed by Christopher
Petrilli.
</p>
<div class="navigation">
<div class='online-navigation'>
<p></p><hr />
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="1.1.4 Examples"
href="httplib2-example.html"><img src='previous.png'
border='0' height='32' alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="The httplib2 Library"
href="ref.html"><img src='up.png'
border='0' height='32' alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><img src='next.png'
border='0' height='32' alt='Next Page' width='32' /></td>
<td align="center" width="100%">The httplib2 Library</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
href="contents.html"><img src='contents.png'
border='0' height='32' alt='Contents' width='32' /></a></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="httplib2-example.html">1.1.4 Examples</a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="ref.html">The httplib2 Library</a>
</div>
</div>
<hr />
<span class="release-info">Release 0.3, documentation updated on Mar 8, 2007.</span>
</div>
<!--End of Navigation Panel-->
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -0,0 +1,129 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link rel="STYLESHEET" href="ref.css" type='text/css' />
<link rel="first" href="ref.html" title='The httplib2 Library' />
<link rel='contents' href='contents.html' title="Contents" />
<link rel='last' href='about.html' title='About this document...' />
<link rel='help' href='about.html' title='About this document...' />
<link rel="next" href="response-objects.html" />
<link rel="prev" href="http-objects.html" />
<link rel="parent" href="module-httplib2.html" />
<link rel="next" href="response-objects.html" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name='aesop' content='information' />
<title>1.1.2 Cache Objects</title>
</head>
<body>
<div class="navigation">
<div id='top-navigation-panel' xml:id='top-navigation-panel'>
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="1.1.1 http Objects"
href="http-objects.html"><img src='previous.png'
border='0' height='32' alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="1.1 httplib2 A comprehensive"
href="module-httplib2.html"><img src='up.png'
border='0' height='32' alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><a rel="next" title="1.1.3 response Objects"
href="response-objects.html"><img src='next.png'
border='0' height='32' alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">The httplib2 Library</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
href="contents.html"><img src='contents.png'
border='0' height='32' alt='Contents' width='32' /></a></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="http-objects.html">1.1.1 Http Objects</a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="module-httplib2.html">1.1 httplib2 A comprehensive</a>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="response-objects.html">1.1.3 Response Objects</a>
</div>
<hr /></div>
</div>
<!--End of Navigation Panel-->
<h2><a name="SECTION002120000000000000000"></a>
<a name="cache-objects"></a>
<br>
1.1.2 Cache Objects
</h2>
<p>
If you wish to supply your own caching implementation
then you will need to pass in an object that supports the
following methods. Note that the <tt class="module">memcache</tt> module
supports this interface natively.
<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-23' xml:id='l2h-23' class="method">get</tt></b>(</nobr></td>
<td><var>key</var>)</td></tr></table></dt>
<dd>
Takes a string <var>key</var> and returns the value as a string.
</dl>
<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-24' xml:id='l2h-24' class="method">set</tt></b>(</nobr></td>
<td><var>key, value</var>)</td></tr></table></dt>
<dd>
Takes a string <var>key</var> and <var>value</var> and stores it in the cache.
</dl>
<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-25' xml:id='l2h-25' class="method">delete</tt></b>(</nobr></td>
<td><var>key</var>)</td></tr></table></dt>
<dd>
Deletes the cached value stored at <var>key</var>. The value
of <var>key</var> is a string.
</dl>
<p>
<div class="navigation">
<div class='online-navigation'>
<p></p><hr />
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="1.1.1 http Objects"
href="http-objects.html"><img src='previous.png'
border='0' height='32' alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="1.1 httplib2 A comprehensive"
href="module-httplib2.html"><img src='up.png'
border='0' height='32' alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><a rel="next" title="1.1.3 response Objects"
href="response-objects.html"><img src='next.png'
border='0' height='32' alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">The httplib2 Library</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
href="contents.html"><img src='contents.png'
border='0' height='32' alt='Contents' width='32' /></a></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="http-objects.html">1.1.1 Http Objects</a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="module-httplib2.html">1.1 httplib2 A comprehensive</a>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="response-objects.html">1.1.3 Response Objects</a>
</div>
</div>
<hr />
<span class="release-info">Release 0.3, documentation updated on Mar 8, 2007.</span>
</div>
<!--End of Navigation Panel-->
</body>
</html>

View File

@@ -0,0 +1,105 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link rel="STYLESHEET" href="ref.css" type='text/css' />
<link rel="first" href="ref.html" title='The httplib2 Library' />
<link rel='contents' href='contents.html' title="Contents" />
<link rel='last' href='about.html' title='About this document...' />
<link rel='help' href='about.html' title='About this document...' />
<link rel="next" href="node2.html" />
<link rel="prev" href="ref.html" />
<link rel="parent" href="ref.html" />
<link rel="next" href="node2.html" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name='aesop' content='information' />
<title>Contents</title>
</head>
<body>
<div class="navigation">
<div id='top-navigation-panel' xml:id='top-navigation-panel'>
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="The httplib2 Library"
href="ref.html"><img src='previous.png'
border='0' height='32' alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="The httplib2 Library"
href="ref.html"><img src='up.png'
border='0' height='32' alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><a rel="next" title="1. Reference"
href="node2.html"><img src='next.png'
border='0' height='32' alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">The httplib2 Library</td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="ref.html">The httplib2 Library</a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="ref.html">The httplib2 Library</a>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="node2.html">1. Reference</a>
</div>
<hr /></div>
</div>
<!--End of Navigation Panel-->
<br><h2><a name="SECTION001000000000000000000">
Contents</a>
</h2>
<!--Table of Contents-->
<ul class="TofC">
<li><a href="node2.html">1. Reference</a>
<ul>
<li><a href="module-httplib2.html">1.1 httplib2 A comprehensive HTTP client library.</a>
<ul>
<li><a href="http-objects.html">1.1.1 Http Objects</a>
<li><a href="cache-objects.html">1.1.2 Cache Objects</a>
<li><a href="response-objects.html">1.1.3 Response Objects</a>
<li><a href="httplib2-example.html">1.1.4 Examples</a>
</ul></ul></ul>
<!--End of Table of Contents-->
<p>
<div class="navigation">
<div class='online-navigation'>
<p></p><hr />
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="The httplib2 Library"
href="ref.html"><img src='previous.png'
border='0' height='32' alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="The httplib2 Library"
href="ref.html"><img src='up.png'
border='0' height='32' alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><a rel="next" title="1. Reference"
href="node2.html"><img src='next.png'
border='0' height='32' alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">The httplib2 Library</td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="ref.html">The httplib2 Library</a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="ref.html">The httplib2 Library</a>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="node2.html">1. Reference</a>
</div>
</div>
<hr />
<span class="release-info">Release 0.3, documentation updated on Mar 8, 2007.</span>
</div>
<!--End of Navigation Panel-->
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 649 B

View File

@@ -0,0 +1,205 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link rel="STYLESHEET" href="ref.css" type='text/css' />
<link rel="first" href="ref.html" title='The httplib2 Library' />
<link rel='contents' href='contents.html' title="Contents" />
<link rel='last' href='about.html' title='About this document...' />
<link rel='help' href='about.html' title='About this document...' />
<link rel="next" href="cache-objects.html" />
<link rel="prev" href="module-httplib2.html" />
<link rel="parent" href="module-httplib2.html" />
<link rel="next" href="cache-objects.html" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name='aesop' content='information' />
<title>1.1.1 Http Objects</title>
</head>
<body>
<div class="navigation">
<div id='top-navigation-panel' xml:id='top-navigation-panel'>
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="1.1 httplib2 A comprehensive"
href="module-httplib2.html"><img src='previous.png'
border='0' height='32' alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="1.1 httplib2 A comprehensive"
href="module-httplib2.html"><img src='up.png'
border='0' height='32' alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><a rel="next" title="1.1.2 cache Objects"
href="cache-objects.html"><img src='next.png'
border='0' height='32' alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">The httplib2 Library</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
href="contents.html"><img src='contents.png'
border='0' height='32' alt='Contents' width='32' /></a></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="module-httplib2.html">1.1 httplib2 A comprehensive</a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="module-httplib2.html">1.1 httplib2 A comprehensive</a>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="cache-objects.html">1.1.2 Cache Objects</a>
</div>
<hr /></div>
</div>
<!--End of Navigation Panel-->
<h2><a name="SECTION002110000000000000000"></a>
<a name="http-objects"></a>
<br>
1.1.1 Http Objects
</h2>
<p>
Http objects have the following methods:
<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-15' xml:id='l2h-15' class="method">request</tt></b>(</nobr></td>
<td><var>uri, </var><big>[</big><var>method="GET", body=None, headers=None, redirections=DEFAULT_MAX_REDIRECTS, connection_type=None</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Performs a single HTTP request.
The <var>uri</var> is the URI of the HTTP resource and can begin with either <code>http</code> or <code>https</code>. The value of <var>uri</var> must be an absolute URI.
<p>
The <var>method</var> is the HTTP method to perform, such as <code>GET</code>, <code>POST</code>, <code>DELETE</code>, etc. There is no restriction
on the methods allowed.
<p>
The <var>body</var> is the entity body to be sent with the request. It is a string
object.
<p>
Any extra headers that are to be sent with the request should be provided in the
<var>headers</var> dictionary.
<p>
The maximum number of redirect to follow before raising an exception is <var>redirections</var>. The default is 5.
<p>
The <var>connection_type</var> is the type of connection object to use. The supplied class
should implement the interface of httplib.HTTPConnection.
<p>
The return value is a tuple of (response, content), the first being and instance of the
<tt class="class">Response</tt> class, the second being a string that contains the response entity body.
</dl>
<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-16' xml:id='l2h-16' class="method">add_credentials</tt></b>(</nobr></td>
<td><var>name, password, </var><big>[</big><var>domain=None</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Adds a name and password that will be used when a request
requires authentication. Supplying the optional <var>domain</var> name will
restrict these credentials to only be sent to the specified
domain. If <var>domain</var> is not specified then the given credentials will
be used to try to satisfy every HTTP 401 challenge.
</dl>
<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-17' xml:id='l2h-17' class="method">add_certificate</tt></b>(</nobr></td>
<td><var>key, cert, domain</var>)</td></tr></table></dt>
<dd>
Add a <var>key</var> and <var>cert</var> that will be used for an SSL connection
to the specified domain. <var>keyfile</var> is the name of a PEM formatted
file that contains your private key. <var>certfile</var> is a PEM formatted certificate chain file.
</dl>
<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-18' xml:id='l2h-18' class="method">clear_credentials</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Remove all the names and passwords used for authentication.
</dl>
<p>
<dl><dt><b><tt id='l2h-19' xml:id='l2h-19' class="member">follow_redirects</tt></b></dt>
<dd>
If <code>True</code>, which is the default, safe redirects are followed, where
safe means that the client is only doing a <code>GET</code> or <code>HEAD</code> on the
URI to which it is being redirected. If <code>False</code> then no redirects are followed.
Note that a False 'follow_redirects' takes precedence over a True 'follow_all_redirects'.
Another way of saying that is for 'follow_all_redirects' to have any affect, 'follow_redirects'
must be True.
</dl>
<p>
<dl><dt><b><tt id='l2h-20' xml:id='l2h-20' class="member">follow_all_redirects</tt></b></dt>
<dd>
If <code>False</code>, which is the default, only safe redirects are followed, where
safe means that the client is only doing a <code>GET</code> or <code>HEAD</code> on the
URI to which it is being redirected. If <code>True</code> then all redirects are followed.
Note that a False 'follow_redirects' takes precedence over a True 'follow_all_redirects'.
Another way of saying that is for 'follow_all_redirects' to have any affect, 'follow_redirects'
must be True.
</dl>
<p>
<dl><dt><b><tt id='l2h-21' xml:id='l2h-21' class="member">force_exception_to_status_code</tt></b></dt>
<dd>
If <code>True</code>, which is the default, then no <tt class="module">httplib2</tt> exceptions will be thrown. Instead,
those error conditions will be turned into <tt class="class">Response</tt> objects
that will be returned normally.
<p>
If <code>False</code>, then exceptions will be thrown.
</dl>
<p>
<dl><dt><b><tt id='l2h-22' xml:id='l2h-22' class="member">ignore_etag</tt></b></dt>
<dd>
Defaults to <code>False</code>. If <code>True</code>, then any etags present in the cached response
are ignored when processing the current request, i.e. httplib2 does <strong>not</strong> use
'if-match' for PUT or 'if-none-match' when GET or HEAD requests are made. This
is mainly to deal with broken servers which supply an etag, but change it capriciously.
</dl>
<p>
<div class="navigation">
<div class='online-navigation'>
<p></p><hr />
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="1.1 httplib2 A comprehensive"
href="module-httplib2.html"><img src='previous.png'
border='0' height='32' alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="1.1 httplib2 A comprehensive"
href="module-httplib2.html"><img src='up.png'
border='0' height='32' alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><a rel="next" title="1.1.2 cache Objects"
href="cache-objects.html"><img src='next.png'
border='0' height='32' alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">The httplib2 Library</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
href="contents.html"><img src='contents.png'
border='0' height='32' alt='Contents' width='32' /></a></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="module-httplib2.html">1.1 httplib2 A comprehensive</a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="module-httplib2.html">1.1 httplib2 A comprehensive</a>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="cache-objects.html">1.1.2 Cache Objects</a>
</div>
</div>
<hr />
<span class="release-info">Release 0.3, documentation updated on Mar 8, 2007.</span>
</div>
<!--End of Navigation Panel-->
</body>
</html>

View File

@@ -0,0 +1,188 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link rel="STYLESHEET" href="ref.css" type='text/css' />
<link rel="first" href="ref.html" title='The httplib2 Library' />
<link rel='contents' href='contents.html' title="Contents" />
<link rel='last' href='about.html' title='About this document...' />
<link rel='help' href='about.html' title='About this document...' />
<link rel="prev" href="response-objects.html" />
<link rel="parent" href="module-httplib2.html" />
<link rel="next" href="about.html" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name='aesop' content='information' />
<title>1.1.4 Examples </title>
</head>
<body>
<div class="navigation">
<div id='top-navigation-panel' xml:id='top-navigation-panel'>
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="1.1.3 response Objects"
href="response-objects.html"><img src='previous.png'
border='0' height='32' alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="1.1 httplib2 A comprehensive"
href="module-httplib2.html"><img src='up.png'
border='0' height='32' alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><a rel="next" title="About this document ..."
href="about.html"><img src='next.png'
border='0' height='32' alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">The httplib2 Library</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
href="contents.html"><img src='contents.png'
border='0' height='32' alt='Contents' width='32' /></a></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="response-objects.html">1.1.3 Response Objects</a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="module-httplib2.html">1.1 httplib2 A comprehensive</a>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="about.html">About this document ...</a>
</div>
<hr /></div>
</div>
<!--End of Navigation Panel-->
<h2><a name="SECTION002140000000000000000"></a><a name="httplib2-example"></a>
<br>
1.1.4 Examples
</h2>
<p>
To do a simple <code>GET</code> request just supply the absolute URI
of the resource:
<p>
<div class="verbatim"><pre>
import httplib2
h = httplib2.Http()
resp, content = h.request("http://bitworking.org/")
assert resp.status == 200
assert resp['content-type'] == 'text/html'
</pre></div>
<p>
Here is more complex example that does a PUT
of some text to a resource that requires authentication.
The Http instance also uses a file cache
in the directory <code>.cache</code>.
<p>
<div class="verbatim"><pre>
import httplib2
h = httplib2.Http(".cache")
h.add_credentials('name', 'password')
resp, content = h.request("https://example.org/chap/2",
"PUT", body="This is text",
headers={'content-type':'text/plain'} )
</pre></div>
<p>
Here is an example that connects to a server that
supports the Atom Publishing Protocol.
<p>
<div class="verbatim"><pre>
import httplib2
h = httplib2.Http()
h.add_credentials(myname, mypasswd)
h.follow_all_redirects = True
headers = {'Content-Type': 'application/atom+xml'}
body = """&lt;?xml version="1.0" ?&gt;
&lt;entry xmlns="http://www.w3.org/2005/Atom"&gt;
&lt;title&gt;Atom-Powered Robots Run Amok&lt;/title&gt;
&lt;id&gt;urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a&lt;/id&gt;
&lt;updated&gt;2003-12-13T18:30:02Z&lt;/updated&gt;
&lt;author&gt;&lt;name&gt;John Doe&lt;/name&gt;&lt;/author&gt;
&lt;content&gt;Some text.&lt;/content&gt;
&lt;/entry&gt;
"""
uri = "http://www.example.com/collection/"
resp, content = h.request(uri, "POST", body=body, headers=headers)
</pre></div>
<p>
Here is an example of providing data to an HTML form processor.
In this case we presume this is a POST form. We need to take our
data and format it as "application/x-www-form-urlencoded" data and use that as a
body for a POST request.
<p>
<div class="verbatim"><pre>
&gt;&gt;&gt; import httplib2
&gt;&gt;&gt; import urllib
&gt;&gt;&gt; data = {'name': 'fred', 'address': '123 shady lane'}
&gt;&gt;&gt; body = urllib.urlencode(data)
&gt;&gt;&gt; body
'name=fred&amp;address=123+shady+lane'
&gt;&gt;&gt; h = httplib2.Http()
&gt;&gt;&gt; resp, content = h.request("http://example.com", method="POST", body=body)
</pre></div>
<p>
Here is an example of using a proxy server:
<div class="verbatim"><pre>
import httplib2
import socks
httplib2.debuglevel=4
h = httplib2.Http(proxy_info = httplib2.ProxyInfo(socks.PROXY_TYPE_HTTP, 'localhost', 8000))
r,c = h.request("http://bitworking.org/news/")
</pre></div>
<p>
<p>
<IMG
WIDTH="556" HEIGHT="20" ALIGN="BOTTOM" BORDER="0"
SRC="img1.png"
ALT="\begin{center}\vbox{\input{modref.ind}
}\end{center}">
<p>
<p>
<div class="navigation">
<div class='online-navigation'>
<p></p><hr />
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="1.1.3 response Objects"
href="response-objects.html"><img src='previous.png'
border='0' height='32' alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="1.1 httplib2 A comprehensive"
href="module-httplib2.html"><img src='up.png'
border='0' height='32' alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><a rel="next" title="About this document ..."
href="about.html"><img src='next.png'
border='0' height='32' alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">The httplib2 Library</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
href="contents.html"><img src='contents.png'
border='0' height='32' alt='Contents' width='32' /></a></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="response-objects.html">1.1.3 Response Objects</a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="module-httplib2.html">1.1 httplib2 A comprehensive</a>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="about.html">About this document ...</a>
</div>
</div>
<hr />
<span class="release-info">Release 0.3, documentation updated on Mar 8, 2007.</span>
</div>
<!--End of Navigation Panel-->
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 B

View File

@@ -0,0 +1,129 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link rel="STYLESHEET" href="ref.css" type='text/css' />
<link rel="first" href="ref.html" title='The httplib2 Library' />
<link rel='contents' href='contents.html' title="Contents" />
<link rel='last' href='about.html' title='About this document...' />
<link rel='help' href='about.html' title='About this document...' />
<link rel="next" href="contents.html" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name='aesop' content='information' />
<title>The httplib2 Library</title>
</head>
<body>
<div class="navigation">
<div id='top-navigation-panel' xml:id='top-navigation-panel'>
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><img src='previous.png'
border='0' height='32' alt='Previous Page' width='32' /></td>
<td class='online-navigation'><img src='up.png'
border='0' height='32' alt='Up one Level' width='32' /></td>
<td class='online-navigation'><a rel="next" title="Contents"
href="contents.html"><img src='next.png'
border='0' height='32' alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">The httplib2 Library</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
href="contents.html"><img src='contents.png'
border='0' height='32' alt='Contents' width='32' /></a></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="contents.html">Contents</a>
</div>
<hr /></div>
</div>
<!--End of Navigation Panel-->
<p>
<div class="titlepage">
<div class='center'>
<h1>The httplib2 Library</h1>
<p><b><font size="+2">Joe Gregorio</font></b></p>
<p>
Email: <span class="email">joe@bitworking.org</span>
</p>
<p><strong>Release 0.3</strong><br />
<strong>Mar 8, 2007</strong></p>
<p></p>
</div>
</div>
<p>
<h3>Abstract:</h3>
<div class="ABSTRACT">
<p>
The <tt class="module">httplib2</tt> module is a comprehensive HTTP client library
that handles caching, keep-alive, compression, redirects and
many kinds of authentication.
<p>
</div>
<p>
<p>
<p><br /></p><hr class='online-navigation' />
<div class='online-navigation'>
<!--Table of Child-Links-->
<a name="CHILD_LINKS"></a>
<ul class="ChildLinks">
<li><a href="contents.html">Contents</a>
<li><a href="node2.html">1. Reference</a>
<ul>
<li><a href="module-httplib2.html">1.1 <tt class="module">httplib2</tt>
A comprehensive HTTP client library.</a>
<ul>
<li><a href="http-objects.html">1.1.1 Http Objects</a>
<li><a href="cache-objects.html">1.1.2 Cache Objects</a>
<li><a href="response-objects.html">1.1.3 Response Objects</a>
<li><a href="httplib2-example.html">1.1.4 Examples</a>
</ul>
</ul>
<li><a href="about.html">About this document ...</a>
</ul>
<!--End of Table of Child-Links-->
</div>
<div class="navigation">
<div class='online-navigation'>
<p></p><hr />
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><img src='previous.png'
border='0' height='32' alt='Previous Page' width='32' /></td>
<td class='online-navigation'><img src='up.png'
border='0' height='32' alt='Up one Level' width='32' /></td>
<td class='online-navigation'><a rel="next" title="Contents"
href="contents.html"><img src='next.png'
border='0' height='32' alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">The httplib2 Library</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
href="contents.html"><img src='contents.png'
border='0' height='32' alt='Contents' width='32' /></a></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="contents.html">Contents</a>
</div>
</div>
<hr />
<span class="release-info">Release 0.3, documentation updated on Mar 8, 2007.</span>
</div>
<!--End of Navigation Panel-->
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 529 B

View File

@@ -0,0 +1,280 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link rel="STYLESHEET" href="ref.css" type='text/css' />
<link rel="first" href="ref.html" title='The httplib2 Library' />
<link rel='contents' href='contents.html' title="Contents" />
<link rel='last' href='about.html' title='About this document...' />
<link rel='help' href='about.html' title='About this document...' />
<link rel="prev" href="node2.html" />
<link rel="parent" href="node2.html" />
<link rel="next" href="http-objects.html" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name='aesop' content='information' />
<title>1.1 httplib2 A comprehensive HTTP client library. </title>
</head>
<body>
<div class="navigation">
<div id='top-navigation-panel' xml:id='top-navigation-panel'>
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="1. Reference"
href="node2.html"><img src='previous.png'
border='0' height='32' alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="1. Reference"
href="node2.html"><img src='up.png'
border='0' height='32' alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><a rel="next" title="1.1.1 http Objects"
href="http-objects.html"><img src='next.png'
border='0' height='32' alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">The httplib2 Library</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
href="contents.html"><img src='contents.png'
border='0' height='32' alt='Contents' width='32' /></a></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="node2.html">1. Reference</a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="node2.html">1. Reference</a>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="http-objects.html">1.1.1 Http Objects</a>
</div>
<hr /></div>
</div>
<!--End of Navigation Panel-->
<h1><a name="SECTION002100000000000000000">
1.1 <tt class="module">httplib2</tt>
A comprehensive HTTP client library. </a>
</h1>
<p>
<a name="module-httplib2"></a>
<p>
<p>
<p>
The <tt class="module">httplib2</tt> module is a comprehensive HTTP client library with the following features:
<p>
<dl>
<dt><strong>HTTP and HTTPS</strong></dt>
<dd>HTTPS support is only available if the socket module was compiled with SSL support.
</dd>
<dt><strong>Keep-Alive</strong></dt>
<dd>Supports HTTP 1.1 Keep-Alive, keeping the socket open and performing multiple requests over the same connection if possible.
</dd>
<dt><strong>Authentication</strong></dt>
<dd>The following three types of HTTP Authentication are supported. These can be used over both HTTP and HTTPS.
<ul>
<li>Digest
</li>
<li>Basic
</li>
<li>WSSE
</li>
</ul>
</dd>
<dt><strong>Caching</strong></dt>
<dd>The module can optionally operate with a private cache that understands the Cache-Control: header and uses both the ETag and Last-Modified cache validators.
</dd>
<dt><strong>All Methods</strong></dt>
<dd>The module can handle any HTTP request method, not just GET and POST.
</dd>
<dt><strong>Redirects</strong></dt>
<dd>Automatically follows 3XX redirects on GETs.
</dd>
<dt><strong>Compression</strong></dt>
<dd>Handles both 'deflate' and 'gzip' types of compression.
</dd>
<dt><strong>Proxies</strong></dt>
<dd>If the Socksipy module is installed then httplib2 can handle sock4, sock5 and http proxies.
</dd>
<dt><strong>Lost update support</strong></dt>
<dd>Automatically adds back ETags into PUT requests to resources we have already cached. This implements Section 3.2 of Detecting the Lost Update Problem Using Unreserved Checkout
</dd>
</dl>
<p>
The <tt class="module">httplib2</tt> module defines the following variables:
<p>
<dl><dt><b><tt id='l2h-2' xml:id='l2h-2'>debuglevel</tt></b></dt>
<dd>
The amount of debugging information to print. The default is 0.
</dd></dl>
<p>
The <tt class="module">httplib2</tt> module may raise the following Exceptions. Note that
there is an option that turns exceptions into
normal responses with an HTTP status code indicating
an error occured. See <tt class="member">Http.force_exception_to_status_code</tt>
<p>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-3' xml:id='l2h-3' class="exception">HttpLib2Error</tt></b></dt>
<dd>
The Base Exception for all exceptions raised by httplib2.
</dd></dl>
<p>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-4' xml:id='l2h-4' class="exception">RedirectMissingLocation</tt></b></dt>
<dd>
A 3xx redirect response code was provided but no Location: header
was provided to point to the new location.
</dd></dl>
<p>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-5' xml:id='l2h-5' class="exception">RedirectLimit</tt></b></dt>
<dd>
The maximum number of redirections was reached without coming to a final URI.
</dd></dl>
<p>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-6' xml:id='l2h-6' class="exception">ServerNotFoundError</tt></b></dt>
<dd>
Unable to resolve the host name given.
</dd></dl>
<p>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-7' xml:id='l2h-7' class="exception">RelativeURIError</tt></b></dt>
<dd>
A relative, as opposed to an absolute URI, was passed into request().
</dd></dl>
<p>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-8' xml:id='l2h-8' class="exception">FailedToDecompressContent</tt></b></dt>
<dd>
The headers claimed that the content of the response was compressed but the
decompression algorithm applied to the content failed.
</dd></dl>
<p>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-9' xml:id='l2h-9' class="exception">UnimplementedDigestAuthOptionError</tt></b></dt>
<dd>
The server requested a type of Digest authentication that we
are unfamiliar with.
</dd></dl>
<p>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-10' xml:id='l2h-10' class="exception">UnimplementedHmacDigestAuthOptionError</tt></b></dt>
<dd>
The server requested a type of HMACDigest authentication that we
are unfamiliar with.
</dd></dl>
<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><span class="typelabel">class</span>&nbsp;<tt id='l2h-11' xml:id='l2h-11' class="class">Http</tt></b>(</nobr></td>
<td><var></var><big>[</big><var>cache=None</var><big>]</big><var>, </var><big>[</big><var>timeout=None</var><big>]</big><var>, </var><big>[</big><var>proxy_info=None</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
The class that represents a client HTTP interface.
The <var>cache</var> parameter is either the name of a directory
to be used as a flat file cache, or it must an object that
implements the required caching interface.
The <var>timeout</var> parameter is the socket level timeout.
The <var>proxy_info</var> is an instance of <tt class="class">ProxyInfo</tt> and is supplied
if a proxy is to be used. Note that the Socksipy module must be
installed for proxy support to work.
</dl>
<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><span class="typelabel">class</span>&nbsp;<tt id='l2h-12' xml:id='l2h-12' class="class">Response</tt></b>(</nobr></td>
<td><var>info</var>)</td></tr></table></dt>
<dd>
Response is a subclass of <tt class="class">dict</tt> and instances of this
class are returned from calls
to Http.request. The <var>info</var> parameter is either
an <tt class="class">rfc822.Message</tt> or an <tt class="class">httplib.HTTPResponse</tt> object.
</dl>
<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><span class="typelabel">class</span>&nbsp;<tt id='l2h-13' xml:id='l2h-13' class="class">FileCache</tt></b>(</nobr></td>
<td><var>dir_name, </var><big>[</big><var>safe=safename</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
FileCache implements a Cache as a directory of files.
The <var>dir_name</var> parameter is
the name of the directory to use. If the directory does
not exist then FileCache attempts to create the directory.
The optional <var>safe</var> parameter is a funtion which generates
the cache filename for each URI. A FileCache object is
constructed and used for caching when you pass a directory name
into the constructor of <tt class="class">Http</tt>.
</dl>
<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><span class="typelabel">class</span>&nbsp;<tt id='l2h-14' xml:id='l2h-14' class="class">ProxyInfo</tt></b>(</nobr></td>
<td><var>proxy_type, proxy_host, proxy_port, </var><big>[</big><var>proxy_rdns=None</var><big>]</big><var>, </var><big>[</big><var>proxy_user=None</var><big>]</big><var>, </var><big>[</big><var>proxy_pass=None</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
The parameter <var>proxy_type</var> must be set to one of socks.PROXY_TYPE_XXX
constants. The <var>proxy_host</var> and <var>proxy_port</var> must be set to the location
of the proxy. The optional <var>proxy_rdns</var> should be set to True if
the DNS server on the proxy should be used. The <var>proxy_user</var> and
<var>proxy_pass</var> are supplied when the proxy is protected by authentication.
</dl>
<p>
<p><br /></p><hr class='online-navigation' />
<div class='online-navigation'>
<!--Table of Child-Links-->
<a name="CHILD_LINKS"><strong>Subsections</strong></a>
<ul class="ChildLinks">
<li><a href="http-objects.html">1.1.1 Http Objects</a>
<li><a href="cache-objects.html">1.1.2 Cache Objects</a>
<li><a href="response-objects.html">1.1.3 Response Objects</a>
<li><a href="httplib2-example.html">1.1.4 Examples</a>
</ul>
<!--End of Table of Child-Links-->
</div>
<div class="navigation">
<div class='online-navigation'>
<p></p><hr />
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="1. Reference"
href="node2.html"><img src='previous.png'
border='0' height='32' alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="1. Reference"
href="node2.html"><img src='up.png'
border='0' height='32' alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><a rel="next" title="1.1.1 http Objects"
href="http-objects.html"><img src='next.png'
border='0' height='32' alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">The httplib2 Library</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
href="contents.html"><img src='contents.png'
border='0' height='32' alt='Contents' width='32' /></a></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="node2.html">1. Reference</a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="node2.html">1. Reference</a>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="http-objects.html">1.1.1 Http Objects</a>
</div>
</div>
<hr />
<span class="release-info">Release 0.3, documentation updated on Mar 8, 2007.</span>
</div>
<!--End of Navigation Panel-->
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 598 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 511 B

View File

@@ -0,0 +1,115 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link rel="STYLESHEET" href="ref.css" type='text/css' />
<link rel="first" href="ref.html" title='The httplib2 Library' />
<link rel='contents' href='contents.html' title="Contents" />
<link rel='last' href='about.html' title='About this document...' />
<link rel='help' href='about.html' title='About this document...' />
<link rel="next" href="about.html" />
<link rel="prev" href="contents.html" />
<link rel="parent" href="ref.html" />
<link rel="next" href="module-httplib2.html" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name='aesop' content='information' />
<title>1. Reference</title>
</head>
<body>
<div class="navigation">
<div id='top-navigation-panel' xml:id='top-navigation-panel'>
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="Contents"
href="contents.html"><img src='previous.png'
border='0' height='32' alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="The httplib2 Library"
href="ref.html"><img src='up.png'
border='0' height='32' alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><a rel="next" title="1.1 httplib2 A comprehensive"
href="module-httplib2.html"><img src='next.png'
border='0' height='32' alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">The httplib2 Library</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
href="contents.html"><img src='contents.png'
border='0' height='32' alt='Contents' width='32' /></a></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="contents.html">Contents</a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="ref.html">The httplib2 Library</a>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="module-httplib2.html">1.1 httplib2 A comprehensive</a>
</div>
<hr /></div>
</div>
<!--End of Navigation Panel-->
<h1><a name="SECTION002000000000000000000">
1. Reference</a>
</h1>
<p>
<p>
<p><br /></p><hr class='online-navigation' />
<div class='online-navigation'>
<!--Table of Child-Links-->
<a name="CHILD_LINKS"><strong>Subsections</strong></a>
<ul class="ChildLinks">
<li><a href="module-httplib2.html">1.1 <tt class="module">httplib2</tt>
A comprehensive HTTP client library.</a>
<ul>
<li><a href="http-objects.html">1.1.1 Http Objects</a>
<li><a href="cache-objects.html">1.1.2 Cache Objects</a>
<li><a href="response-objects.html">1.1.3 Response Objects</a>
<li><a href="httplib2-example.html">1.1.4 Examples</a>
</ul></ul>
<!--End of Table of Child-Links-->
</div>
<div class="navigation">
<div class='online-navigation'>
<p></p><hr />
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="Contents"
href="contents.html"><img src='previous.png'
border='0' height='32' alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="The httplib2 Library"
href="ref.html"><img src='up.png'
border='0' height='32' alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><a rel="next" title="1.1 httplib2 A comprehensive"
href="module-httplib2.html"><img src='next.png'
border='0' height='32' alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">The httplib2 Library</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
href="contents.html"><img src='contents.png'
border='0' height='32' alt='Contents' width='32' /></a></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="contents.html">Contents</a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="ref.html">The httplib2 Library</a>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="module-httplib2.html">1.1 httplib2 A comprehensive</a>
</div>
</div>
<hr />
<span class="release-info">Release 0.3, documentation updated on Mar 8, 2007.</span>
</div>
<!--End of Navigation Panel-->
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 511 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

View File

@@ -0,0 +1,243 @@
/*
* The first part of this is the standard CSS generated by LaTeX2HTML,
* with the "empty" declarations removed.
*/
/* Century Schoolbook font is very similar to Computer Modern Math: cmmi */
.math { font-family: "Century Schoolbook", serif; }
.math i { font-family: "Century Schoolbook", serif;
font-weight: bold }
.boldmath { font-family: "Century Schoolbook", serif;
font-weight: bold }
/*
* Implement both fixed-size and relative sizes.
*
* I think these can be safely removed, as it doesn't appear that
* LaTeX2HTML ever generates these, even though these are carried
* over from the LaTeX2HTML stylesheet.
*/
small.xtiny { font-size : xx-small; }
small.tiny { font-size : x-small; }
small.scriptsize { font-size : smaller; }
small.footnotesize { font-size : small; }
big.xlarge { font-size : large; }
big.xxlarge { font-size : x-large; }
big.huge { font-size : larger; }
big.xhuge { font-size : xx-large; }
/*
* Document-specific styles come next;
* these are added for the Python documentation.
*
* Note that the size specifications for the H* elements are because
* Netscape on Solaris otherwise doesn't get it right; they all end up
* the normal text size.
*/
body { color: #000000;
background-color: #ffffff; }
a:link:active { color: #ff0000; }
a:link:hover { background-color: #bbeeff; }
a:visited:hover { background-color: #bbeeff; }
a:visited { color: #551a8b; }
a:link { color: #0000bb; }
h1, h2, h3, h4, h5, h6 { font-family: avantgarde, sans-serif;
font-weight: bold; }
h1 { font-size: 180%; }
h2 { font-size: 150%; }
h3, h4 { font-size: 120%; }
/* These are section titles used in navigation links, so make sure we
* match the section header font here, even it not the weight.
*/
.sectref { font-family: avantgarde, sans-serif; }
/* And the label before the titles in navigation: */
.navlabel { font-size: 85%; }
/* LaTeX2HTML insists on inserting <br> elements into headers which
* are marked with \label. This little bit of CSS magic ensures that
* these elements don't cause spurious whitespace to be added.
*/
h1>br, h2>br, h3>br,
h4>br, h5>br, h6>br { display: none; }
code, tt { font-family: "lucida typewriter", lucidatypewriter,
monospace; }
var { font-family: times, serif;
font-style: italic;
font-weight: normal; }
.Unix { font-variant: small-caps; }
.typelabel { font-family: lucida, sans-serif; }
.navigation td { background-color: #99ccff;
font-weight: bold;
font-family: avantgarde, sans-serif;
font-size: 110%; }
div.warning { background-color: #fffaf0;
border: thin solid black;
padding: 1em;
margin-left: 2em;
margin-right: 2em; }
div.warning .label { font-family: sans-serif;
font-size: 110%;
margin-right: 0.5em; }
div.note { background-color: #fffaf0;
border: thin solid black;
padding: 1em;
margin-left: 2em;
margin-right: 2em; }
div.note .label { margin-right: 0.5em;
font-family: sans-serif; }
address { font-size: 80%; }
.release-info { font-style: italic;
font-size: 80%; }
.titlegraphic { vertical-align: top; }
.verbatim pre { color: #00008b;
font-family: "lucida typewriter", lucidatypewriter,
monospace;
font-size: 90%; }
.verbatim { margin-left: 2em; }
.verbatim .footer { padding: 0.05in;
font-size: 85%;
background-color: #99ccff;
margin-right: 0.5in; }
.grammar { background-color: #99ccff;
margin-right: 0.5in;
padding: 0.05in; }
.grammar-footer { padding: 0.05in;
font-size: 85%; }
.grammartoken { font-family: "lucida typewriter", lucidatypewriter,
monospace; }
.productions { background-color: #bbeeff; }
.productions a:active { color: #ff0000; }
.productions a:link:hover { background-color: #99ccff; }
.productions a:visited:hover { background-color: #99ccff; }
.productions a:visited { color: #551a8b; }
.productions a:link { color: #0000bb; }
.productions table { vertical-align: baseline;
empty-cells: show; }
.productions > table td,
.productions > table th { padding: 2px; }
.productions > table td:first-child,
.productions > table td:last-child {
font-family: "lucida typewriter",
lucidatypewriter,
monospace;
}
/* same as the second selector above, but expressed differently for Opera */
.productions > table td:first-child + td + td {
font-family: "lucida typewriter",
lucidatypewriter,
monospace;
vertical-align: baseline;
}
.productions > table td:first-child + td {
padding-left: 1em;
padding-right: 1em;
}
.productions > table tr { vertical-align: baseline; }
.email { font-family: avantgarde, sans-serif; }
.mailheader { font-family: avantgarde, sans-serif; }
.mimetype { font-family: avantgarde, sans-serif; }
.newsgroup { font-family: avantgarde, sans-serif; }
.url { font-family: avantgarde, sans-serif; }
.file { font-family: avantgarde, sans-serif; }
.guilabel { font-family: avantgarde, sans-serif; }
.realtable { border-collapse: collapse;
border-color: black;
border-style: solid;
border-width: 0px 0px 2px 0px;
empty-cells: show;
margin-left: auto;
margin-right: auto;
padding-left: 0.4em;
padding-right: 0.4em;
}
.realtable tbody { vertical-align: baseline; }
.realtable tfoot { display: table-footer-group; }
.realtable thead { background-color: #99ccff;
border-width: 0px 0px 2px 1px;
display: table-header-group;
font-family: avantgarde, sans-serif;
font-weight: bold;
vertical-align: baseline;
}
.realtable thead :first-child {
border-width: 0px 0px 2px 0px;
}
.realtable thead th { border-width: 0px 0px 2px 1px }
.realtable td,
.realtable th { border-color: black;
border-style: solid;
border-width: 0px 0px 1px 1px;
padding-left: 0.4em;
padding-right: 0.4em;
}
.realtable td:first-child,
.realtable th:first-child {
border-left-width: 0px;
vertical-align: baseline;
}
.center { text-align: center; }
.left { text-align: left; }
.right { text-align: right; }
.refcount-info { font-style: italic; }
.refcount-info .value { font-weight: bold;
color: #006600; }
/*
* Some decoration for the "See also:" blocks, in part inspired by some of
* the styling on Lars Marius Garshol's XSA pages.
* (The blue in the navigation bars is #99CCFF.)
*/
.seealso { background-color: #fffaf0;
border: thin solid black;
padding: 0pt 1em 4pt 1em; }
.seealso > .heading { font-size: 110%;
font-weight: bold; }
/*
* Class 'availability' is used for module availability statements at
* the top of modules.
*/
.availability .platform { font-weight: bold; }
/*
* Additional styles for the distutils package.
*/
.du-command { font-family: monospace; }
.du-option { font-family: avantgarde, sans-serif; }
.du-filevar { font-family: avantgarde, sans-serif;
font-style: italic; }
.du-xxx:before { content: "** ";
font-weight: bold; }
.du-xxx:after { content: " **";
font-weight: bold; }
/*
* Some specialization for printed output.
*/
@media print {
.online-navigation { display: none; }
}

View File

@@ -0,0 +1,129 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link rel="STYLESHEET" href="ref.css" type='text/css' />
<link rel="first" href="ref.html" title='The httplib2 Library' />
<link rel='contents' href='contents.html' title="Contents" />
<link rel='last' href='about.html' title='About this document...' />
<link rel='help' href='about.html' title='About this document...' />
<link rel="next" href="contents.html" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name='aesop' content='information' />
<title>The httplib2 Library</title>
</head>
<body>
<div class="navigation">
<div id='top-navigation-panel' xml:id='top-navigation-panel'>
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><img src='previous.png'
border='0' height='32' alt='Previous Page' width='32' /></td>
<td class='online-navigation'><img src='up.png'
border='0' height='32' alt='Up one Level' width='32' /></td>
<td class='online-navigation'><a rel="next" title="Contents"
href="contents.html"><img src='next.png'
border='0' height='32' alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">The httplib2 Library</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
href="contents.html"><img src='contents.png'
border='0' height='32' alt='Contents' width='32' /></a></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="contents.html">Contents</a>
</div>
<hr /></div>
</div>
<!--End of Navigation Panel-->
<p>
<div class="titlepage">
<div class='center'>
<h1>The httplib2 Library</h1>
<p><b><font size="+2">Joe Gregorio</font></b></p>
<p>
Email: <span class="email">joe@bitworking.org</span>
</p>
<p><strong>Release 0.3</strong><br />
<strong>Mar 8, 2007</strong></p>
<p></p>
</div>
</div>
<p>
<h3>Abstract:</h3>
<div class="ABSTRACT">
<p>
The <tt class="module">httplib2</tt> module is a comprehensive HTTP client library
that handles caching, keep-alive, compression, redirects and
many kinds of authentication.
<p>
</div>
<p>
<p>
<p><br /></p><hr class='online-navigation' />
<div class='online-navigation'>
<!--Table of Child-Links-->
<a name="CHILD_LINKS"></a>
<ul class="ChildLinks">
<li><a href="contents.html">Contents</a>
<li><a href="node2.html">1. Reference</a>
<ul>
<li><a href="module-httplib2.html">1.1 <tt class="module">httplib2</tt>
A comprehensive HTTP client library.</a>
<ul>
<li><a href="http-objects.html">1.1.1 Http Objects</a>
<li><a href="cache-objects.html">1.1.2 Cache Objects</a>
<li><a href="response-objects.html">1.1.3 Response Objects</a>
<li><a href="httplib2-example.html">1.1.4 Examples</a>
</ul>
</ul>
<li><a href="about.html">About this document ...</a>
</ul>
<!--End of Table of Child-Links-->
</div>
<div class="navigation">
<div class='online-navigation'>
<p></p><hr />
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><img src='previous.png'
border='0' height='32' alt='Previous Page' width='32' /></td>
<td class='online-navigation'><img src='up.png'
border='0' height='32' alt='Up one Level' width='32' /></td>
<td class='online-navigation'><a rel="next" title="Contents"
href="contents.html"><img src='next.png'
border='0' height='32' alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">The httplib2 Library</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
href="contents.html"><img src='contents.png'
border='0' height='32' alt='Contents' width='32' /></a></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="contents.html">Contents</a>
</div>
</div>
<hr />
<span class="release-info">Release 0.3, documentation updated on Mar 8, 2007.</span>
</div>
<!--End of Navigation Panel-->
</body>
</html>

View File

@@ -0,0 +1,151 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link rel="STYLESHEET" href="ref.css" type='text/css' />
<link rel="first" href="ref.html" title='The httplib2 Library' />
<link rel='contents' href='contents.html' title="Contents" />
<link rel='last' href='about.html' title='About this document...' />
<link rel='help' href='about.html' title='About this document...' />
<link rel="next" href="httplib2-example.html" />
<link rel="prev" href="cache-objects.html" />
<link rel="parent" href="module-httplib2.html" />
<link rel="next" href="httplib2-example.html" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name='aesop' content='information' />
<title>1.1.3 Response Objects</title>
</head>
<body>
<div class="navigation">
<div id='top-navigation-panel' xml:id='top-navigation-panel'>
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="1.1.2 cache Objects"
href="cache-objects.html"><img src='previous.png'
border='0' height='32' alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="1.1 httplib2 A comprehensive"
href="module-httplib2.html"><img src='up.png'
border='0' height='32' alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><a rel="next" title="1.1.4 Examples"
href="httplib2-example.html"><img src='next.png'
border='0' height='32' alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">The httplib2 Library</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
href="contents.html"><img src='contents.png'
border='0' height='32' alt='Contents' width='32' /></a></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="cache-objects.html">1.1.2 Cache Objects</a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="module-httplib2.html">1.1 httplib2 A comprehensive</a>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="httplib2-example.html">1.1.4 Examples</a>
</div>
<hr /></div>
</div>
<!--End of Navigation Panel-->
<h2><a name="SECTION002130000000000000000"></a>
<a name="response-objects"></a>
<br>
1.1.3 Response Objects
</h2>
<p>
Response objects are derived from <tt class="class">dict</tt> and map
header names (lower case with the trailing colon removed)
to header values. In addition to the dict methods
a Response object also has:
<p>
<dl><dt><b><tt id='l2h-26' xml:id='l2h-26' class="member">fromcache</tt></b></dt>
<dd>
If <code>true</code> the the response was returned from the cache.
</dl>
<p>
<dl><dt><b><tt id='l2h-27' xml:id='l2h-27' class="member">version</tt></b></dt>
<dd>
The version of HTTP that the server supports. A value
of 11 means '1.1'.
</dl>
<p>
<dl><dt><b><tt id='l2h-28' xml:id='l2h-28' class="member">status</tt></b></dt>
<dd>
The numerical HTTP status code returned in the response.
</dl>
<p>
<dl><dt><b><tt id='l2h-29' xml:id='l2h-29' class="member">reason</tt></b></dt>
<dd>
The human readable component of the HTTP response status code.
</dl>
<p>
<dl><dt><b><tt id='l2h-30' xml:id='l2h-30' class="member">previous</tt></b></dt>
<dd>
If redirects are followed then the <tt class="class">Response</tt> object returned
is just for the very last HTTP request and <var>previous</var> points to
the previous <tt class="class">Response</tt> object. In this manner they form a chain
going back through the responses to the very first response.
Will be <code>None</code> if there are no previous respones.
</dl>
<p>
The Response object also populates the header <code>content-location</code>, that
contains the URI that was ultimately requested. This is useful if
redirects were encountered, you can determine the ultimate URI that
the request was sent to. All Response objects contain this key value,
including <code>previous</code> responses so you can determine the entire
chain of redirects. If <tt class="member">Http.force_exception_to_status_code</tt> is <code>True</code>
and the number of redirects has exceeded the number of allowed number
of redirects then the <tt class="class">Response</tt> object will report the error
in the status code, but the complete chain of previous responses will
still be in tact.
<p>
<div class="navigation">
<div class='online-navigation'>
<p></p><hr />
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="1.1.2 cache Objects"
href="cache-objects.html"><img src='previous.png'
border='0' height='32' alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="1.1 httplib2 A comprehensive"
href="module-httplib2.html"><img src='up.png'
border='0' height='32' alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><a rel="next" title="1.1.4 Examples"
href="httplib2-example.html"><img src='next.png'
border='0' height='32' alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">The httplib2 Library</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
href="contents.html"><img src='contents.png'
border='0' height='32' alt='Contents' width='32' /></a></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="cache-objects.html">1.1.2 Cache Objects</a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="module-httplib2.html">1.1 httplib2 A comprehensive</a>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="httplib2-example.html">1.1.4 Examples</a>
</div>
</div>
<hr />
<span class="release-info">Release 0.3, documentation updated on Mar 8, 2007.</span>
</div>
<!--End of Navigation Panel-->
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 577 B