How to do post request using unix command in python and get response

Viewed 27

So i have a unix command for post request and i need to get response from this post method using python.

curl -k -u admin:admin -X POST --header "Content-Type:multipart/mixed"--header "Accept:application/json"-F "myPartnm1=@sftprest;type=application/json"-F" myPartname2=@sftppvteopenkey;type=application/json/oc-stream" http://cdrteo456.serms.com:4456/api/v/cert
 
response=requests.post(url,json,hedares,auth=(user,pass))

response.stutus_code ==200

How to check the response for the command post in python? Note that i wasn't able to test this using python.

0 Answers
Related