Would you shed some light on this Python/JSON question?
I am not able to make the print line to work beyond ["TABLE_intf"]. I'm trying to get the code to print the interface's information only (IP address, state (up or down), etc) from the attached JSON file. I'd appreciate any assistance, thanks. import requests import json url='http://xxx.cisco.com/ins' switchuser='xxx' switchpassword='xxx' myheaders={'content-type':'application/json'} payload={ "ins_api": { "version": "1.0", "type": "cli_show", "chunk": "0", "sid": "1", "input": "show ip interface brief", "output_format": "json" } } response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json() print(response["ins_api"]["outputs"]["output"]["body"]["TABLE_intf"])#["ROW_intf"]["prefix"]) I'll paste the JSON code in another post.. https://www.sololearn.com/discuss/2215491/?ref=app