I am unable to successfully convert and execute a curl post command to python code.
curl command
curl -X POST -H "Content-Type:application/json; charset=UTF-8" -d '{"name":joe, "type":22, "summary":"Test"}' http://url
Converted code
import requests
import json
url="http://url"
data = {"name":joe, "type":22, "summary":"Test"}
headers = {'Content-type': "application/json; charset=utf8"}
response = requests.post (url, data=json.dumps(data), headers=headers)
print response.text
print response.headers
I get no response in return, when I execute it manually from the shell it works fine, but when I execute the code, nothing happens, I don't see errors or anything.