Created
May 7, 2019 11:47
-
-
Save akshar-raaj/4e931e84ffd3ad8ca30f8ea032d3e1eb to your computer and use it in GitHub Desktop.
POST handler
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if serializer.is_valid(): | |
| question = serializer.save() | |
| serializer = QuestionSerializer(question) | |
| return Response(serializer.data, status=status.HTTP_201_CREATED) # We removed the hardcoded "Question created with id %s". |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment