urllib2: HTTP Version not supported

N

Nirnimesh

I'm using urllib2 module to fetch a URL from a server which understands
HTTP/1.1 only (no HTTP/1.0).

urllib2.urlopen() results in "urllib2.HTTPError: HTTP Error 505: HTTP
Version not supported".

How do I force urllib2 to use HTTP v1.1?

Regards,
Nirnimesh
 
T

Tim Roberts

Nirnimesh said:
I'm using urllib2 module to fetch a URL from a server which understands
HTTP/1.1 only (no HTTP/1.0).

urllib2.urlopen() results in "urllib2.HTTPError: HTTP Error 505: HTTP
Version not supported".

How do I force urllib2 to use HTTP v1.1?

Are you passing httplib.HTTPConnection as the connection handler? If you
use httplib.HTTP instead, it should create a 1.0 request.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,832
Latest member
UtaHetrick

Latest Threads

Top