Skip to content

Instantly share code, notes, and snippets.

@arnobroekhof
Created July 26, 2016 22:37
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 arnobroekhof/2612357c7357e52552e5c8022e71383c to your computer and use it in GitHub Desktop.
Save arnobroekhof/2612357c7357e52552e5c8022e71383c to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# -*- coding: UTF8 -*-
import json
import urllib2
def make_get_request(url, headers):
req = urllib2.Request(url=url, headers=headers)
return json.loads(urllib2.urlopen(req).read())
if __name__ == '__main__':
base_url = 'http://localhost:4440/api/17'
system_info_url = '%s/system/info' % base_url
header = {'accept': 'application/json',
'Content-Type': 'application/json; charset=UTF8',
'X-Rundeck-Auth-Token': 'T1tsJrGaZYCrEjzDL0L3lBQpme2NoSDt'}
print make_get_request(system_info_url, header)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment