Commit dcaff712 by Xavier Ordoquy

Merge pull request #3728 from karthik-suresh/Fixes-Issue3727

Import parser added to docs in API guide
parents ff4bc43a 82973cfa
...@@ -51,6 +51,9 @@ using the `APIView` class based views. ...@@ -51,6 +51,9 @@ using the `APIView` class based views.
return Response({'received data': request.data}) return Response({'received data': request.data})
Or, if you're using the `@api_view` decorator with function based views. Or, if you're using the `@api_view` decorator with function based views.
from rest_framework.decorators import api_view
from rest_framework.decorators import parser_classes
@api_view(['POST']) @api_view(['POST'])
@parser_classes((JSONParser,)) @parser_classes((JSONParser,))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment