Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Content-Type negotiation typical or atypical in REST apps?

My feeling is that Content-Type negotiation is one of those "should do" things for REST, but most frameworks, tools and apps punt on it - and don't, as far as I know.

Is this true?

What REST programming frameworks support content-type negotiation?

Should I expect it to broaden in usefulness? Will it become more common in REST frameworks? Are applications really delivering multiple formats for the same resource? Or will they? Is there a good reason to deliver multiple formats for a resource?

like image 587
Cheeso Avatar asked Oct 14 '22 15:10

Cheeso


1 Answers

On the .net side of things does it, OpenRasta does it, so does Ado.net Data services (albeit limited to xml and json).

Conneg is not only about content-types though, it also includes language and character sets.

It'll become more prevalent when more frameworks support it, but those frameworks are there now, so why not use them and leverage it now?

As for conneg being YAGNI, people already expect to have both json and xml representations for some of their resources, and with rdfa looming, they all become more and more important.

That said, conneg is not about REST, it's about HTTP and using it properly.

like image 65
SerialSeb Avatar answered Oct 18 '22 13:10

SerialSeb