summaryrefslogtreecommitdiffstats
path: root/proxy/code/scripts/test-userapi.py
diff options
context:
space:
mode:
authorjesus m. rodriguez <jesusr@redhat.com>2009-07-09 12:53:58 -0400
committerjesus m. rodriguez <jesusr@redhat.com>2009-07-09 12:53:58 -0400
commitbc0d9c27770274f594f39d4e92a0369a6bf77afd (patch)
tree81c05ac3caa3fd6674cfe1c601bd98ee2636fbb1 /proxy/code/scripts/test-userapi.py
parent4a292bdf7af99c1fe6582eeb0a627ff69665b5de (diff)
downloadcandlepin-bc0d9c27770274f594f39d4e92a0369a6bf77afd.tar.gz
candlepin-bc0d9c27770274f594f39d4e92a0369a6bf77afd.tar.xz
candlepin-bc0d9c27770274f594f39d4e92a0369a6bf77afd.zip
first cut at UserApi
Diffstat (limited to 'proxy/code/scripts/test-userapi.py')
-rwxr-xr-xproxy/code/scripts/test-userapi.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/proxy/code/scripts/test-userapi.py b/proxy/code/scripts/test-userapi.py
new file mode 100755
index 0000000..59598dd
--- /dev/null
+++ b/proxy/code/scripts/test-userapi.py
@@ -0,0 +1,23 @@
+#!/usr/bin/python
+
+import httplib, urllib
+import sys
+
+if len(sys.argv) < 1:
+ print("please supply a message")
+ sys.exit(1)
+
+params = urllib.urlencode({'login':'candlepin', 'password':'cp_p@s$w0rd'})
+headers = {"Content-type":"application/json",
+ "Accept": "application/json"}
+conn = httplib.HTTPConnection("localhost", 8080)
+conn.request("POST", '/candlepin/user', params, headers)
+response = conn.getresponse()
+print response.status, response.reason
+rsp = response.read()
+conn.close()
+print rsp
+
+#response = urllib.urlopen('http://localhost:8080/candlepin/helloworld')
+#rsp = response.read()
+#print(rsp)