diff options
-rw-r--r--[-rwxr-xr-x] | README | 82 | ||||
-rw-r--r-- | doc/html/_sources/libhttplib2.txt | 20 | ||||
-rw-r--r-- | doc/html/genindex.html | 20 | ||||
-rw-r--r-- | doc/html/index.html | 14 | ||||
-rw-r--r-- | doc/html/libhttplib2.html | 14 | ||||
-rw-r--r-- | doc/html/modindex.html | 16 | ||||
-rw-r--r-- | doc/html/search.html | 20 | ||||
-rw-r--r-- | doc/libhttplib2.rst | 20 | ||||
-rw-r--r--[-rwxr-xr-x] | index.html | 34 | ||||
-rw-r--r-- | libhttplib2.tex | 78 | ||||
-rw-r--r-- | python2/httplib2/iri2uri.py | 18 | ||||
-rw-r--r--[-rwxr-xr-x] | python3/httplib2/iri2uri.py | 18 | ||||
-rwxr-xr-x | python3/httplib2test.py | 102 | ||||
-rw-r--r--[-rwxr-xr-x] | ref/cache-objects.html | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | ref/http-objects.html | 6 | ||||
-rw-r--r--[-rwxr-xr-x] | ref/httplib2-example.html | 20 | ||||
-rw-r--r--[-rwxr-xr-x] | ref/index.html | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | ref/module-httplib2.html | 32 | ||||
-rw-r--r--[-rwxr-xr-x] | ref/node2.html | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | ref/ref.html | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | ref/response-objects.html | 2 | ||||
-rwxr-xr-x | setup.py | 10 | ||||
-rwxr-xr-x | test/conditional-updates/test.cgi | 2 | ||||
-rwxr-xr-x | test/gzip/post.cgi | 2 |
24 files changed, 269 insertions, 269 deletions
@@ -3,18 +3,18 @@ Httplib2 -------------------------------------------------------------------- Introduction -A comprehensive HTTP client library, httplib2.py supports many +A comprehensive HTTP client library, httplib2.py supports many features left out of other HTTP libraries. HTTP and HTTPS - HTTPS support is only available if the socket module was - compiled with SSL support. + HTTPS support is only available if the socket module was + compiled with SSL support. Keep-Alive - Supports HTTP 1.1 Keep-Alive, keeping the socket open and - performing multiple requests over the same connection if - possible. + Supports HTTP 1.1 Keep-Alive, keeping the socket open and + performing multiple requests over the same connection if + possible. Authentication - The following three types of HTTP Authentication are + The following three types of HTTP Authentication are supported. These can be used over both HTTP and HTTPS. * Digest @@ -22,22 +22,22 @@ Authentication * WSSE Caching - 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. + 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. All Methods - The module can handle any HTTP request method, not just GET + The module can handle any HTTP request method, not just GET and POST. Redirects Automatically follows 3XX redirects on GETs. Compression Handles both 'deflate' and 'gzip' types of compression. Lost update support - Automatically adds back ETags into PUT requests to resources - we have already cached. This implements Section 3.2 of + 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. Unit Tested - A large and growing set of unit tests. + A large and growing set of unit tests. For more information on this module, see: @@ -63,7 +63,7 @@ A simple retrieval: h = httplib2.Http(".cache") (resp_headers, content) = h.request("http://example.org/", "GET") -The 'content' is the content retrieved from the URL. The content +The 'content' is the content retrieved from the URL. The content is already decompressed or unzipped if necessary. To PUT some content to a server that uses SSL and Basic authentication: @@ -71,8 +71,8 @@ To PUT some content to a server that uses SSL and Basic authentication: import httplib2 h = httplib2.Http(".cache") h.add_credentials('name', 'password') - (resp, content) = h.request("https://example.org/chapter/2", - "PUT", body="This is text", + (resp, content) = h.request("https://example.org/chapter/2", + "PUT", body="This is text", headers={'content-type':'text/plain'} ) Use the Cache-Control: header to control how the caching operates. @@ -81,18 +81,18 @@ Use the Cache-Control: header to control how the caching operates. h = httplib2.Http(".cache") (resp, content) = h.request("http://bitworking.org/", "GET") ... - (resp, content) = h.request("http://bitworking.org/", "GET", + (resp, content) = h.request("http://bitworking.org/", "GET", headers={'cache-control':'no-cache'}) -The first request will be cached and since this is a request -to bitworking.org it will be set to be cached for two hours, -because that is how I have my server configured. Any subsequent -GET to that URI will return the value from the on-disk cache -and no request will be made to the server. You can use the -Cache-Control: header to change the caches behavior and in -this example the second request adds the Cache-Control: -header with a value of 'no-cache' which tells the library -that the cached copy must not be used when handling this request. +The first request will be cached and since this is a request +to bitworking.org it will be set to be cached for two hours, +because that is how I have my server configured. Any subsequent +GET to that URI will return the value from the on-disk cache +and no request will be made to the server. You can use the +Cache-Control: header to change the caches behavior and in +this example the second request adds the Cache-Control: +header with a value of 'no-cache' which tells the library +that the cached copy must not be used when handling this request. -------------------------------------------------------------------- @@ -100,23 +100,23 @@ Httplib2 Software License Copyright (c) 2006 by Joe Gregorio -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of the Software, -and to permit persons to whom the Software is furnished to do so, +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/doc/html/_sources/libhttplib2.txt b/doc/html/_sources/libhttplib2.txt index d8e33d0..a407bfe 100644 --- a/doc/html/_sources/libhttplib2.txt +++ b/doc/html/_sources/libhttplib2.txt @@ -1,11 +1,11 @@ .. % Template for a library manual section. .. % PLEASE REMOVE THE COMMENTS AFTER USING THE TEMPLATE -.. % +.. % .. % Complete documentation on the extended LaTeX markup used for Python .. % documentation is available in ``Documenting Python'', which is part .. % of the standard documentation for Python. It may be found online .. % at: -.. % +.. % .. % http://www.python.org/doc/current/doc/doc.html .. % ==== 0. ==== .. % Copy this file to <mydir>/lib<mymodule>.tex, and edit that file @@ -29,7 +29,7 @@ .. % Choose one of these to specify the module module name. If there's .. % an underscore in the name, use .. % \declaremodule[modname]{...}{mod_name} instead. -.. % +.. % .. % not standard, in Python .. % Portability statement: Uncomment and fill in the parameter to specify the .. % availability of the module. The parameter can be Unix, IRIX, SunOS, Mac, @@ -37,7 +37,7 @@ .. % statement will say ``Macintosh'' and the Module Index may say ``Mac''. .. % Please use a name that has already been used whenever applicable. If this .. % is omitted, no availability statement is produced or implied. -.. % +.. % .. % \platform{Unix} .. % These apply to all modules, and may be given more than once: .. % Author of the module code; @@ -180,16 +180,16 @@ code indicating an error occured. See .. % ---- 3.4. ---- .. % Other standard environments: -.. % -.. % classdesc - Python classes; same arguments are funcdesc -.. % methoddesc - methods, like funcdesc but has an optional parameter +.. % +.. % classdesc - Python classes; same arguments are funcdesc +.. % methoddesc - methods, like funcdesc but has an optional parameter .. % to give the type name: \begin{methoddesc}[mytype]{name}{args} .. % By default, the type name will be the name of the .. % last class defined using classdesc. The type name .. % is required if the type is implemented in C (because .. % there's no classdesc) or if the class isn't directly .. % documented (if it's private). -.. % memberdesc - data members, like datadesc, but with an optional +.. % memberdesc - data members, like datadesc, but with an optional .. % type name like methoddesc. @@ -441,8 +441,8 @@ directory ``.cache``. :: 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", + resp, content = h.request("https://example.org/chap/2", + "PUT", body="This is text", headers={'content-type':'text/plain'} ) Here is an example that connects to a server that supports the Atom Publishing diff --git a/doc/html/genindex.html b/doc/html/genindex.html index e36d001..0088470 100644 --- a/doc/html/genindex.html +++ b/doc/html/genindex.html @@ -4,7 +4,7 @@ <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - + <title>Index — httplib2 v0.4 documentation</title> <link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> @@ -19,7 +19,7 @@ </script> <script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/doctools.js"></script> - <link rel="top" title="httplib2 v0.4 documentation" href="index.html" /> + <link rel="top" title="httplib2 v0.4 documentation" href="index.html" /> </head> <body> <div class="related"> @@ -31,23 +31,23 @@ <li class="right" > <a href="modindex.html" title="Global Module Index" accesskey="M">modules</a> |</li> - <li><a href="index.html">httplib2 v0.4 documentation</a> »</li> + <li><a href="index.html">httplib2 v0.4 documentation</a> »</li> </ul> - </div> + </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> - + <h1 id="index">Index</h1> - <a href="#A"><strong>A</strong></a> | <a href="#C"><strong>C</strong></a> | <a href="#D"><strong>D</strong></a> | <a href="#F"><strong>F</strong></a> | <a href="#G"><strong>G</strong></a> | <a href="#H"><strong>H</strong></a> | <a href="#I"><strong>I</strong></a> | <a href="#O"><strong>O</strong></a> | <a href="#P"><strong>P</strong></a> | <a href="#R"><strong>R</strong></a> | <a href="#S"><strong>S</strong></a> | <a href="#U"><strong>U</strong></a> | <a href="#V"><strong>V</strong></a> + <a href="#A"><strong>A</strong></a> | <a href="#C"><strong>C</strong></a> | <a href="#D"><strong>D</strong></a> | <a href="#F"><strong>F</strong></a> | <a href="#G"><strong>G</strong></a> | <a href="#H"><strong>H</strong></a> | <a href="#I"><strong>I</strong></a> | <a href="#O"><strong>O</strong></a> | <a href="#P"><strong>P</strong></a> | <a href="#R"><strong>R</strong></a> | <a href="#S"><strong>S</strong></a> | <a href="#U"><strong>U</strong></a> | <a href="#V"><strong>V</strong></a> <hr /> - + <h2 id="A">A</h2> <table width="100%" class="indextable"><tr><td width="33%" valign="top"> <dl> @@ -167,7 +167,7 @@ <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> - + <div id="searchbox" style="display: none"> <h3>Quick search</h3> @@ -195,7 +195,7 @@ <li class="right" > <a href="modindex.html" title="Global Module Index" >modules</a> |</li> - <li><a href="index.html">httplib2 v0.4 documentation</a> »</li> + <li><a href="index.html">httplib2 v0.4 documentation</a> »</li> </ul> </div> <div class="footer"> @@ -204,4 +204,4 @@ Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.4. </div> </body> -</html>
\ No newline at end of file +</html> diff --git a/doc/html/index.html b/doc/html/index.html index 330adc5..adc081e 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -4,7 +4,7 @@ <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - + <title>The httplib2 Library — httplib2 v0.4 documentation</title> <link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> @@ -20,7 +20,7 @@ <script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/doctools.js"></script> <link rel="top" title="httplib2 v0.4 documentation" href="#" /> - <link rel="next" title="httplib2 A comprehensive HTTP client library." href="libhttplib2.html" /> + <link rel="next" title="httplib2 A comprehensive HTTP client library." href="libhttplib2.html" /> </head> <body> <div class="related"> @@ -35,15 +35,15 @@ <li class="right" > <a href="libhttplib2.html" title="httplib2 A comprehensive HTTP client library." accesskey="N">next</a> |</li> - <li><a href="#">httplib2 v0.4 documentation</a> »</li> + <li><a href="#">httplib2 v0.4 documentation</a> »</li> </ul> - </div> + </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> - + <div class="section" id="the-httplib2-library"> <h1>The httplib2 Library<a class="headerlink" href="#the-httplib2-library" title="Permalink to this headline">¶</a></h1> <table class="docutils field-list" frame="void" rules="none"> @@ -132,7 +132,7 @@ caching, keep-alive, compression, redirects and many kinds of authentication.</p <li class="right" > <a href="libhttplib2.html" title="httplib2 A comprehensive HTTP client library." >next</a> |</li> - <li><a href="#">httplib2 v0.4 documentation</a> »</li> + <li><a href="#">httplib2 v0.4 documentation</a> »</li> </ul> </div> <div class="footer"> @@ -141,4 +141,4 @@ caching, keep-alive, compression, redirects and many kinds of authentication.</p Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.4. </div> </body> -</html>
\ No newline at end of file +</html> diff --git a/doc/html/libhttplib2.html b/doc/html/libhttplib2.html index ec9048b..e908a46 100644 --- a/doc/html/libhttplib2.html +++ b/doc/html/libhttplib2.html @@ -4,7 +4,7 @@ <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - + <title>httplib2 A comprehensive HTTP client library. — httplib2 v0.4 documentation</title> <link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> @@ -20,7 +20,7 @@ <script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/doctools.js"></script> <link rel="top" title="httplib2 v0.4 documentation" href="index.html" /> - <link rel="prev" title="The httplib2 Library" href="index.html" /> + <link rel="prev" title="The httplib2 Library" href="index.html" /> </head> <body> <div class="related"> @@ -35,15 +35,15 @@ <li class="right" > <a href="index.html" title="The httplib2 Library" accesskey="P">previous</a> |</li> - <li><a href="index.html">httplib2 v0.4 documentation</a> »</li> + <li><a href="index.html">httplib2 v0.4 documentation</a> »</li> </ul> - </div> + </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> - + <div class="section" id="module-httplib2"> <h1><tt class="xref docutils literal"><span class="pre">httplib2</span></tt> A comprehensive HTTP client library.<a class="headerlink" href="#module-httplib2" title="Permalink to this headline">¶</a></h1> <p>The <tt class="xref docutils literal"><span class="pre">httplib2</span></tt> module is a comprehensive HTTP client library with the @@ -478,7 +478,7 @@ request.</p> <li class="right" > <a href="index.html" title="The httplib2 Library" >previous</a> |</li> - <li><a href="index.html">httplib2 v0.4 documentation</a> »</li> + <li><a href="index.html">httplib2 v0.4 documentation</a> »</li> </ul> </div> <div class="footer"> @@ -487,4 +487,4 @@ request.</p> Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.4. </div> </body> -</html>
\ No newline at end of file +</html> diff --git a/doc/html/modindex.html b/doc/html/modindex.html index 881226a..6c086f9 100644 --- a/doc/html/modindex.html +++ b/doc/html/modindex.html @@ -4,7 +4,7 @@ <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - + <title>Global Module Index — httplib2 v0.4 documentation</title> <link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> @@ -20,7 +20,7 @@ <script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/doctools.js"></script> <link rel="top" title="httplib2 v0.4 documentation" href="index.html" /> - + <script type="text/javascript"> DOCUMENTATION_OPTIONS.COLLAPSE_MODINDEX = true; @@ -38,18 +38,18 @@ <li class="right" > <a href="#" title="Global Module Index" accesskey="M">modules</a> |</li> - <li><a href="index.html">httplib2 v0.4 documentation</a> »</li> + <li><a href="index.html">httplib2 v0.4 documentation</a> »</li> </ul> - </div> + </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> - + <h1 id="global-module-index">Global Module Index</h1> - <a href="#cap-H"><strong>H</strong></a> + <a href="#cap-H"><strong>H</strong></a> <hr/> <table width="100%" class="indextable" cellspacing="0" cellpadding="2"><tr class="pcap"><td></td><td> </td><td></td></tr> @@ -92,7 +92,7 @@ <li class="right" > <a href="#" title="Global Module Index" >modules</a> |</li> - <li><a href="index.html">httplib2 v0.4 documentation</a> »</li> + <li><a href="index.html">httplib2 v0.4 documentation</a> »</li> </ul> </div> <div class="footer"> @@ -101,4 +101,4 @@ Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.4. </div> </body> -</html>
\ No newline at end of file +</html> diff --git a/doc/html/search.html b/doc/html/search.html index a169c98..4bb501f 100644 --- a/doc/html/search.html +++ b/doc/html/search.html @@ -4,7 +4,7 @@ <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - + <title>Search — httplib2 v0.4 documentation</title> <link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> @@ -20,7 +20,7 @@ <script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/searchtools.js"></script> - <link rel="top" title="httplib2 v0.4 documentation" href="index.html" /> + <link rel="top" title="httplib2 v0.4 documentation" href="index.html" /> </head> <body> <div class="related"> @@ -32,15 +32,15 @@ <li class="right" > <a href="modindex.html" title="Global Module Index" accesskey="M">modules</a> |</li> - <li><a href="index.html">httplib2 v0.4 documentation</a> »</li> + <li><a href="index.html">httplib2 v0.4 documentation</a> »</li> </ul> - </div> + </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> - + <h1 id="search-documentation">Search</h1> <div id="fallback" class="admonition warning"> <script type="text/javascript">$('#fallback').hide();</script> @@ -60,9 +60,9 @@ <input type="submit" value="search" /> <span id="search-progress" style="padding-left: 10px"></span> </form> - + <div id="search-results"> - + </div> </div> @@ -83,10 +83,10 @@ <li class="right" > <a href="modindex.html" title="Global Module Index" >modules</a> |</li> - <li><a href="index.html">httplib2 v0.4 documentation</a> »</li> + <li><a href="index.html">httplib2 v0.4 documentation</a> »</li> </ul> </div> - + <div class="footer"> © Copyright 2008, Joe Gregorio. Last updated on Aug 28, 2012. @@ -95,4 +95,4 @@ <script type="text/javascript" src="searchindex.js"></script> </body> -</html>
\ No newline at end of file +</html> diff --git a/doc/libhttplib2.rst b/doc/libhttplib2.rst index d8e33d0..a407bfe 100644 --- a/doc/libhttplib2.rst +++ b/doc/libhttplib2.rst @@ -1,11 +1,11 @@ .. % Template for a library manual section. .. % PLEASE REMOVE THE COMMENTS AFTER USING THE TEMPLATE -.. % +.. % .. % Complete documentation on the extended LaTeX markup used for Python .. % documentation is available in ``Documenting Python'', which is part .. % of the standard documentation for Python. It may be found online .. % at: -.. % +.. % .. % http://www.python.org/doc/current/doc/doc.html .. % ==== 0. ==== .. % Copy this file to <mydir>/lib<mymodule>.tex, and edit that file @@ -29,7 +29,7 @@ .. % Choose one of these to specify the module module name. If there's .. % an underscore in the name, use .. % \declaremodule[modname]{...}{mod_name} instead. -.. % +.. % .. % not standard, in Python .. % Portability statement: Uncomment and fill in the parameter to specify the .. % availability of the module. The parameter can be Unix, IRIX, SunOS, Mac, @@ -37,7 +37,7 @@ .. % statement will say ``Macintosh'' and the Module Index may say ``Mac''. .. % Please use a name that has already been used whenever applicable. If this .. % is omitted, no availability statement is produced or implied. -.. % +.. % .. % \platform{Unix} .. % These apply to all modules, and may be given more than once: .. % Author of the module code; @@ -180,16 +180,16 @@ code indicating an error occured. See .. % ---- 3.4. ---- .. % Other standard environments: -.. % -.. % classdesc - Python classes; same arguments are funcdesc -.. % methoddesc - methods, like funcdesc but has an optional parameter +.. % +.. % classdesc - Python classes; same arguments are funcdesc +.. % methoddesc - methods, like funcdesc but has an optional parameter .. % to give the type name: \begin{methoddesc}[mytype]{name}{args} .. % By default, the type name will be the name of the .. % last class defined using classdesc. The type name .. % is required if the type is implemented in C (because .. % there's no classdesc) or if the class isn't directly .. % documented (if it's private). -.. % memberdesc - data members, like datadesc, but with an optional +.. % memberdesc - data members, like datadesc, but with an optional .. % type name like methoddesc. @@ -441,8 +441,8 @@ directory ``.cache``. :: 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", + resp, content = h.request("https://example.org/chap/2", + "PUT", body="This is text", headers={'content-type':'text/plain'} ) Here is an example that connects to a server that supports the Atom Publishing diff --git a/index.html b/index.html index 0e91a33..5a98539 100755..100644 --- a/index.html +++ b/index.html @@ -8,11 +8,11 @@ <!--#include virtual="titlebar.html" --> <div class="content"> - + <div> <h2>Httplib2</h2> - <p>A comprehensive HTTP client library, <code>httplib2.py</code> + <p>A comprehensive HTTP client library, <code>httplib2.py</code> supports many features left out of other HTTP libraries. </p> <dl> @@ -21,13 +21,13 @@ </dd> <dt>Keep-Alive</dt> - <dd>Supports HTTP 1.1 Keep-Alive, keeping the socket + <dd>Supports HTTP 1.1 Keep-Alive, keeping the socket open and performing multiple requests over the same connection if possible. </dd> <dt>Authentication</dt> - <dd>The following types of HTTP Authentication are supported. + <dd>The following types of HTTP Authentication are supported. These can be used over both HTTP and HTTPS. <ul> <li><a href="http://www.faqs.org/rfcs/rfc2617.html">Digest</a></li> @@ -55,7 +55,7 @@ <dt>Lost update support</dt> <dd>Automatically adds back ETags into PUT requests to resources - we have already cached. This implements Section 3.2 of + we have already cached. This implements Section 3.2 of <a href="http://www.w3.org/1999/04/Editing/#Table">Detecting the Lost Update Problem Using Unreserved Checkout</a></dd> <dt>Unit Tested</dt> @@ -83,8 +83,8 @@ and Basic authentication:</p> <pre><code>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", +resp, content = h.request("https://example.org/chap/2", + "PUT", body="This is text", headers={'content-type':'text/plain'} ) </code></pre> @@ -95,11 +95,11 @@ resp, content = h.request("https://example.org/chap/2", h = httplib2.Http(".cache") resp, content = h.request("http://bitworking.org/") ... -resp, content = h.request("http://bitworking.org/", +resp, content = h.request("http://bitworking.org/", headers={'cache-control':'no-cache'}) </code></pre> -<p>The first request will be cached and since this is a request to +<p>The first request will be cached and since this is a request to bitworking.org it will be set to be cached for two hours, because that is how I have my server configured. Any subsequent GET to that URI will return the value from the @@ -117,8 +117,8 @@ any libraries beyond what is found in the core library.</p> <h3>Download/Installation</h3> -<p>The latest release of httplib2 is 0.3.0 and -can be <a href="dist">downloaded from the from +<p>The latest release of httplib2 is 0.3.0 and +can be <a href="dist">downloaded from the from the dist directory</a>. See the <a href="CHANGELOG">CHANGELOG</a> for what's new in this version.</p> @@ -139,13 +139,13 @@ command:</p> subversion repository.</p> <pre>svn co https://httplib2.svn.sourceforge.net/svnroot/httplib2/trunk httplib2</pre> - + <h3>Documentation</h3> <p>In addition to the <a href="ref/">Python library style documentation</a> there are also two articles on XML.com, <a href="http://www.xml.com/pub/a/2006/02/01/doing-http-caching-right-introducing-httplib2.html"> - Doing HTTP Caching Right: Introducing httplib2</a> and + Doing HTTP Caching Right: Introducing httplib2</a> and <a href="http://www.xml.com/pub/a/2006/03/29/httplib2-http-persistence-and-authentication.html"> httplib2: HTTP Persistence and Authentication </a>. @@ -153,7 +153,7 @@ httplib2: HTTP Persistence and Authentication </a>. <h3>Feedback</h3> -<p>Bugs and enhancement requests are handled through +<p>Bugs and enhancement requests are handled through <a href="http://sourceforge.net/projects/httplib2/">SourceForge</a>, and anything is up for discussion on the <a href="http://sourceforge.net/mail/?group_id=161082">httplib2 mailing list</a>. </p> @@ -163,8 +163,8 @@ on the <a href="http://sourceforge.net/mail/?group_id=161082">httplib2 mailing l <p>This module is not perfect and needs the following:</p> <ul> <li>Support for Proxies</li> - <li>A pluggable store for the cache is in place, with plugins for - flat files and memcached. + <li>A pluggable store for the cache is in place, with plugins for + flat files and memcached. I eventually want to have plugins that allow keeping the cache in Berkeley DB, MySQL, etc.</li> <li>More unit tests</li> </ul> @@ -195,7 +195,7 @@ on the <a href="http://sourceforge.net/mail/?group_id=161082">httplib2 mailing l <dd> (Your Name Here) </dd> </dl> </p> - + <p style="font-size: small">This page last updated on: $LastChangedDate$.</p> </div> diff --git a/libhttplib2.tex b/libhttplib2.tex index 100de7a..0c958c3 100644 --- a/libhttplib2.tex +++ b/libhttplib2.tex @@ -20,14 +20,14 @@ % appropriate. -\section{\module{httplib2} +\section{\module{httplib2} A comprehensive HTTP client library. } % Choose one of these to specify the module module name. If there's % an underscore in the name, use % \declaremodule[modname]{...}{mod_name} instead. % -\declaremodule{}{httplib2} % not standard, in Python +\declaremodule{}{httplib2} % not standard, in Python % Portability statement: Uncomment and fill in the parameter to specify the % availability of the module. The parameter can be Unix, IRIX, SunOS, Mac, @@ -40,10 +40,10 @@ % These apply to all modules, and may be given more than once: -\moduleauthor{Joe Gregorio}{joe@bitworking.org} % Author of the module code; - % omit if not known. -\sectionauthor{Joe Gregorio}{joe@bitworking.org} % Author of the documentation, - % even if not a module section. +\moduleauthor{Joe Gregorio}{joe@bitworking.org} % Author of the module code; + % omit if not known. +\sectionauthor{Joe Gregorio}{joe@bitworking.org} % Author of the documentation, + % even if not a module section. % Leave at least one blank line after this, to simplify ad-hoc tools @@ -60,8 +60,8 @@ The \module{httplib2} module is a comprehensive HTTP client library with the following features: \begin{description} -\item[HTTP and HTTPS] HTTPS support is only available if the socket module was compiled with SSL support. -\item[Keep-Alive] Supports HTTP 1.1 Keep-Alive, keeping the socket open and performing multiple requests over the same connection if possible. +\item[HTTP and HTTPS] HTTPS support is only available if the socket module was compiled with SSL support. +\item[Keep-Alive] Supports HTTP 1.1 Keep-Alive, keeping the socket open and performing multiple requests over the same connection if possible. \item[Authentication] The following three types of HTTP Authentication are supported. These can be used over both HTTP and HTTPS. \begin{itemize} \item Digest @@ -69,7 +69,7 @@ The \module{httplib2} module is a comprehensive HTTP client library with the fol \item WSSE \end{itemize} \item[Caching] - 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. + 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. \item[All Methods] The module can handle any HTTP request method, not just GET and POST. \item[Redirects] @@ -108,8 +108,8 @@ The default is 2. % the source code should be documented using this environment, but % constructor parameters must be omitted. -The \module{httplib2} module may raise the following Exceptions. Note that -there is an option that turns exceptions into +The \module{httplib2} 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 \member{Http.force_exception_to_status_code} @@ -118,7 +118,7 @@ The Base Exception for all exceptions raised by httplib2. \end{excdesc} \begin{excdesc}{RedirectMissingLocation} -A 3xx redirect response code was provided but no Location: header +A 3xx redirect response code was provided but no Location: header was provided to point to the new location. \end{excdesc} @@ -153,21 +153,21 @@ are unfamiliar with. % ---- 3.4. ---- % Other standard environments: % -% classdesc - Python classes; same arguments are funcdesc -% methoddesc - methods, like funcdesc but has an optional parameter -% to give the type name: \begin{methoddesc}[mytype]{name}{args} -% By default, the type name will be the name of the -% last class defined using classdesc. The type name -% is required if the type is implemented in C (because -% there's no classdesc) or if the class isn't directly -% documented (if it's private). -% memberdesc - data members, like datadesc, but with an optional -% type name like methoddesc. +% classdesc - Python classes; same arguments are funcdesc +% methoddesc - methods, like funcdesc but has an optional parameter +% to give the type name: \begin{methoddesc}[mytype]{name}{args} +% By default, the type name will be the name of the +% last class defined using classdesc. The type name +% is required if the type is implemented in C (because +% there's no classdesc) or if the class isn't directly +% documented (if it's private). +% memberdesc - data members, like datadesc, but with an optional +% type name like methoddesc. \begin{classdesc}{Http}{\optional{cache=None}, \optional{timeout=None}, \optional{proxy_info=None}} The class that represents a client HTTP interface. The \var{cache} parameter is either the name of a directory -to be used as a flat file cache, or it must an object that +to be used as a flat file cache, or it must an object that implements the required caching interface. The \var{timeout} parameter is the socket level timeout. The \var{proxy_info} is an instance of \class{ProxyInfo} and is supplied @@ -176,9 +176,9 @@ installed for proxy support to work. \end{classdesc} \begin{classdesc}{Response}{info} -Response is a subclass of \class{dict} and instances of this +Response is a subclass of \class{dict} and instances of this class are returned from calls -to Http.request. The \var{info} parameter is either +to Http.request. The \var{info} parameter is either an \class{rfc822.Message} or an \class{httplib.HTTPResponse} object. \end{classdesc} @@ -188,7 +188,7 @@ The \var{dir_name} 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} parameter is a funtion which generates -the cache filename for each URI. A FileCache object is +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 \class{Http}. \end{classdesc} @@ -197,7 +197,7 @@ into the constructor of \class{Http}. The parameter \var{proxy_type} must be set to one of socks.PROXY_TYPE_XXX constants. The \var{proxy_host} and \var{proxy_port} must be set to the location of the proxy. The optional \var{proxy_rdns} should be set to True if -the DNS server on the proxy should be used. The \var{proxy_user} and +the DNS server on the proxy should be used. The \var{proxy_user} and \var{proxy_pass} are supplied when the proxy is protected by authentication. \end{classdesc} @@ -237,7 +237,7 @@ The return value is a tuple of (response, content), the first being and instance \end{methoddesc} \begin{methoddesc}[Http]{add_credentials}{name, password, \optional{domain=None}} -Adds a name and password that will be used when a request +Adds a name and password that will be used when a request requires authentication. Supplying the optional \var{domain} name will restrict these credentials to only be sent to the specified domain. If \var{domain} is not specified then the given credentials will @@ -246,8 +246,8 @@ be used to try to satisfy every HTTP 401 challenge. \begin{methoddesc}[Http]{add_certificate}{key, cert, domain} Add a \var{key} and \var{cert} that will be used for an SSL connection -to the specified domain. \var{keyfile} is the name of a PEM formatted -file that contains your private key. \var{certfile} is a PEM formatted certificate chain file. +to the specified domain. \var{keyfile} is the name of a PEM formatted +file that contains your private key. \var{certfile} is a PEM formatted certificate chain file. \end{methoddesc} \begin{methoddesc}[Http]{clear_credentials}{} @@ -301,7 +301,7 @@ is mainly to deal with broken servers which supply an etag, but change it capric % also used to give a filename when generating HTML. If you wish to supply your own caching implementation -then you will need to pass in an object that supports the +then you will need to pass in an object that supports the following methods. Note that the \module{memcache} module supports this interface natively. @@ -362,7 +362,7 @@ 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} responses so you can determine the entire chain of redirects. If \member{Http.force_exception_to_status_code} is \code{True} -and the number of redirects has exceeded the number of allowed number +and the number of redirects has exceeded the number of allowed number of redirects then the \class{Response} object will report the error in the status code, but the complete chain of previous responses will still be in tact. @@ -386,21 +386,21 @@ assert resp.status == 200 assert resp['content-type'] == 'text/html' \end{verbatim} -Here is more complex example that does a PUT +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}. +in the directory \code{.cache}. \begin{verbatim} 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", +resp, content = h.request("https://example.org/chap/2", + "PUT", body="This is text", headers={'content-type':'text/plain'} ) \end{verbatim} -Here is an example that connects to a server that +Here is an example that connects to a server that supports the Atom Publishing Protocol. \begin{verbatim} @@ -424,8 +424,8 @@ resp, content = h.request(uri, "POST", body=body, headers=headers) % Note that there is no trailing ">>> " prompt shown. 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 +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. \begin{verbatim} diff --git a/python2/httplib2/iri2uri.py b/python2/httplib2/iri2uri.py index 70667ed..e4cda1d 100644 --- a/python2/httplib2/iri2uri.py +++ b/python2/httplib2/iri2uri.py @@ -16,7 +16,7 @@ import urlparse # Convert an IRI to a URI following the rules in RFC 3987 -# +# # The characters we need to enocde and escape are defined in the spec: # # iprivate = %xE000-F8FF / %xF0000-FFFFD / %x100000-10FFFD @@ -49,7 +49,7 @@ escape_range = [ (0xF0000, 0xFFFFD ), (0x100000, 0x10FFFD) ] - + def encode(c): retval = c i = ord(c) @@ -63,19 +63,19 @@ def encode(c): def iri2uri(uri): - """Convert an IRI to a URI. Note that IRIs must be + """Convert an IRI to a URI. Note that IRIs must be passed in a unicode strings. That is, do not utf-8 encode - the IRI before passing it into the function.""" + the IRI before passing it into the function.""" if isinstance(uri ,unicode): (scheme, authority, path, query, fragment) = urlparse.urlsplit(uri) authority = authority.encode('idna') # For each character in 'ucschar' or 'iprivate' # 1. encode as utf-8 - # 2. then %-encode each octet of that utf-8 + # 2. then %-encode each octet of that utf-8 uri = urlparse.urlunsplit((scheme, authority, path, query, fragment)) uri = "".join([encode(c) for c in uri]) return uri - + if __name__ == "__main__": import unittest @@ -83,7 +83,7 @@ if __name__ == "__main__": def test_uris(self): """Test that URIs are invariant under the transformation.""" - invariant = [ + invariant = [ u"ftp://ftp.is.co.za/rfc/rfc1808.txt", u"http://www.ietf.org/rfc/rfc2396.txt", u"ldap://[2001:db8::7]/c=GB?objectClass?one", @@ -94,7 +94,7 @@ if __name__ == "__main__": u"urn:oasis:names:specification:docbook:dtd:xml:4.1.2" ] for uri in invariant: self.assertEqual(uri, iri2uri(uri)) - + def test_iri(self): """ Test that the right type of escaping is done for each part of the URI.""" self.assertEqual("http://xn--o3h.com/%E2%98%84", iri2uri(u"http://\N{COMET}.com/\N{COMET}")) @@ -107,4 +107,4 @@ if __name__ == "__main__": unittest.main() - + diff --git a/python3/httplib2/iri2uri.py b/python3/httplib2/iri2uri.py index 4df1ca3..14b178d 100755..100644 --- a/python3/httplib2/iri2uri.py +++ b/python3/httplib2/iri2uri.py @@ -16,7 +16,7 @@ import urllib.parse # Convert an IRI to a URI following the rules in RFC 3987
-#
+#
# The characters we need to enocde and escape are defined in the spec:
#
# iprivate = %xE000-F8FF / %xF0000-FFFFD / %x100000-10FFFD
@@ -49,7 +49,7 @@ escape_range = [ (0xF0000, 0xFFFFD ),
(0x100000, 0x10FFFD)
]
-
+
def encode(c):
retval = c
i = ord(c)
@@ -63,19 +63,19 @@ def encode(c): def iri2uri(uri):
- """Convert an IRI to a URI. Note that IRIs must be
+ """Convert an IRI to a URI. Note that IRIs must be
passed in a unicode strings. That is, do not utf-8 encode
- the IRI before passing it into the function."""
+ the IRI before passing it into the function."""
if isinstance(uri ,str):
(scheme, authority, path, query, fragment) = urllib.parse.urlsplit(uri)
authority = authority.encode('idna').decode('utf-8')
# For each character in 'ucschar' or 'iprivate'
# 1. encode as utf-8
- # 2. then %-encode each octet of that utf-8
+ # 2. then %-encode each octet of that utf-8
uri = urllib.parse.urlunsplit((scheme, authority, path, query, fragment))
uri = "".join([encode(c) for c in uri])
return uri
-
+
if __name__ == "__main__":
import unittest
@@ -83,7 +83,7 @@ if __name__ == "__main__": def test_uris(self):
"""Test that URIs are invariant under the transformation."""
- invariant = [
+ invariant = [
"ftp://ftp.is.co.za/rfc/rfc1808.txt",
"http://www.ietf.org/rfc/rfc2396.txt",
"ldap://[2001:db8::7]/c=GB?objectClass?one",
@@ -94,7 +94,7 @@ if __name__ == "__main__": "urn:oasis:names:specification:docbook:dtd:xml:4.1.2" ]
for uri in invariant:
self.assertEqual(uri, iri2uri(uri))
-
+
def test_iri(self):
""" Test that the right type of escaping is done for each part of the URI."""
self.assertEqual("http://xn--o3h.com/%E2%98%84", iri2uri("http://\N{COMET}.com/\N{COMET}"))
@@ -107,4 +107,4 @@ if __name__ == "__main__": unittest.main()
-
+
diff --git a/python3/httplib2test.py b/python3/httplib2test.py index 1a92726..480d28e 100755 --- a/python3/httplib2test.py +++ b/python3/httplib2test.py @@ -140,7 +140,7 @@ class _MyHTTPConnection(object): class HttpTest(unittest.TestCase):
def setUp(self):
- if os.path.exists(cacheDirName):
+ if os.path.exists(cacheDirName):
[os.remove(os.path.join(cacheDirName, file)) for file in os.listdir(cacheDirName)]
self.http = httplib2.Http(cacheDirName)
self.http.clear_credentials()
@@ -164,13 +164,13 @@ class HttpTest(unittest.TestCase): pass
def testConnectionType(self):
- self.http.force_exception_to_status_code = False
+ self.http.force_exception_to_status_code = False
response, content = self.http.request("http://bitworking.org", connection_type=_MyHTTPConnection)
self.assertEqual(response['content-location'], "http://bitworking.org")
self.assertEqual(content, b"the body")
def testGetUnknownServer(self):
- self.http.force_exception_to_status_code = False
+ self.http.force_exception_to_status_code = False
try:
self.http.request("http://fred.bitworking.org/")
self.fail("An httplib2.ServerNotFoundError Exception must be thrown on an unresolvable server.")
@@ -206,9 +206,9 @@ class HttpTest(unittest.TestCase): uri = urllib.parse.urljoin(base, "reflector/reflector.cgi?d=\N{CYRILLIC CAPITAL LETTER DJE}")
(response, content) = self.http.request(uri, "GET")
d = self.reflector(content)
- self.assertTrue('QUERY_STRING' in d)
- self.assertTrue(d['QUERY_STRING'].find('%D0%82') > 0)
-
+ self.assertTrue('QUERY_STRING' in d)
+ self.assertTrue(d['QUERY_STRING'].find('%D0%82') > 0)
+
def testGetIsDefaultMethod(self):
# Test that GET is the default method
uri = urllib.parse.urljoin(base, "methods/method_reflector.cgi")
@@ -386,7 +386,7 @@ class HttpTest(unittest.TestCase): # Test that we can set a lower redirection limit
# and that we raise an exception when we exceed
# that limit.
- self.http.force_exception_to_status_code = False
+ self.http.force_exception_to_status_code = False
uri = urllib.parse.urljoin(base, "302/twostep.asis")
try:
@@ -410,7 +410,7 @@ class HttpTest(unittest.TestCase): def testGet302NoLocation(self):
# Test that we throw an exception when we get
# a 302 with no Location: header.
- self.http.force_exception_to_status_code = False
+ self.http.force_exception_to_status_code = False
uri = urllib.parse.urljoin(base, "302/no-location.asis")
try:
(response, content) = self.http.request(uri, "GET")
@@ -421,14 +421,14 @@ class HttpTest(unittest.TestCase): self.fail("Threw wrong kind of exception ")
# Re-run the test with out the exceptions
- self.http.force_exception_to_status_code = True
+ self.http.force_exception_to_status_code = True
(response, content) = self.http.request(uri, "GET")
self.assertEqual(response.status, 500)
self.assertTrue(response.reason.startswith("Redirected but"))
self.assertEqual("302", response['status'])
self.assertTrue(content.startswith(b"This is content"))
-
+
def testGet301ViaHttps(self):
# Google always redirects to http://google.com
(response, content) = self.http.request("https://code.google.com/apis/", "GET")
@@ -443,7 +443,7 @@ class HttpTest(unittest.TestCase): def testGetViaHttpsSpecViolationOnLocation(self):
# Test that we follow redirects through HTTPS
# even if they violate the spec by including
- # a relative Location: header instead of an
+ # a relative Location: header instead of an
# absolute one.
(response, content) = self.http.request("https://google.com/adsense", "GET")
self.assertEqual(200, response.status)
@@ -452,8 +452,8 @@ class HttpTest(unittest.TestCase): def testGetViaHttpsKeyCert(self):
# At this point I can only test
- # that the key and cert files are passed in
- # correctly to httplib. It would be nice to have
+ # that the key and cert files are passed in
+ # correctly to httplib. It would be nice to have
# a real https endpoint to test against.
http = httplib2.Http(timeout=2)
@@ -517,7 +517,7 @@ class HttpTest(unittest.TestCase): def test303ForDifferentMethods(self):
# Test that all methods can be used
uri = urllib.parse.urljoin(base, "303/redirect-to-reflector.cgi")
- for (method, method_on_303) in [("PUT", "GET"), ("DELETE", "GET"), ("POST", "GET"), ("GET", "GET"), ("HEAD", "GET")]:
+ for (method, method_on_303) in [("PUT", "GET"), ("DELETE", "GET"), ("POST", "GET"), ("GET", "GET"), ("HEAD", "GET")]:
(response, content) = self.http.request(uri, method, body=b" ")
self.assertEqual(response['x-method'], method_on_303)
@@ -548,36 +548,36 @@ class HttpTest(unittest.TestCase): self.assertEqual(response.fromcache, False)
def testGetIgnoreEtag(self):
- # Test that we can forcibly ignore ETags
+ # Test that we can forcibly ignore ETags
uri = urllib.parse.urljoin(base, "reflector/reflector.cgi")
(response, content) = self.http.request(uri, "GET")
self.assertNotEqual(response['etag'], "")
(response, content) = self.http.request(uri, "GET", headers = {'cache-control': 'max-age=0'})
d = self.reflector(content)
- self.assertTrue('HTTP_IF_NONE_MATCH' in d)
+ self.assertTrue('HTTP_IF_NONE_MATCH' in d)
self.http.ignore_etag = True
(response, content) = self.http.request(uri, "GET", headers = {'cache-control': 'max-age=0'})
d = self.reflector(content)
self.assertEqual(response.fromcache, False)
- self.assertFalse('HTTP_IF_NONE_MATCH' in d)
+ self.assertFalse('HTTP_IF_NONE_MATCH' in d)
def testOverrideEtag(self):
- # Test that we can forcibly ignore ETags
+ # Test that we can forcibly ignore ETags
uri = urllib.parse.urljoin(base, "reflector/reflector.cgi")
(response, content) = self.http.request(uri, "GET")
self.assertNotEqual(response['etag'], "")
(response, content) = self.http.request(uri, "GET", headers = {'cache-control': 'max-age=0'})
d = self.reflector(content)
- self.assertTrue('HTTP_IF_NONE_MATCH' in d)
- self.assertNotEqual(d['HTTP_IF_NONE_MATCH'], "fred")
+ self.assertTrue('HTTP_IF_NONE_MATCH' in d)
+ self.assertNotEqual(d['HTTP_IF_NONE_MATCH'], "fred")
(response, content) = self.http.request(uri, "GET", headers = {'cache-control': 'max-age=0', 'if-none-match': 'fred'})
d = self.reflector(content)
- self.assertTrue('HTTP_IF_NONE_MATCH' in d)
- self.assertEqual(d['HTTP_IF_NONE_MATCH'], "fred")
+ self.assertTrue('HTTP_IF_NONE_MATCH' in d)
+ self.assertEqual(d['HTTP_IF_NONE_MATCH'], "fred")
#MAP-commented this out because it consistently fails
# def testGet304EndToEnd(self):
@@ -596,7 +596,7 @@ class HttpTest(unittest.TestCase): # self.assertEqual(response.fromcache, True)
def testGet304LastModified(self):
- # Test that we can still handle a 304
+ # Test that we can still handle a 304
# by only using the last-modified cache validator.
uri = urllib.parse.urljoin(base, "304/last-modified-only/last-modified-only.txt")
(response, content) = self.http.request(uri, "GET")
@@ -715,7 +715,7 @@ class HttpTest(unittest.TestCase): self.assertEqual(response.fromcache, True, msg="Should be from cache")
def testHeadGZip(self):
- # Test that we don't try to decompress a HEAD response
+ # Test that we don't try to decompress a HEAD response
uri = urllib.parse.urljoin(base, "gzip/final-destination.txt")
(response, content) = self.http.request(uri, "HEAD")
self.assertEqual(response.status, 200)
@@ -741,7 +741,7 @@ class HttpTest(unittest.TestCase): def testGetGZipFailure(self):
# Test that we raise a good exception when the gzip fails
- self.http.force_exception_to_status_code = False
+ self.http.force_exception_to_status_code = False
uri = urllib.parse.urljoin(base, "gzip/failed-compression.asis")
try:
(response, content) = self.http.request(uri, "GET")
@@ -752,7 +752,7 @@ class HttpTest(unittest.TestCase): self.fail("Threw wrong kind of exception")
# Re-run the test with out the exceptions
- self.http.force_exception_to_status_code = True
+ self.http.force_exception_to_status_code = True
(response, content) = self.http.request(uri, "GET")
self.assertEqual(response.status, 500)
@@ -761,7 +761,7 @@ class HttpTest(unittest.TestCase): def testIndividualTimeout(self):
uri = urllib.parse.urljoin(base, "timeout/timeout.cgi")
http = httplib2.Http(timeout=1)
- http.force_exception_to_status_code = True
+ http.force_exception_to_status_code = True
(response, content) = http.request(uri)
self.assertEqual(response.status, 408)
@@ -780,7 +780,7 @@ class HttpTest(unittest.TestCase): def testGetDeflateFailure(self):
# Test that we raise a good exception when the deflate fails
- self.http.force_exception_to_status_code = False
+ self.http.force_exception_to_status_code = False
uri = urllib.parse.urljoin(base, "deflate/failed-compression.asis")
try:
@@ -792,7 +792,7 @@ class HttpTest(unittest.TestCase): self.fail("Threw wrong kind of exception")
# Re-run the test with out the exceptions
- self.http.force_exception_to_status_code = True
+ self.http.force_exception_to_status_code = True
(response, content) = self.http.request(uri, "GET")
self.assertEqual(response.status, 500)
@@ -870,7 +870,7 @@ class HttpTest(unittest.TestCase): self.assertEqual(response.fromcache, False)
def testUpdateInvalidatesCache(self):
- # Test that calling PUT or DELETE on a
+ # Test that calling PUT or DELETE on a
# URI that is cache invalidates that cache.
uri = urllib.parse.urljoin(base, "304/test_etag.txt")
@@ -884,7 +884,7 @@ class HttpTest(unittest.TestCase): self.assertEqual(response.fromcache, False)
def testUpdateUsesCachedETag(self):
- # Test that we natively support http://www.w3.org/1999/04/Editing/
+ # Test that we natively support http://www.w3.org/1999/04/Editing/
uri = urllib.parse.urljoin(base, "conditional-updates/test.cgi")
(response, content) = self.http.request(uri, "GET")
@@ -900,7 +900,7 @@ class HttpTest(unittest.TestCase): def testUpdatePatchUsesCachedETag(self):
- # Test that we natively support http://www.w3.org/1999/04/Editing/
+ # Test that we natively support http://www.w3.org/1999/04/Editing/
uri = urllib.parse.urljoin(base, "conditional-updates/test.cgi")
(response, content) = self.http.request(uri, "GET")
@@ -915,7 +915,7 @@ class HttpTest(unittest.TestCase): self.assertEqual(response.status, 412)
def testUpdateUsesCachedETagAndOCMethod(self):
- # Test that we natively support http://www.w3.org/1999/04/Editing/
+ # Test that we natively support http://www.w3.org/1999/04/Editing/
uri = urllib.parse.urljoin(base, "conditional-updates/test.cgi")
(response, content) = self.http.request(uri, "GET")
@@ -930,7 +930,7 @@ class HttpTest(unittest.TestCase): def testUpdateUsesCachedETagOverridden(self):
- # Test that we natively support http://www.w3.org/1999/04/Editing/
+ # Test that we natively support http://www.w3.org/1999/04/Editing/
uri = urllib.parse.urljoin(base, "conditional-updates/test.cgi")
(response, content) = self.http.request(uri, "GET")
@@ -978,7 +978,7 @@ class HttpTest(unittest.TestCase): (response, content) = self.http.request(uri, "GET")
self.assertEqual(response.status, 401)
- domain = urllib.parse.urlparse(base)[1]
+ domain = urllib.parse.urlparse(base)[1]
self.http.add_credentials('joe', 'password', domain)
(response, content) = self.http.request(uri, "GET")
self.assertEqual(response.status, 200)
@@ -1094,7 +1094,7 @@ class HttpTest(unittest.TestCase): uri = urllib.parse.urljoin(base, "reflector/reflector.cgi")
(response, content) = self.http.request(uri, "GET")
d = self.reflector(content)
- self.assertTrue('HTTP_USER_AGENT' in d)
+ self.assertTrue('HTTP_USER_AGENT' in d)
def testConnectionClose(self):
@@ -1186,7 +1186,7 @@ class HttpPrivateTest(unittest.TestCase): def testNormalizeHeaders(self):
- # Test that we normalize headers to lowercase
+ # Test that we normalize headers to lowercase
h = httplib2._normalize_headers({'Cache-Control': 'no-cache', 'Other': 'Stuff'})
self.assertTrue('cache-control' in h)
self.assertTrue('other' in h)
@@ -1327,19 +1327,19 @@ class HttpPrivateTest(unittest.TestCase): def testParseWWWAuthenticateEmpty(self):
res = httplib2._parse_www_authenticate({})
- self.assertEqual(len(list(res.keys())), 0)
+ self.assertEqual(len(list(res.keys())), 0)
def testParseWWWAuthenticate(self):
# different uses of spaces around commas
res = httplib2._parse_www_authenticate({ 'www-authenticate': 'Test realm="test realm" , foo=foo ,bar="bar", baz=baz,qux=qux'})
self.assertEqual(len(list(res.keys())), 1)
self.assertEqual(len(list(res['test'].keys())), 5)
-
+
# tokens with non-alphanum
res = httplib2._parse_www_authenticate({ 'www-authenticate': 'T*!%#st realm=to*!%#en, to*!%#en="quoted string"'})
self.assertEqual(len(list(res.keys())), 1)
self.assertEqual(len(list(res['t*!%#st'].keys())), 2)
-
+
# quoted string with quoted pairs
res = httplib2._parse_www_authenticate({ 'www-authenticate': 'Test realm="a \\"test\\" realm"'})
self.assertEqual(len(list(res.keys())), 1)
@@ -1378,7 +1378,7 @@ class HttpPrivateTest(unittest.TestCase): def testParseWWWAuthenticateDigest(self):
- res = httplib2._parse_www_authenticate({ 'www-authenticate':
+ res = httplib2._parse_www_authenticate({ 'www-authenticate':
'Digest realm="testrealm@host.com", qop="auth,auth-int", nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093", opaque="5ccc069c403ebaf9f0171e9517f40e41"'})
digest = res['digest']
self.assertEqual('testrealm@host.com', digest['realm'])
@@ -1386,7 +1386,7 @@ class HttpPrivateTest(unittest.TestCase): def testParseWWWAuthenticateMultiple(self):
- res = httplib2._parse_www_authenticate({ 'www-authenticate':
+ res = httplib2._parse_www_authenticate({ 'www-authenticate':
'Digest realm="testrealm@host.com", qop="auth,auth-int", nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093", opaque="5ccc069c403ebaf9f0171e9517f40e41" Basic REAlm="me" '})
digest = res['digest']
self.assertEqual('testrealm@host.com', digest['realm'])
@@ -1399,7 +1399,7 @@ class HttpPrivateTest(unittest.TestCase): def testParseWWWAuthenticateMultiple2(self):
# Handle an added comma between challenges, which might get thrown in if the challenges were
# originally sent in separate www-authenticate headers.
- res = httplib2._parse_www_authenticate({ 'www-authenticate':
+ res = httplib2._parse_www_authenticate({ 'www-authenticate':
'Digest realm="testrealm@host.com", qop="auth,auth-int", nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093", opaque="5ccc069c403ebaf9f0171e9517f40e41", Basic REAlm="me" '})
digest = res['digest']
self.assertEqual('testrealm@host.com', digest['realm'])
@@ -1412,7 +1412,7 @@ class HttpPrivateTest(unittest.TestCase): def testParseWWWAuthenticateMultiple3(self):
# Handle an added comma between challenges, which might get thrown in if the challenges were
# originally sent in separate www-authenticate headers.
- res = httplib2._parse_www_authenticate({ 'www-authenticate':
+ res = httplib2._parse_www_authenticate({ 'www-authenticate':
'Digest realm="testrealm@host.com", qop="auth,auth-int", nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093", opaque="5ccc069c403ebaf9f0171e9517f40e41", Basic REAlm="me", WSSE realm="foo", profile="UsernameToken"'})
digest = res['digest']
self.assertEqual('testrealm@host.com', digest['realm'])
@@ -1426,8 +1426,8 @@ class HttpPrivateTest(unittest.TestCase): self.assertEqual('UsernameToken', wsse['profile'])
def testParseWWWAuthenticateMultiple4(self):
- res = httplib2._parse_www_authenticate({ 'www-authenticate':
- 'Digest realm="test-real.m@host.com", qop \t=\t"\tauth,auth-int", nonce="(*)&^&$%#",opaque="5ccc069c403ebaf9f0171e9517f40e41", Basic REAlm="me", WSSE realm="foo", profile="UsernameToken"'})
+ res = httplib2._parse_www_authenticate({ 'www-authenticate':
+ 'Digest realm="test-real.m@host.com", qop \t=\t"\tauth,auth-int", nonce="(*)&^&$%#",opaque="5ccc069c403ebaf9f0171e9517f40e41", Basic REAlm="me", WSSE realm="foo", profile="UsernameToken"'})
digest = res['digest']
self.assertEqual('test-real.m@host.com', digest['realm'])
self.assertEqual('\tauth,auth-int', digest['qop'])
@@ -1448,7 +1448,7 @@ class HttpPrivateTest(unittest.TestCase): def testDigestObject(self):
credentials = ('joe', 'password')
host = None
- request_uri = '/projects/httplib2/test/digest/'
+ request_uri = '/projects/httplib2/test/digest/'
headers = {}
response = {
'www-authenticate': 'Digest realm="myrealm", nonce="Ygk86AsKBAA=3516200d37f9a3230352fde99977bd6d472d4306", algorithm=MD5, qop="auth"'
@@ -1456,7 +1456,7 @@ class HttpPrivateTest(unittest.TestCase): content = b""
d = httplib2.DigestAuthentication(credentials, host, request_uri, headers, response, content, None)
- d.request("GET", request_uri, headers, content, cnonce="33033375ec278a46")
+ d.request("GET", request_uri, headers, content, cnonce="33033375ec278a46")
our_request = "authorization: %s" % headers['authorization']
working_request = 'authorization: Digest username="joe", realm="myrealm", nonce="Ygk86AsKBAA=3516200d37f9a3230352fde99977bd6d472d4306", uri="/projects/httplib2/test/digest/", algorithm=MD5, response="97ed129401f7cdc60e5db58a80f3ea8b", qop=auth, nc=00000001, cnonce="33033375ec278a46"'
self.assertEqual(our_request, working_request)
@@ -1480,7 +1480,7 @@ class HttpPrivateTest(unittest.TestCase): def testDigestObjectStale(self):
credentials = ('joe', 'password')
host = None
- request_uri = '/projects/httplib2/test/digest/'
+ request_uri = '/projects/httplib2/test/digest/'
headers = {}
response = httplib2.Response({ })
response['www-authenticate'] = 'Digest realm="myrealm", nonce="Ygk86AsKBAA=3516200d37f9a3230352fde99977bd6d472d4306", algorithm=MD5, qop="auth", stale=true'
@@ -1493,7 +1493,7 @@ class HttpPrivateTest(unittest.TestCase): def testDigestObjectAuthInfo(self):
credentials = ('joe', 'password')
host = None
- request_uri = '/projects/httplib2/test/digest/'
+ request_uri = '/projects/httplib2/test/digest/'
headers = {}
response = httplib2.Response({ })
response['www-authenticate'] = 'Digest realm="myrealm", nonce="Ygk86AsKBAA=3516200d37f9a3230352fde99977bd6d472d4306", algorithm=MD5, qop="auth", stale=true'
@@ -1530,7 +1530,7 @@ class HttpPrivateTest(unittest.TestCase): end2end = httplib2._get_end2end_headers(response)
self.assertEqual(0, len(end2end))
- # Degenerate case of connection referrring to a header not passed in
+ # Degenerate case of connection referrring to a header not passed in
response = {'connection': 'content-type'}
end2end = httplib2._get_end2end_headers(response)
self.assertEqual(0, len(end2end))
diff --git a/ref/cache-objects.html b/ref/cache-objects.html index dcf9465..9baa7c2 100755..100644 --- a/ref/cache-objects.html +++ b/ref/cache-objects.html @@ -57,7 +57,7 @@ <p> If you wish to supply your own caching implementation -then you will need to pass in an object that supports the +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. diff --git a/ref/http-objects.html b/ref/http-objects.html index 597b7d5..603e52a 100755..100644 --- a/ref/http-objects.html +++ b/ref/http-objects.html @@ -95,7 +95,7 @@ The return value is a tuple of (response, content), the first being and instance <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 +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 @@ -108,8 +108,8 @@ be used to try to satisfy every HTTP 401 challenge. <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. +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> diff --git a/ref/httplib2-example.html b/ref/httplib2-example.html index 756942b..6607efe 100755..100644 --- a/ref/httplib2-example.html +++ b/ref/httplib2-example.html @@ -50,7 +50,7 @@ <h2><a name="SECTION002140000000000000000"></a><a name="httplib2-example"></a> <br> -1.1.4 Examples +1.1.4 Examples </h2> <p> @@ -67,23 +67,23 @@ assert resp['content-type'] == 'text/html' </pre></div> <p> -Here is more complex example that does a PUT +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>. +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", +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 +Here is an example that connects to a server that supports the Atom Publishing Protocol. <p> @@ -108,8 +108,8 @@ resp, content = h.request(uri, "POST", body=body, headers=headers) <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 +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> @@ -142,9 +142,9 @@ r,c = h.request("http://bitworking.org/news/") WIDTH="556" HEIGHT="20" ALIGN="BOTTOM" BORDER="0" SRC="img1.png" ALT="\begin{center}\vbox{\input{modref.ind} -}\end{center}"> +}\end{center}"> <p> - + <p> <div class="navigation"> diff --git a/ref/index.html b/ref/index.html index 3627a94..839d65e 100755..100644 --- a/ref/index.html +++ b/ref/index.html @@ -80,7 +80,7 @@ many kinds of authentication. <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> +<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> diff --git a/ref/module-httplib2.html b/ref/module-httplib2.html index ce4d931..155592b 100755..100644 --- a/ref/module-httplib2.html +++ b/ref/module-httplib2.html @@ -49,14 +49,14 @@ <!--End of Navigation Panel--> <h1><a name="SECTION002100000000000000000"> -1.1 <tt class="module">httplib2</tt> +1.1 <tt class="module">httplib2</tt> A comprehensive HTTP client library. </a> </h1> <p> -<a name="module-httplib2"></a> +<a name="module-httplib2"></a> <p> - + <p> <p> @@ -65,26 +65,26 @@ The <tt class="module">httplib2</tt> module is a comprehensive HTTP client libra <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>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>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>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. @@ -113,8 +113,8 @@ 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 +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> @@ -127,7 +127,7 @@ The Base Exception for all exceptions raised by httplib2. <p> <dl><dt><b><span class="typelabel">exception</span> <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 +A 3xx redirect response code was provided but no Location: header was provided to point to the new location. </dd></dl> @@ -177,7 +177,7 @@ are unfamiliar with. <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 +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 @@ -190,9 +190,9 @@ installed for proxy support to work. <td><nobr><b><span class="typelabel">class</span> <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 +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 +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> @@ -206,7 +206,7 @@ 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 +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> @@ -219,7 +219,7 @@ into the constructor of <tt class="class">Http</tt>. 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 +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> diff --git a/ref/node2.html b/ref/node2.html index e7f5de6..408be41 100755..100644 --- a/ref/node2.html +++ b/ref/node2.html @@ -63,7 +63,7 @@ <a name="CHILD_LINKS"><strong>Subsections</strong></a> <ul class="ChildLinks"> -<li><a href="module-httplib2.html">1.1 <tt class="module">httplib2</tt> +<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> diff --git a/ref/ref.html b/ref/ref.html index 3627a94..839d65e 100755..100644 --- a/ref/ref.html +++ b/ref/ref.html @@ -80,7 +80,7 @@ many kinds of authentication. <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> +<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> diff --git a/ref/response-objects.html b/ref/response-objects.html index e3fbab4..74b79f5 100755..100644 --- a/ref/response-objects.html +++ b/ref/response-objects.html @@ -103,7 +103,7 @@ 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 +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. @@ -8,7 +8,7 @@ pkgdir = {'': 'python%s' % sys.version_info[0]} VERSION = '0.7.7' setup(name='httplib2', - version=VERSION, + version=VERSION, author='Joe Gregorio', author_email='joe@bitworking.org', url='http://code.google.com/p/httplib2/', @@ -20,11 +20,11 @@ setup(name='httplib2', A comprehensive HTTP client library, ``httplib2`` supports many features left out of other HTTP libraries. **HTTP and HTTPS** - HTTPS support is only available if the socket module was compiled with SSL support. - + HTTPS support is only available if the socket module was compiled with SSL support. + **Keep-Alive** - Supports HTTP 1.1 Keep-Alive, keeping the socket open and performing multiple requests over the same connection if possible. + Supports HTTP 1.1 Keep-Alive, keeping the socket open and performing multiple requests over the same connection if possible. **Authentication** @@ -35,7 +35,7 @@ A comprehensive HTTP client library, ``httplib2`` supports many features left ou * WSSE **Caching** - The module can optionally operate with a private cache that understands the Cache-Control: + 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. Both file system and memcached based caches are supported. diff --git a/test/conditional-updates/test.cgi b/test/conditional-updates/test.cgi index 01a07b0..45b2131 100755 --- a/test/conditional-updates/test.cgi +++ b/test/conditional-updates/test.cgi @@ -11,7 +11,7 @@ if "GET" == method: print "Status: 304 Not Modified" else: print "Status: 200 Ok" - print "ETag: 123456789" + print "ETag: 123456789" print "" elif method in ["PUT", "PATCH", "DELETE"]: if "123456789" == os.environ.get('HTTP_IF_MATCH', ''): diff --git a/test/gzip/post.cgi b/test/gzip/post.cgi index 97d06d1..8a03727 100755 --- a/test/gzip/post.cgi +++ b/test/gzip/post.cgi @@ -1,5 +1,5 @@ #!/usr/bin/env python -import zlib +import zlib import os from StringIO import StringIO |