[Python-checkins] r50939 - python/trunk/Doc/lib/liburllib2.tex

andrew.kuchling python-checkins at python.org
Sat Jul 29 17:57:08 CEST 2006


Author: andrew.kuchling
Date: Sat Jul 29 17:57:08 2006
New Revision: 50939

Modified:
   python/trunk/Doc/lib/liburllib2.tex
Log:
[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.


Modified: python/trunk/Doc/lib/liburllib2.tex
==============================================================================
--- python/trunk/Doc/lib/liburllib2.tex	(original)
+++ python/trunk/Doc/lib/liburllib2.tex	Sat Jul 29 17:57:08 2006
@@ -19,7 +19,8 @@
 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 @@
     \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.
 


More information about the Python-checkins mailing list