aboutsummaryrefslogtreecommitdiff
path: root/scripts/http-client.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/http-client.py')
-rw-r--r--scripts/http-client.py19
1 files changed, 19 insertions, 0 deletions
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()