urllib2: HTTP Version not supported

Tim Roberts timr at probo.com
Fri Nov 3 07:53:26 CET 2006


"Nirnimesh" <nirnimesh at gmail.com> wrote:
>
>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.
-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the Python-list mailing list