News for hackers. Stuff that matters.
Re:Dudes, this is so not REST by jerf on Tuesday March 15, 2011 @02:49PM (#2328840)
Bear in mind the more things like "Well, you just have to properly use the content negotiation headers" you add to your API, the more the "simplicity" argument of REST goes out the window. I'm not sure I've ever seen really correct use of the content-negotiation headers and claiming it's a solution is dubious... sort of like how I'm still waiting to see proper use of XML Namespaces in the wild. They seem relatively simple to me but the evidence suggests strongly otherwise.

That doesn't make REST "bad", but I think it does start to make the quasi-religious aspect of it less obviously correct.

Re:Dudes, this is so not REST by Groxx on Tuesday March 15, 2011 @02:52PM (#2328856)
That's part of my reasoning. Setting proper headers is, yes, more proper... and something essentially nobody does, and many simple API libraries don't support without making using them massively more complicated than prefixing all the URLs with "api/2".

It's a correctness vs usability debate. I'd love to go for correct, but it's extremely painful to enforce in your users in practice.

Re:Dudes, this is so not REST by enduser on Tuesday March 15, 2011 @05:34PM (#2329500)
Using content negotiation, I can--if the server supports it--take the same URI (e.g. http://www.jerf.org/) and pass it to an image viewer to see your face, to my address book to fetch your contact info, etc.

Anything else requires the client knowing how to mangle URIs (e.g. adding /avatar.jpg, /contact.vcf).

Re:Dudes, this is so not REST by jerf on Tuesday March 15, 2011 @08:15PM (#2330098)
I know what content negotiation is; I've never seen it done right. The theory is all beautiful but in practice content negotiation never seems to work right because you never get two people to agree very well on what things are. Another manifestation of the usual semantic classification problem.

It has a dubious track record in X as well. X has been able to do content negotiation for decades for the clipboard but even now it's still spotty and buggy, and that's with everything actually running on the same system. It looks easy. Heck, it looks very easy. It isn't. I can't even tell you exactly why it isn't as easy as it looks (beyond the semantic thing I mentioned above), but the state of the world is pretty clear.

Re:Dudes, this is so not REST by awj on Tuesday March 15, 2011 @06:21PM (#2329734)
What, realistically, is the difference between knowing how to mangle URIs vs. knowing what content types are available for negotiation?
Re:Dudes, this is so not REST by wahnfrieden on Tuesday March 15, 2011 @06:39PM (#2329805)
@awj: if your API does HATEOAS properly, so that your responses inline URLs to other related resources (aiding discoverability of your API through hypertext), then the client can naively take the URLs given to it and cleanly apply Accept headers to them as appropriate.