5 ms·
> A REST client needs little to no prior knowledge about how to interact with an application or server beyond a generic understanding of hypermedia. This langu
by anotherhue 3y ago
> A REST client needs little to no prior knowledge about how to interact with an application or server beyond a generic understanding of hypermedia.
This language always bothered me, 'client' in this case surely means a advanced general intelligence, or 'human', who can futz around with the URIs to try and get what they need. Maybe that's better than CORBA, but it's not the Universal Translator of interfaces by a long shot.
- sgeisenh 3y agoClient means browser in this context.
- ivan_gammel 3y agoOnly if hypermedia API is based on HTML/HTTP, which is not necessarily the case.
- a_cardboard_box 3y agoThe client is the web browser. Firefox can be built entirely without any knowledge of what hacker news is, and you can still browse hacker news on it.
- kbenson 3y agoI think you're providing evidence for their point? HN isn't exactly useful without a person to browse it. "A generic understanding of hypermedia" is easy to say, but may be much more complex in reality to encode into a set of rules that a program knows to follow. And if we're going to compare "a REST client" as purely the requestor and not the interpreter of the data to something that does JSON RPC calls or graphql, which is often basically REST+, I'm not sure there's any real difference.
- whstl 3y agoHacker News is very useful to Googlebot, and it gets crawled by it every day. It is also useful for people programming Selenium etc to automate using it to collect data. Conversely, an API is not useful without a human or something automated to use it. The point of REST/HATEOAS is not to have arbitrary random APIs that can be magically discovered by a random magic application. There must be some agreements and standards there. OData, GData and AtomPub are good examples of APIs that follow HATEOAS, if you want something that's not HTML+browser.
- yellowapple 3y ago> HN isn't exactly useful without a person to browse it. Is any software useful without someone, you know, using it?
- spankalee 3y agoYour comment is being misunderstood, maybe because of the way you phrased it, but you have a point: a generic client might be able to traverse links of arbitrary data, but it won't know what they mean or why to traverse the links. Besides a structured data browser for humans, or some kind of transforming proxy, it's hard to see what use cases this is clearly and practically better for.
- yellowapple 3y agoMy impression is that the lack of knowledge of what/why is kinda the point: it's the server's job to make the intent clear (via hypermedia), and it's the client's job to faithfully represent that intent to the user. The use-case is therefore related to that of the "semantic web": provide as much expressivity for that intent as possible, and make it as easy as possible for the client to faithfully convey it.
- ivan_gammel 3y agoHypermedia can be domain-specific, which already includes a lot of knowledge about data and operations. In case of HTML client needs to know the semantics of all HTML tags and understand how forms work. JSON-based RMM level 3 API can require knowledge of the schema of domain model and logical names of operations, leaving a lot of business logic to server, e.g. availability of certain operations in current security context. Client can render a button based on whether an operation with given name is mentioned in response or not instead of checking user roles etc.
- dsego 3y agoYou are supposed to define custom hypermedia types (instead of application/json which is generic, you have application/foobar+xml).
- whstl 3y agoThat's probably the most important post here. Whenever this discussion comes up, people believe that HATEOAS is about magic clients consuming arbitrary JSON APIs. It's not. In HATEOAS the URLs can be arbitrary, but the format cannot.
- deleted 3y ago[deleted]
- e12e 3y ago> a generic understanding of hypermedia Is doing a lot of work here. Firefox can help me search Google and eBay (and so can lynx and w3m) with "only" a "generic understanding of hypermedia".