I have an IE8/IE9 CORS request using XDomainRequest of type POST coming into an ASP .NET MVC 3 web application. The linked blog post indicates that:
Only text/plain is supported for the request's Content-Type header
Now, since the Content-Type is text/plain
and this is outside my control, the MVC framework will not bind the POST
content parameters. It only seems to bind them when the Content-Type
is application/x-www-form-urlencoded
.
I cannot read the parameters from the Request
object either.
I need to find a way for MVC to bind these parameters. I thought about trying to modify the Content-Type
of the request on Application_BeginRequest
but this didn't work.
How can I get the MVC Framework to bind the POST parameters when the Content-Type
is text/plain
?
Update
I believe the parameters will be available through the Request.InputStream property. I'm looking for a way to generically bind these parameters using the MVC Framework default binding. I'd prefer not to have to write a model binder for every model in my project.