I'm trying to reproduce the code from this page, the complete github code is here:
The application works just fine on the browser, but I'm not able of reproduce the POST request from python.
I have tried with the same data showed on the payload when I use the browser
PEOPLE = {"fname": "DDoug",
"lname": "FarDrell"}
url = "http://localhost:5000/api/people"
data = requests.post(url,data=json.dumps(PEOPLE) )
but I get the following errror:
data.text
'{\n "detail": "Invalid Content-type (), expected JSON data",\n "status": 415,\n "title": "Unsupported Media Type",\n "type": "about:blank"\n}\n'
I tried like this as well:
url = "http://localhost:5000/api/people"
data = requests.post(url,data=json.dumps(PEOPLE) )
BUT got this error:
'{\n "detail": "Invalid Content-type (application/x-www-form-urlencoded), expected JSON data",\n "status": 415,\n "title": "Unsupported Media Type",\n "type": "about:blank"\n}\n'