I'm attempting to send a post request with some json data using:
curl --verbose -X POST -d @testfile.json http://oururl.com/someapi --header "Content-Type:application/json"
the view on the other end reads request.POST.dict() -- but request.POST is showing up empty (though content length is getting set)! I've used this method before and never had this happen, can't figure out what is going wrong.
You're posting JSON. request.POST is for form-encoded data.
You should be accessing request.body and passing it through json.loads().
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With