For example, here's a quote from Roy Fielding: "In general, I avoid content negotiation without redirects like the plague because of its effect on caching.". In other words, content negotiation for a versioned content-type is OK... if it redirects to a URL that contains the version.
httpbis, the IETF working group in charge of maintaining and developing the core HTTP spec, has deprecated content negotiation: http://trac.tools.ietf.org/wg/httpbis/ticket/81; it's still part of a separate spec (RFC2295), but it's not a core component of HTTP anymore. Why? 'HTTP content negotiation was one of those "nice in theory" protocol additions that, in practice, didn't work out.'
Certainly you can still build an API that works fine using specialized content types. Versions in the URL are a pretty practical approach that work very well too.
> Re: [rest-discuss] Request Header vs. Query String
> On 4/11/06, Roy T. Fielding <fielding@...> wrote:
> In general, I avoid content negotiation without redirects like the
> plague because of its effect on caching.I am not certain which method I prefer more honestly, and could fall either way. The comment that it was nice in theory but didn't work in practice seems to more point to not following the spec as it was written then a problem with the spec itself.
Impossible? No, not really.
Worthwhile? My opinion is no. I haven't seen the practical benefits of the content-negotiation approach over the URL approach, but I have seen the practical difficulties, so I'm convinced.
Perhaps if your API won't be that useful to browser based clients, perhaps that'd be the way to go.
That's only when using HTML forms or links, TFA does not even mention the option of multiple representation of resources so it's irrelevant: there's nothing hard to adding an Accept header to an XHR.