Last post Feb 17, 2012 09:46 AM by pedroreys
Feb 16, 2012 03:57 PM|pedroreys|LINK
When an unknwon media type is added in the request Accept Header, the Web API, per testing the "values" example api, is returing the resource in json. But, per section 14.1 of the HTTP spec: "If an Accept header field is present, and if the server cannot
send a response which is acceptable according to the combined Accept field value, then the server SHOULD send a 406 (not acceptable) response."
Feb 16, 2012 04:28 PM|Henrik Frystyk Nielsen|LINK
It's a reasonable to respond either with a 200 or with a 406 status code in this case. At the moment we err on the side of responding with a 2xx but I completely agree that there are sceanarios where 406 makes a lot of sense. Ultimately we need some kind
of switch for making it possible to respond with 406 but it's not there yet.
Hope this helps,
Feb 17, 2012 09:46 AM|pedroreys|LINK
Thank you, Henrik
I ended up implementing a Message Handler to do the 406 response: http://bit.ly/xzeSO9