Send POST Data as JSON with Python Requests

I began using Flask and the AWS API Gateway at work for a public website we are building. I didn't need to do any parameter mapping on the AWS side, so I went straight to work. It turns out that Python Requests doesn't send POST data as JSON by default and this had my head spinning as I was trying to figure out why the response was throwing an error. This is the usual way of doing a POST request with Python Requests (notice the "data" variable): r = requests.post(url, data={"key": "value"}) But…Read more