summaryrefslogtreecommitdiff
path: root/httptest.py
diff options
context:
space:
mode:
authorComment <tim@gray.(none)>2013-02-26 09:00:03 +0000
committerComment <tim@gray.(none)>2013-02-26 09:00:03 +0000
commitc0758ba28eb13c198551e3a18d37d8582e76e02d (patch)
tree72e5361bc8cb23181a6a383ffcf2dec28e38135d /httptest.py
parent963963271f0bec94a4d3d8b6b0fe60621d83318d (diff)
python testing tool
Diffstat (limited to 'httptest.py')
-rwxr-xr-xhttptest.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/httptest.py b/httptest.py
new file mode 100755
index 0000000..3528741
--- /dev/null
+++ b/httptest.py
@@ -0,0 +1,11 @@
+#!/usr/bin/python
+import httplib
+import argparse
+parser = argparse.ArgumentParser()
+parser.add_argument("method")
+parser.add_argument("path")
+parser.add_argument("body")
+args=parser.parse_args()
+connection = httplib.HTTPConnection('127.0.0.1:9000')
+connection.request(args.method, args.path, args.body)
+print connection.getresponse().read()