**** httplib.InvalidURL: nonnumeric port ****

Kev Dwyer kevin.p.dwyer at gmail.com
Mon Dec 20 14:54:06 EST 2010


On Tue, 21 Dec 2010 01:00:36 +0530, Anurag Chourasia wrote:

Anurag,

HTTPConnection takes a host and a port number as arguments, not just a URL.

So you could construct your connection request like this:
conn = httplib.HTTPConnection('joule', 8041)

then use the request() method on the connection to make a PUT or GET request:
conn.request('PUT', url, body, headers)

Please read the documentation for the httplib module, and perhaps some basic 
material on how HTTP requests work.

Cheers,

Kev




More information about the Python-list mailing list