[ python-Bugs-1528258 ] urllib2 data argument

SourceForge.net noreply at sourceforge.net
Tue Jul 25 11:13:04 CEST 2006


Bugs item #1528258, was opened at 2006-07-25 09:13
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1528258&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: paul rubin (phr)
Assigned to: Nobody/Anonymous (nobody)
Summary: urllib2 data argument

Initial Comment:
urllib2.Request takes constructor args (url, data,
headers, ...) where data and headers are optional. 
data is described as a string which, if supplied,
causes urlopen to process the request as a POST rather
than a GET.  And there's no way to set headers without
passing a value for data.  So if you want to send a GET
with special headers, the docs leave you scratching
your head.

The solution is to pass None instead of a string for
data.  The doc should say that.

In general the urllib2 docs are somewhat dependent on
the urllib docs.  Some refactoring would be good.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1528258&group_id=5470


More information about the Python-bugs-list mailing list