Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Removed HttpRequest.raw_post_data.

  • Loading branch information...
commit 4a6490a4a0d0d7e45b1f549e3f9d97e5e2aeb731 1 parent d1c72d9
Aymeric Augustin authored December 24, 2012
5  django/http/request.py
@@ -187,11 +187,6 @@ def body(self):
187 187
             self._stream = BytesIO(self._body)
188 188
         return self._body
189 189
 
190  
-    @property
191  
-    def raw_post_data(self):
192  
-        warnings.warn('HttpRequest.raw_post_data has been deprecated. Use HttpRequest.body instead.', DeprecationWarning)
193  
-        return self.body
194  
-
195 190
     def _mark_post_parse_error(self):
196 191
         self._post = QueryDict('')
197 192
         self._files = MultiValueDict()
5  docs/ref/request-response.txt
@@ -34,11 +34,6 @@ All attributes should be considered read-only, unless stated otherwise below.
34 34
 
35 35
 .. attribute:: HttpRequest.body
36 36
 
37  
-    .. versionchanged:: 1.4
38  
-
39  
-    Before Django 1.4, ``HttpRequest.body`` was named
40  
-    ``HttpRequest.raw_post_data``.
41  
-
42 37
     The raw HTTP request body as a byte string. This is useful for processing
43 38
     data in different ways than conventional HTML forms: binary images,
44 39
     XML payload etc. For processing conventional form data, use ``HttpRequest.POST``.
21  tests/regressiontests/requests/tests.py
@@ -507,20 +507,6 @@ def test_POST_after_body_read_and_stream_read_multipart(self):
507 507
         self.assertEqual(request.read(13), b'--boundary\r\nC')
508 508
         self.assertEqual(request.POST, {'name': ['value']})
509 509
 
510  
-    def test_raw_post_data_returns_body(self):
511  
-        """
512  
-        HttpRequest.raw_post_body should be the same as HttpRequest.body
513  
-        """
514  
-        payload = FakePayload('Hello There!')
515  
-        request = WSGIRequest({
516  
-            'REQUEST_METHOD': 'POST',
517  
-            'CONTENT_LENGTH': len(payload),
518  
-            'wsgi.input': payload,
519  
-        })
520  
-
521  
-        with warnings.catch_warnings(record=True):
522  
-            self.assertEqual(request.body, request.raw_post_data)
523  
-
524 510
     def test_POST_connection_error(self):
525 511
         """
526 512
         If wsgi.input.read() raises an exception while trying to read() the
@@ -536,8 +522,5 @@ def read(self, len=0):
536 522
                                'CONTENT_LENGTH': len(payload),
537 523
                                'wsgi.input': ExplodingBytesIO(payload)})
538 524
 
539  
-        with warnings.catch_warnings(record=True) as w:
540  
-            warnings.simplefilter("always")
541  
-            with self.assertRaises(UnreadablePostError):
542  
-                request.raw_post_data
543  
-            self.assertEqual(len(w), 1)
  525
+        with self.assertRaises(UnreadablePostError):
  526
+            request.body

0 notes on commit 4a6490a

Please sign in to comment.
Something went wrong with that request. Please try again.