Media type not supported should throw 415 rather than 406
In the AbstractController there's a check for supported media types. If this does not match, currently a 406 is thrown but should be 415.
Updated by Karsten Dambekalns about 9 years ago
While this may be more intuitive, it is wrong. From http://stackoverflow.com/questions/3294483/http-406-and-415-error-codes comes this nice explanation:
- 406 is returned by the server when it can't respond based on accepting the request headers (ie they have an Accept header which states they only want XML).
- 415 is returned by the server when the entity sent in a request (content in a POST or PUT) has an unsupported mediatype (i.e. they sent XML).
so.. 406 when you can't send what they want, 415 when they send what you don't want.