← Back to context

Comment by recursivedoubts

3 days ago

Yes. You used it to enter this comment.

I am using it to enter this reply.

The magical client that can make use of an auto-discoverable API is called a "web browser", which you are using right this moment, as we speak.

This is true, but isn’t this quite far away from the normal understanding of API, which is an interface consumed by a program? Isn’t this the P in Application Programming Interface? If it’s a human at the helm, it’s called a User Interface.

  • I agree that's a common understanding of things, but I don't think that it's 100% accurate. I think that a web browser is a client program, consuming a RESTful application programming interface in the manner that RESTful APIs are designed to be consumed, and presenting the result to a human to choose actions.

    I think if you restrict the notion of client to "automated programs that do not have a human driving them" then REST becomes much less useful:

    https://htmx.org/essays/hypermedia-clients/

    https://intercoolerjs.org/2016/05/08/hatoeas-is-for-humans.h...

    AI may change this at some point.

    • If you allow the notion of client to include "web browser driven by humans", then what is it about Fielding's dissertation that is considered so important and original in the first place? Sure it's formal and creates some new and precise terminology, but the concept of browsing was already well established when he wrote it.

      1 reply →

    • At that level, it would be infinitely clearer to say, "There is no such thing as a RESTful API, since the purpose of REST is to connect a system to a human user. There is only such a thing as a RESTful UI based on an underlying protocol (HTML/HTTP). But the implementation of this protocol (the web browser) is secondary to the actual purpose of the system, which is always a UI."

      5 replies →

So, given a hateos api, and stock firefox (or chrome, or safari, or whatever), it will generate client views with crud functionality?

Let alone ux affordances, branding, etc.

  • Yes. You used such an api to post your reply. And I am using it as well, via the affordances presented by the mobile safari hypermedia client program. Quite an amazing system!

I also use Google Maps, YouTube, Spotify, and Figma in the same web browser. But surely most of the functionality of those would not be considered HATEOAS.

  • Yes, very strongly agree. Browsers, through the code-on-demand "optional" constraint on REST, have become so powerful that people have started to build RPC-style applications in them.

    Ironic that Fielding's dissertation contained the seed of REST's destruction!