3 ms·
Using content negotiation, I can--if the server supports it--take the same URI (e.g. http://www.jerf.org/ http://www.jerf.org/) and pass it to an image viewer t
by enduser 16y ago
Using content negotiation, I can--if the server supports it--take the same URI (e.g. http://www.jerf.org/ 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).
- awj 16y agoWhat, realistically, is the difference between knowing how to mangle URIs vs. knowing what content types are available for negotiation?
- wahnfrieden 16y ago@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.
- jerf 16y agoI 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.