4 ms·
> Creating a full-fledged API [...]. You need to think about [...] the REST principles I can assure you you don't need to do that. And most people don't. It's
by tasuki 4y ago
> Creating a full-fledged API [...]. You need to think about [...] the REST principles
I can assure you you don't need to do that. And most people don't.
It's perfectly possible to create a useful API without adhering to the REST principles.
[Edit, having read the rest of the article]: Case in point, this very PostgREST tool promoted in the article appears very useful, while not thinking about the REST principles.
- beachy 4y agoIf you're talking about HATEOAS (which many zealots equate one to one with REST) you may be pleased to know there is no reference to it whatsoever in this article.
- morelisp 4y ago> zealots REST is defined by four interface constraints: identification of resources; manipulation of resources through representations; self-descriptive messages; and, hypermedia as the engine of application state.
- kreetx 4y agoOr is it the other way around? I seem to remember that Roy Fielding did actually mean HATEOAS when saying REST, that REST isn't only CRUD but a discoverable and self-describing API. EDIT: And the corollary of above is that most people when saying REST actually mean HTTP with correct method use. If not, then is there a good source on what you mean by REST and HATEOAS?
- morelisp 4y agoA lot of people confuse HATEOAS, the idea, with HAL, some attempt to standardize it.
- deleted 4y ago[deleted]
- tasuki 4y agoPerhaps I'm a zealot: HATEOAS is one required part of REST as per Roy Fielding, who came up with both. What does "REST" mean to you?
- criddell 4y agoIt seems like when taken to an extreme, strong HATEOAS would mean you could write a universal client that works across all APIs. I don't think service developers take HATEOAS super-seriously. From what I've seen, returning resources with a URI rather than an identifier is about all many services do to be HATEOAS-ish. Clients are coupled to the server, but that's often okay.
- discreteevent 4y ago> strong HATEOAS would mean you could write a universal client that works across all APIs. It would be hard not to make that client behave like a browser from the user's point of view.
- marcosdumay 4y agoExactly. HATEOAS implies as much flexibility as a browser, and as much understanding of the server data as a browser. So if you want a HATEOAS API, just make it output HTML and go with the crowd.
- steve-chavez 4y ago> It seems like when taken to an extreme, strong HATEOAS would mean you could write a universal client that works across all APIs. And if you go with HAL or JSON-LD, you have to use a specific clients for those formats, so not universal anyway. I tend to agree with "HATEOAS is for Humans"[1], HATEOAS makes sense when interacting with HTML. [1]: https://intercoolerjs.org/2016/05/08/hatoeas-is-for-humans.html https://intercoolerjs.org/2016/05/08/hatoeas-is-for-humans.h...
- beachy 4y ago"When I use a word," Humpty Dumpty said in rather a scornful tone, "it means just what I choose it to mean — neither more nor less." To me, like most people, REST means an http-based API where we use GET, POST, PUT, DELETE etc. to interact with resources. This in full understanding that under a literal interpretation of the enlightened one's (Roy Fielding's) utterances, REST mandates HATEOAS, meaning that there are only a few true REST APIs to be seen in the wild. I also usually use the term RESTful, this seems to be a somewhat widely accepted middleground.
- quickthrower2 4y agoWhat is the acronym for when something needs to be done, so you create an endpoint to do that thing, maybe return HTML if convenient (if it is a page request) or JSON if it is XHR, and then move on to the next user story?
- senko 4y agoAJAX: https://developer.mozilla.org/en-US/docs/Web/Guide/AJAX https://developer.mozilla.org/en-US/docs/Web/Guide/AJAX
- quickthrower2 4y agoPerhaps! Although more generally I guess it is HTTP
- is_true 4y agoIt's called ReRe, Return Response
- morelisp 4y agoHTTP. And it works fine up to a dozen entities and maybe a hundred endpoints, which will cover more use cases than people think.