Skip to content

Instantly share code, notes, and snippets.

@joet3ch
Created September 17, 2010 03:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joet3ch/583620 to your computer and use it in GitHub Desktop.
Save joet3ch/583620 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import sys
import os
import urllib
API_KEY = '123456789'
REST_HOST = 'https://xxxx.com';
def main():
url = REST_HOST + '/aMethod/'
method = 'doSomething'
params = urllib.urlencode({
'method': method,
'arg0': API_KEY,
'arg1': '192.168.1.155',
'arg2': 'tester01.example.com',
'arg3': 'abc'
})
api_call = urllib.urlopen(url, params).read()
print api_call ## display the raw response
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment