diff options
| author | jesus m. rodriguez <jesusr@redhat.com> | 2009-06-26 14:33:21 -0400 |
|---|---|---|
| committer | jesus m. rodriguez <jesusr@redhat.com> | 2009-06-26 14:33:21 -0400 |
| commit | 2ab21a6332fa4c39fa543c970d90279d6b316be8 (patch) | |
| tree | 683bb48e5e11f2f9d0dc9757bf11eaf2e6ecbd57 /proxy/code/scripts | |
| parent | 6d46157fdf4cedeef9d0f0a8bca6634f97511357 (diff) | |
| download | candlepin-2ab21a6332fa4c39fa543c970d90279d6b316be8.tar.gz candlepin-2ab21a6332fa4c39fa543c970d90279d6b316be8.tar.xz candlepin-2ab21a6332fa4c39fa543c970d90279d6b316be8.zip | |
GET & POST methods work.
Use test-connection.py MSG to test the api interaction.
Diffstat (limited to 'proxy/code/scripts')
| -rwxr-xr-x | proxy/code/scripts/test-connection.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/proxy/code/scripts/test-connection.py b/proxy/code/scripts/test-connection.py new file mode 100755 index 0000000..78d1798 --- /dev/null +++ b/proxy/code/scripts/test-connection.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({'message':sys.argv[1]}) +headers = {"Content-type":"application/x-www-form-urlencoded", + "Accept": "text/plain"} +conn = httplib.HTTPConnection("localhost", 8080) +conn.request("POST", '/candlepin/helloworld', 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) |
