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
Pål's answer is correct, but it can be done much shorter as well:
string req_txt; using (StreamReader reader = new StreamReader(HttpContext.Current.Request.InputStream)) { req_txt = reader.ReadToEnd(); }
This is with .NET 4.6.