diff --git a/django/http/request.py b/django/http/request.py index 8f74bddb711..a8eb14d1540 100644 --- a/django/http/request.py +++ b/django/http/request.py @@ -187,11 +187,6 @@ class HttpRequest(object): self._stream = BytesIO(self._body) return self._body - @property - def raw_post_data(self): - warnings.warn('HttpRequest.raw_post_data has been deprecated. Use HttpRequest.body instead.', DeprecationWarning) - return self.body - def _mark_post_parse_error(self): self._post = QueryDict('') self._files = MultiValueDict() diff --git a/docs/ref/request-response.txt b/docs/ref/request-response.txt index 2775c974d04..9e8eec4433c 100644 --- a/docs/ref/request-response.txt +++ b/docs/ref/request-response.txt @@ -34,11 +34,6 @@ All attributes should be considered read-only, unless stated otherwise below. .. attribute:: HttpRequest.body - .. versionchanged:: 1.4 - - Before Django 1.4, ``HttpRequest.body`` was named - ``HttpRequest.raw_post_data``. - The raw HTTP request body as a byte string. This is useful for processing data in different ways than conventional HTML forms: binary images, XML payload etc. For processing conventional form data, use ``HttpRequest.POST``. diff --git a/tests/regressiontests/requests/tests.py b/tests/regressiontests/requests/tests.py index bb7f925e873..799cd9b3020 100644 --- a/tests/regressiontests/requests/tests.py +++ b/tests/regressiontests/requests/tests.py @@ -507,20 +507,6 @@ class RequestsTests(unittest.TestCase): self.assertEqual(request.read(13), b'--boundary\r\nC') self.assertEqual(request.POST, {'name': ['value']}) - def test_raw_post_data_returns_body(self): - """ - HttpRequest.raw_post_body should be the same as HttpRequest.body - """ - payload = FakePayload('Hello There!') - request = WSGIRequest({ - 'REQUEST_METHOD': 'POST', - 'CONTENT_LENGTH': len(payload), - 'wsgi.input': payload, - }) - - with warnings.catch_warnings(record=True): - self.assertEqual(request.body, request.raw_post_data) - def test_POST_connection_error(self): """ If wsgi.input.read() raises an exception while trying to read() the @@ -536,8 +522,5 @@ class RequestsTests(unittest.TestCase): 'CONTENT_LENGTH': len(payload), 'wsgi.input': ExplodingBytesIO(payload)}) - with warnings.catch_warnings(record=True) as w: - warnings.simplefilter("always") - with self.assertRaises(UnreadablePostError): - request.raw_post_data - self.assertEqual(len(w), 1) + with self.assertRaises(UnreadablePostError): + request.body