So I wish to POST (or PUT) a complex object to the server from a AJAX post using CORS. Unfortunately IE8 only supports sending text/plain when using CORS and not application/json
.
Is there any way to implement a handler in WebAPI
to custom parse text/plain submissions.
By complex object I mean
public void POST([FromBody] MyCustomObject myResponse)
{
return null;
}
Normally I'd post in some JSON with the headers set appropriately but due to IE8 restrictions as soon as you set the header it fails with access denied so needs to be text/plain so what I'm planning to do is send a JSON string but called text/plain (ugly I know!) but for lack of a better option...