summaryrefslogtreecommitdiffstats
path: root/Lib/httplib.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-09-07 19:28:19 (GMT)
committerGuido van Rossum <guido@python.org>1995-09-07 19:28:19 (GMT)
commita0dfc7ad65429e026e28d175626c32bd9fa1d078 (patch)
tree1a04e7cf80d5ca03d5037828ca022332055eab82 /Lib/httplib.py
parentaad869232899c8f3875e7780149ce0983a73e0f8 (diff)
downloadcpython-a0dfc7ad65429e026e28d175626c32bd9fa1d078.zip
cpython-a0dfc7ad65429e026e28d175626c32bd9fa1d078.tar.gz
cpython-a0dfc7ad65429e026e28d175626c32bd9fa1d078.tar.bz2
fixed the test program
Diffstat (limited to 'Lib/httplib.py')
-rw-r--r--Lib/httplib.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/httplib.py b/Lib/httplib.py
index 68c9d8b..59799cc 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()