title: How does one retrieve the entity body from a request in Node.js/Express (for CSP violation reporting)?
body: <p>I am interested in implementing a Content Security Policy (CSP) for my Node.js application. Mozilla's docs are rather helpful but I am stuck at how to enable <a href="https://developer.mozilla.org/en/Security/CSP/Using_CSP_violation_reports" rel="nofollow">violation reports</a>. I understand the basic premise of how they work (the browser sends a POST request to the specified URL to notify the website of a violation) but could not figure out where to find the JSON document describing the violation in the HTTP request. Perhaps this would have been obvious to someone more familiar with the HTTP spec.</p>
  
  <p>Looking at the <a href="https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html#report-uri" rel="nofollow">W3C draft</a> for CSP, I established that the JSON is contained in a portion of the HTTP called the "entity body". I still don't know what the purpose of the entity is (the only mildly useful page I could find on the matter was one from the HTTP spec). I am assuming it the body of the request.</p>
  
  <p>Perhaps more importantly, I cannot find any way to retrieve the contents of the entity body. I thought of using <code>req.header('entity-body')</code> but that doesn't work as the entity is not a HTTP header. What is it and how to I fetch it?</p>
  
  <p>(Additionally, I tried finding a tutorial on how to implement CSP violation reporting in Node.js and found nothing. I did find one for PHP but it wasn't particularly helpful, referencing a <code>file_get_contents('php://input')</code> which I don't have anything similar to in Node.js/Express.)</p>
  
  <p>Any assistance would be greatly appreciated.</p>