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
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
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