Created
July 26, 2016 22:37
-
-
Save arnobroekhof/2612357c7357e52552e5c8022e71383c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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