From: Guido van Rossum Date: Thu, 7 Sep 1995 19:28:19 +0000 (+0000) Subject: fixed the test program X-Git-Tag: v1.3~145 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a0dfc7ad65429e026e28d175626c32bd9fa1d078;p=thirdparty%2FPython%2Fcpython.git fixed the test program --- diff --git a/Lib/httplib.py b/Lib/httplib.py index 68c9d8b3acfa..59799cc1628e 100644 --- a/Lib/httplib.py +++ b/Lib/httplib.py @@ -110,21 +110,24 @@ def test(): dl = 0 for o, a in opts: if o == '-d': dl = dl + 1 - host = 'www.cwi.nl:80' - selector = '/index.html' + host = 'www.python.org' + selector = '/' if args[0:]: host = args[0] if args[1:]: selector = args[1] h = HTTP() h.set_debuglevel(dl) h.connect(host) h.putrequest('GET', selector) + h.endheaders() errcode, errmsg, headers = h.getreply() print 'errcode =', errcode - print 'headers =', headers print 'errmsg =', errmsg + print if headers: for header in headers.headers: print string.strip(header) + print print h.getfile().read() + if __name__ == '__main__': test()