python - Get JSON file from GET request from Infoblox -
currently i've got piece of code, looks response_code 200
(so know works) url not return data. i've read sending data_file_format
request server knows has return json
or xml
, ...
anybody got advice?
#!/usr/bin/python import requests import json rest_url = 'url_to_infoblox_api/network?network=192.168.1.0/24' r = requests.get(url=rest_url, auth=('infoblox_username', 'infoblox_password'), verify=false) r_json = r.json() print r.status_code //return code 200, works! print json.dumps({ "data" : r_json //but no data ... })
as skyline75489 suggests - try printing r_json.text see raw json. use key want find values interested in. example if have extensible attribute called windowpane following return value of attribute.
r_json['extattrs']['windowpane']['value']
Comments
Post a Comment