title: How to get raw request body in ASP.NET?
body: <p>In the <code>HttpApplication.BeginRequest</code> event, how can I read the entire raw request body? When I try to read it the <code>InputStream</code> is of 0 length, leading me to believe it was probably already read by ASP.NET.</p>
  
  <p>I've tried to read the InputStream like this:</p>
  
  <pre><code>using (StreamReader reader = new StreamReader(context.Request.InputStream))
  {
      string text = reader.ReadToEnd();
  }
  </code></pre>
  
  <p>But all I get is an empty string. I've reset the position back to 0, but of course once the stream is read it's gone for good, so that didn't work. And finally, checking the length of the stream returns 0.</p>
  
  <p><strong>Edit:</strong> This is for POST requests.</p>