summaryrefslogtreecommitdiffstats
path: root/proxy/code/scripts/test-testapi.py
diff options
context:
space:
mode:
authorjesus m. rodriguez <jesusr@redhat.com>2009-07-31 13:33:26 -0400
committerjesus m. rodriguez <jesusr@redhat.com>2009-08-27 15:42:08 -0400
commitc814a67b6c67a43e920975fdd6e66b42fe3fbab5 (patch)
tree21ee3606aa255a64fe63dd4e595ec77963988e2c /proxy/code/scripts/test-testapi.py
parenta0ab6f9fdfc2be3184ef8eaa10e2b07782d7def6 (diff)
downloadcandlepin-c814a67b6c67a43e920975fdd6e66b42fe3fbab5.tar.gz
candlepin-c814a67b6c67a43e920975fdd6e66b42fe3fbab5.tar.xz
candlepin-c814a67b6c67a43e920975fdd6e66b42fe3fbab5.zip
use correct urls
Diffstat (limited to 'proxy/code/scripts/test-testapi.py')
-rwxr-xr-xproxy/code/scripts/test-testapi.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/proxy/code/scripts/test-testapi.py b/proxy/code/scripts/test-testapi.py
index e60bd27..ac726a8 100755
--- a/proxy/code/scripts/test-testapi.py
+++ b/proxy/code/scripts/test-testapi.py
@@ -2,18 +2,19 @@
import httplib, urllib
import sys
+import simplejson as json
if len(sys.argv) < 1:
print("please supply a message")
sys.exit(1)
print("------------ TESTING json create")
-params = '{"name":"now","uuid":"thiswork"}'
+params = {"name":"now","uuid":"thiswork"}
headers = {"Content-type":"application/json",
"Accept": "application/json"}
conn = httplib.HTTPConnection("localhost", 8080)
print("creating object with %s" % params)
-conn.request("POST", '/candlepin/test/', params, headers)
+conn.request("POST", '/candlepin/test/', json.dumps(params), headers)
response = conn.getresponse()
print("Status: %d Response: %s" % (response.status, response.reason))
rsp = response.read()