import httplib
conn = httplib.HTTPConnection("<A href="http://www.python.org",80">http://www.python.org",80)
conn.request("GET", "/index.php")
r1 = conn.getresponse()
print r1.status, r1.reason
conn.close()
where I test it,it show errors as below:
Traceback (most recent call last):
File "E:\Program\demo\src\testhttp.py", line 6, in <module>
conn.request("GET", "/index.php")
File "C:\Python25\Lib\httplib.py", line 862, in request
self._send_request(method, url, body, headers)
File "C:\Python25\Lib\httplib.py", line 885, in _send_request
self.endheaders()
File "C:\Python25\Lib\httplib.py", line 856, in endheaders
self._send_output()
File "C:\Python25\Lib\httplib.py", line 728, in _send_output
self.send(msg)
File "C:\Python25\Lib\httplib.py", line 695, in send
self.connect()
File "C:\Python25\Lib\httplib.py", line 663, in connect
socket.SOCK_STREAM):
socket.gaierror: (11001, 'getaddrinfo failed')
can any body help me ?