summaryrefslogtreecommitdiffstats
path: root/Doc/lib/libhttplib.tex
diff options
context:
space:
mode:
authorFacundo Batista <facundobatista@gmail.com>2007-03-23 18:54:07 (GMT)
committerFacundo Batista <facundobatista@gmail.com>2007-03-23 18:54:07 (GMT)
commit07c78be0b4723deb62acebab50888cc59b1e4eb2 (patch)
tree0d1da08d12eafe4ac485889e1aac891e035c0696 /Doc/lib/libhttplib.tex
parentf102e24bd34442026f4200a298a8b08d1deb3616 (diff)
downloadcpython-07c78be0b4723deb62acebab50888cc59b1e4eb2.zip
cpython-07c78be0b4723deb62acebab50888cc59b1e4eb2.tar.gz
cpython-07c78be0b4723deb62acebab50888cc59b1e4eb2.tar.bz2
Added a 'create_connect()' function to socket.py, which creates a
connection with an optional timeout, and modified httplib.py to use this function in HTTPConnection. Applies patch 1676823.
Diffstat (limited to 'Doc/lib/libhttplib.tex')
-rw-r--r--Doc/lib/libhttplib.tex14
1 files changed, 12 insertions, 2 deletions
diff --git a/Doc/lib/libhttplib.tex b/Doc/lib/libhttplib.tex
index 557ee3d..67371a4 100644
--- a/Doc/lib/libhttplib.tex
+++ b/Doc/lib/libhttplib.tex
@@ -26,18 +26,28 @@ that use HTTP and HTTPS.
The module provides the following classes:
-\begin{classdesc}{HTTPConnection}{host\optional{, port}}
+\begin{classdesc}{HTTPConnection}{host\optional{, port\optional{,
+ strict\optional{, timeout}}}}
An \class{HTTPConnection} instance represents one transaction with an HTTP
server. It should be instantiated passing it a host and optional port number.
If no port number is passed, the port is extracted from the host string if it
has the form \code{\var{host}:\var{port}}, else the default HTTP port (80) is
-used. For example, the following calls all create instances that connect to
+used.
+When True the optional parameter \var{strict}
+causes \code{BadStatusLine} to be raised if the status line can't be parsed
+as a valid HTTP/1.0 or 1.1 status line. If the optional \var{timeout}
+parameter is given, connection attempts will timeout after that many
+seconds (if no timeout is passed, or is passed as None, the global default
+timeout setting is used).
+
+For example, the following calls all create instances that connect to
the server at the same host and port:
\begin{verbatim}
>>> h1 = httplib.HTTPConnection('www.cwi.nl')
>>> h2 = httplib.HTTPConnection('www.cwi.nl:80')
>>> h3 = httplib.HTTPConnection('www.cwi.nl', 80)
+>>> h3 = httplib.HTTPConnection('www.cwi.nl', 80, timeout=10)
\end{verbatim}
\versionadded{2.0}
\end{classdesc}