This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: urllib2 data argument
Type: Stage:
Components: Documentation Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: akuchling Nosy List: akuchling, phr
Priority: normal Keywords:

Created on 2006-07-25 09:13 by phr, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg29274 - (view) Author: paul rubin (phr) Date: 2006-07-25 09:13
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.
msg29275 - (view) Author: paul rubin (phr) Date: 2006-07-25 09:13
Logged In: YES 
user_id=72053

Forgot to mention, this is Python 2.4.1.
msg29276 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2006-07-29 16:13
Logged In: YES 
user_id=11375

I've added None as a value for 'data in rev. 50939.  Thanks
for pointing this out!
History
Date User Action Args
2022-04-11 14:56:19adminsetgithub: 43717
2006-07-25 09:13:04phrcreate