3 ms·
Well, it's kind of an ad of course (although intercooler is free and open source, with no company offering any services around it) but there is a deeper point h
by carsongross 11y ago
Well, it's kind of an ad of course (although intercooler is free and open source, with no company offering any services around it) but there is a deeper point here.
I see a lot of confusion in these comments: I'm not advocating HTML as a general API for use with native mobile clients, SPAs, etc. And I'm saying, explicitly, that REST-ful JSON, as implemented by most developers, has proven a bad choice for that need. And I think that is because HATEOAS has never found a natural expression in JSON.
So I'm saying: if you want to follow REST-ful principles for your web application, you should abandon a data-level API entirely, and move to a partial HTML model instead, where HTML allows you to naturally leverage HATEOAS without even really thinking about it.
Ad, deep insight, whatever. It's a thing.
- icebraining 11y agoThe thing is, if one wants to follow REST-ful principles in web applications, one can just write JSON documents with links. The fix is not hard nor complicated - which, to me, shows that the problem is not that people really want to use REST but can't due to JSON, and must be something else. In my opinion, people don't really want to use REST, either because they don't really understand it (as seen by the number of RPC APIs being described as "RESTful") or they just don't think it's the best solution for their problem. That said, Intercooler.js can still be a very useful library, but I think it might be successful despite REST, not because of it.
- carsongross 11y agoI don't agree: the fix is hard, because not only do you have to pick one of the many at-war non-standard standards for your links in JSON, but then clients must figure out how to interpret the links. I think the empirical evidence of the last two decades overwhelmingly supports this conclusion. This is what HTML gives developers: they don't even realize they are satisfying the HATEOAS constraint because it is simply so natural.