Incorrect 'Host' header when using urllib2 to access a server by its IPv6 link-local address

2010-02-09 Thread slmnhq
I have a snippet of Python code that makes an HTTP GET request to an Apache web server (v 2.2.3) using urllib2. The server responds with an HTTP 400 error presumably because of a malformed 'Host' header. The snippet is quite simple: it creates a url based on IPv6 string literal sy

Re: Host: header

2008-04-13 Thread Gabriel Genellina
t;, "/") > r1 = conn.getresponse() > if r1.status == 200: > result = 0 > except Exception: > result = -1 > > > but the server on 192.168.1.1 accept virtual host request only. > That's to say, I need to specify a "Host:" header

Host: header

2008-04-13 Thread Penny Y.
ion: result = -1 but the server on 192.168.1.1 accept virtual host request only. That's to say, I need to specify a "Host:" header in the request. How to do it? thanks. -- http://mail.python.org/mailman/listinfo/python-list