urllib2 and POST

Richard A. Jones richie_aj at hotmail.com
Tue Mar 23 14:29:55 EST 2004


How do you send a POST to a url? I know how to do this with httplib but how
do you do this using urllib2. For example:

import urllib2

url = http://123.8.37.87:4080/somewhere/something
f = urllib2.urlopen(url)


When I attempt this I get HTTP Error 400: HTTP method GET is not supported
by this URL. Am I missing something?





More information about the Python-list mailing list