HTTP 415 unsupported media type error when calling Web API 2 endpoint

SOLVED After banging my head on the wall for a couple days with this issue, it was looking like the problem had something to do with the content type negotiation between the client and server. I dug deeper into that using Fiddler to check the request details coming from the client app, here’s a screenshot … Read more

POST JSON fails with 415 Unsupported media type, Spring 3 mvc

I’ve had this happen before with Spring @ResponseBody and it was because there was no accept header sent with the request. Accept header can be a pain to set with jQuery, but this worked for me source $.postJSON = function(url, data, callback) { return jQuery.ajax({ headers: { ‘Accept’: ‘application/json’, ‘Content-Type’: ‘application/json’ }, ‘type’: ‘POST’, ‘url’: … Read more