03-26-2018 08:04 PM - edited 03-01-2019 05:29 AM
Hello,
I am trying do something simple - just to create an object (tenant, ANP, EPG, etc.) using python requests. I am wondering what I do wrong:(
My GET requests are working fine.
Considering that I have already successful login/cookies, my code is as below:
======================================================================
pyTnData = {"fvTenant": {"attributes": {"name": "WXYZ"}}}
jsonTnData = json.dumps(pyTnData)
print(type(jsonTnData)) # comes as a string type
createTn = requests.post('http://10.11.12.13/api/class/fvTenant.json', cookies=cookies, json=jsonTnData, verify=False)
======================================================================
Thanks.
Solved! Go to Solution.
03-26-2018 08:46 PM
03-26-2018 08:46 PM
03-26-2018 10:34 PM
Thanks for your answer. Yes, it works now.
I corrected the url path to pint to the parent object (uni) and also corrected the protocol to https. It was http before and didn't work with it.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide