In the HttpApplication.BeginRequest event, how can I read the entire raw request body? When I try to read it the InputStream is of 0 length, leadin
HttpApplication.BeginRequest
InputStream
It is important to reset position of InputStream.
var memstream = new MemoryStream(); Request.InputStream.CopyTo(memstream); Request.InputStream.Position = 0; using (StreamReader reader = new StreamReader(memstream)) { var text = reader.ReadToEnd(); Debug.WriteLine(text); }