I’ve done some basic tests with System.Net.WebClient and an ASP.net MVC 3 website and I’ve found that when binding to the parameters of an action, MVC will automatically decode any query string parameters that have been UrlEncoded if you use GET. But it won’t automatically decode POST parameters. Is there a reason for this? Seems like a needless inconvenience.
I’ve done some basic tests with System.Net.WebClient and an ASP.net MVC 3 website and
Share
The ASP.NET MVC default model binder uses the
Request.Formprovider to read POST values. This provider also automatically decodes url encoded parameters.For example if you send the following POST payload:
in the corresponding controller action you will get the correct values:
So you probably are not correctly url encoding the request.