According to the get_json docs:
[..] function will return
Noneif the mimetype is notapplication/jsonbut this can be overridden by theforceparameter.
So, either specify the mimetype of the incoming request to be application/json:
curl localhost:5000/post -d '{"foo": "bar"}' -H 'Content-Type: application/json' or force JSON decoding with force=True:
data = request.get_json(force=True) If running this on Windows (in cmd), you'll also need to change the quoting of your JSON data, from single quotes to double quotes:
curl localhost:5000/post -d "{\"foo\": \"bar\"}" -H 'Content-Type: application/json'