summaryrefslogtreecommitdiff
path: root/Doc/library/urllib.request.rst
diff options
context:
space:
mode:
authorSenthil Kumaran <orsenthil@gmail.com>2010-12-19 10:49:52 +0000
committerSenthil Kumaran <orsenthil@gmail.com>2010-12-19 10:49:52 +0000
commit7bc0d872ddb023333acc05b7d038cdb74cfc047b (patch)
tree6225e5ecb0546a7826743510555c604751b238c7 /Doc/library/urllib.request.rst
parent8a60e94802b04a838607b4aebba6fc8b70f7b87c (diff)
downloadcpython-git-7bc0d872ddb023333acc05b7d038cdb74cfc047b.tar.gz
Issue3243 - Support iterable bodies in httplib. Patch contributions by Xuanji Li and Chris AtLee.
Diffstat (limited to 'Doc/library/urllib.request.rst')
-rw-r--r--Doc/library/urllib.request.rst16
1 files changed, 10 insertions, 6 deletions
diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst
index 730d258013..6aa9e15658 100644
--- a/Doc/library/urllib.request.rst
+++ b/Doc/library/urllib.request.rst
@@ -21,13 +21,14 @@ The :mod:`urllib.request` module defines the following functions:
:class:`Request` object.
*data* may be a string specifying additional data to send to the
- server, or ``None`` if no such data is needed. Currently HTTP
- requests are the only ones that use *data*; the HTTP request will
- be a POST instead of a GET when the *data* parameter is provided.
- *data* should be a buffer in the standard
+ server, or ``None`` if no such data is needed. *data* may also be an
+ iterable object and in that case Content-Length value must be specified in
+ the headers. Currently HTTP requests are the only ones that use *data*; the
+ HTTP request will be a POST instead of a GET when the *data* parameter is
+ provided. *data* should be a buffer in the standard
:mimetype:`application/x-www-form-urlencoded` format. The
- :func:`urllib.parse.urlencode` function takes a mapping or sequence
- of 2-tuples and returns a string in this format. urllib.request module uses
+ :func:`urllib.parse.urlencode` function takes a mapping or sequence of
+ 2-tuples and returns a string in this format. urllib.request module uses
HTTP/1.1 and includes ``Connection:close`` header in its HTTP requests.
The optional *timeout* parameter specifies a timeout in seconds for
@@ -76,6 +77,9 @@ The :mod:`urllib.request` module defines the following functions:
HTTPS virtual hosts are now supported if possible (that is, if
:data:`ssl.HAS_SNI` is true).
+ .. versionadded:: 3.2
+ *data* can be an iterable object.
+
.. function:: install_opener(opener)
Install an :class:`OpenerDirector` instance as the default global opener.