[Answer]-How to make a JSON response after create a resource successfully?

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

Leave a comment