From 623304a19dbbb7bfe67b865edbaf47205bdba429 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Mon, 18 Aug 2014 11:10:41 +0100 Subject: Latest docs deploy --- tutorial/2-requests-and-responses.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tutorial/2-requests-and-responses.html') diff --git a/tutorial/2-requests-and-responses.html b/tutorial/2-requests-and-responses.html index f1d0cb90..7dd66190 100644 --- a/tutorial/2-requests-and-responses.html +++ b/tutorial/2-requests-and-responses.html @@ -226,7 +226,7 @@ request.DATA # Handles arbitrary data. Works for 'POST', 'PUT' and 'PATCH' met

These wrappers provide a few bits of functionality such as making sure you receive Request instances in your view, and adding context to Response objects so that content negotiation can be performed.

The wrappers also provide behaviour such as returning 405 Method Not Allowed responses when appropriate, and handling any ParseError exception that occurs when accessing request.DATA with malformed input.

Pulling it all together

-

Okay, let's go ahead and start using these new components to write a few views.

+

Okay, let's go ahead and start using these new components to write a few views.

We don't need our JSONResponse class in views.py anymore, so go ahead and delete that. Once that's done we can start refactoring our views slightly.

from rest_framework import status
 from rest_framework.decorators import api_view
@@ -258,7 +258,7 @@ def snippet_list(request):
 def snippet_detail(request, pk):
     """
     Retrieve, update or delete a snippet instance.
-    """              
+    """
     try:
         snippet = Snippet.objects.get(pk=pk)
     except Snippet.DoesNotExist:
-- 
cgit v1.2.3