Cheeso
Cheeso

Reputation: 192577

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?

Upvotes: 5

Views: 514

Answers (2)

SerialSeb
SerialSeb

Reputation: 6766

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.

Upvotes: 3

Hank Gay
Hank Gay

Reputation: 71979

Rails does it, and it is the blessed way of doing things in the REST world, so I would expect it to be increasingly common.

Upvotes: 1

Related Questions