From 554dcec5c47524ec4b7f6797ab53955bbcb37561 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Wed, 8 Aug 2007 02:01:12 +0000 Subject: Checkpoint svn path=/scripts/http-client.py; revision=835 --- scripts/http-client.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 scripts/http-client.py (limited to 'scripts/http-client.py') diff --git a/scripts/http-client.py b/scripts/http-client.py new file mode 100644 index 00000000..815270ad --- /dev/null +++ b/scripts/http-client.py @@ -0,0 +1,19 @@ +# $Id$ + +import httplib + +http = httplib.HTTPSConnection("localhost", 8080) + +http.connect() +http.request("POST", "/", "This is a test. This is only a test. Had this been real you would now be really confused.\n", {"Content-Type":"application/wombat"}) +response = http.getresponse() + +for h in response.getheaders(): + print "%s: %s" % h +print +if response.status == httplib.OK: + print "OK" +else: + print "Ouch" +print +print response.read() -- cgit v1.2.3