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 appli
If your WebApi application really only uses JSON, you could use this solution where it always responds with JSON and ignores the request content-type:
How can I force asp.net webapi to always decode POST data as JSON
From that, I would suggest this solution:
This code needs to be added to Application_Start or WebApiConfig.Register
config.Formatters.JsonFormatter.SupportedMediaTypes.Add(new MediaTypeHeaderValue("text/plain"));
config.Formatters.Remove(config.Formatters.FormUrlEncodedFormatter);
config.Formatters.Remove(config.Formatters.XmlFormatter);
It tells the json formatter to accept the plain text content-type, and removes the form and xml formatters (although removing them may not be needed)
ugly, but you could try modifying the content-type header from text/plain to application/json in a message handler so that parameter binding happens properly with json formatter.