1👍
✅
Try adding
always_return_data = True
to your Meta.
And when you execute your POST
, make sure that the url you are posting to has ?format=json
at the end. E.g.
http://127.0.0.1:8000/api/v1/user/?format=json
Full example of a POST
via curl:-
curl -v -H "Content-Type: application/json" -X POST --data '{"username":"calvin", "email":"myemail@myemail.com", "id": "1"}' http://127.0.0.1:8000/api/v1/user/?format=json
Source:stackexchange.com