diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2006-07-29 15:57:08 (GMT) |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2006-07-29 15:57:08 (GMT) |
commit | e49741d41226c579de11ac0dbecdc2590fe0f993 (patch) | |
tree | 4a987cca00dfdec8432b2d51efdbab7a7e8ecc4b /Doc | |
parent | aab30d0f08c49f0dbd0ae9239e714e644977b255 (diff) | |
download | cpython-e49741d41226c579de11ac0dbecdc2590fe0f993.zip cpython-e49741d41226c579de11ac0dbecdc2590fe0f993.tar.gz cpython-e49741d41226c579de11ac0dbecdc2590fe0f993.tar.bz2 |
[Bug #1528258] Mention that the 'data' argument can be None.
The constructor docs referred the reader to the add_data() method's docs,
but they weren't very helpful. I've simply copied an earlier explanation
of 'data' that's more useful.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/lib/liburllib2.tex | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/Doc/lib/liburllib2.tex b/Doc/lib/liburllib2.tex index f4351c3..542a7b8 100644 --- a/Doc/lib/liburllib2.tex +++ b/Doc/lib/liburllib2.tex @@ -19,7 +19,8 @@ Open the URL \var{url}, which can be either a string or a \class{Request} object. \var{data} may be a string specifying additional data to send to the -server. Currently HTTP requests are the only ones that use \var{data}; +server, or \code{None} if no such data is needed. +Currently HTTP requests are the only ones that use \var{data}; the HTTP request will be a POST instead of a GET when the \var{data} parameter is provided. \var{data} should be a buffer in the standard \mimetype{application/x-www-form-urlencoded} format. The @@ -97,8 +98,17 @@ The following classes are provided: \optional{, origin_req_host}\optional{, unverifiable}} This class is an abstraction of a URL request. -\var{url} should be a string which is a valid URL. For a description -of \var{data} see the \method{add_data()} description. +\var{url} should be a string containing a valid URL. + +\var{data} may be a string specifying additional data to send to the +server, or \code{None} if no such data is needed. +Currently HTTP requests are the only ones that use \var{data}; +the HTTP request will be a POST instead of a GET when the \var{data} +parameter is provided. \var{data} should be a buffer in the standard +\mimetype{application/x-www-form-urlencoded} format. The +\function{urllib.urlencode()} function takes a mapping or sequence of +2-tuples and returns a string in this format. + \var{headers} should be a dictionary, and will be treated as if \method{add_header()} was called with each key and value as arguments. |