How to read raw http request in ASP.NET MVC ?

19. August 2014

How to read raw http request in ASP.NET MVC ?

Below are the codes you can use to read the raw request in parts .

Read the Request Headers :

string originalHeader = HttpHandler.Request.ServerVariables["ALL_RAW"];

For reference http://stackoverflow.com/questions/1038466/logging-raw-http-request-response-in-asp-net-mvc-iis7

Read the Request body :

Request.InputStream.Position = 0;
var input = new StreamReader(Request.InputStream).ReadToEnd();

For reference http://stackoverflow.com/questions/12696506/getting-the-raw-request-in-mvc3

ASP.NET MVC , , , ,

Getting Started with asp.net MVC

19. November 2012

You can start your learning process through this link with an option provided to download free Visual Studio 2012 Express Edition with MVC 4 :

http://www.asp.net/mvc

ASP.NET MVC ,