Viewing raw HTTP post name/value pairs sent to MVC action method

When using ASP.NET MVC sometimes after a request viewModel properties you expect to be binded and populated are not. For HTTP GET action methods debugging why this might be is easy as the params are visible in your URL.  For HTTP POST requests the name/value pairs are sent in the header so they are not as easy to review.

One could use Fiddler or the Chrome/IE developer tools to look at the raw name/values pairs being posted across from the view but the Visual Studio Locals window gives you access to this information too. Just set a breakpoint in your action method and examine the current request object in the Locals window as shown below, the particular property you want to look at is Form. In the example below we can see the raw name/value pair string isSelectedCity=4&Country=United+States


image001 (1)

Leave a Reply

Your email address will not be published. Required fields are marked *