title: How to access request body when using Django Rest Framework and avoid getting RawPostDataException
body: <p>I need to get the raw content of POST request body (as a string) yet when I try to access <code>request.body</code> I'm getting an exception:</p>
  <pre><code>django.http.request.RawPostDataException:
  You cannot access body after reading from request's data stream
  </code></pre>
  <p>I am aware that it is adviced to use <code>request.data</code> instead of <code>request.body</code> when using Django Rest Framework, yet for the purpose of validating digital signature I have to have the request body in a raw and &quot;untouched&quot; form, since this is what 3rd-party signed and what I need to validate.</p>
  <p>Pseudocode:</p>
  <pre><code>3rd_party_sign(json_data + secret_key) != validate_sign(json.dumps(request.data) + secret_key)
  
  3rd_party_sign(json_data + secret_key) == validate_sign(request.body + secret_key)
  </code></pre>