]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
fixed the test program
authorGuido van Rossum <guido@python.org>
Thu, 7 Sep 1995 19:28:19 +0000 (19:28 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 7 Sep 1995 19:28:19 +0000 (19:28 +0000)
Lib/httplib.py

index 68c9d8b3acfa127d9b13d3dfb91fdf62fb05b070..59799cc1628e0ac5cfa17bbf6d2397856391871d 100644 (file)
@@ -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()