REST is a post-hoc description of how the web worked (at the time it was made).
You had web pages with hyptertext content, and that included forms. The forms had fields with names and an "action" destination.
The client (the browser) knows nothing about the server or even its APIs. It just knows how to send an HTTP request with parameters. In the case of forms, those parameters were encoded in the body of a POST request. That's it.
There was no "client side code" that talked to the server.
The "client side" is literally just the browser. Talking to the server is done by the user clicking links and filling forms.
I don't think the article is particularly encouraing you to program this way in 2022. Just telling you that if you are not programming in this way, do not call what you are doing "REST", because it is not.
It's only obscure for people who arrived at the scene long after the distortion of terms already took place, and never studied where the terminology comes from.
whether it is a local function or a remote function, both caller and callee need to agree on the parameters (input), and returns (output).
I send you X. You send me back Y. That's it - this is the contract we both agree to.
OP is saying - the caller should NEVER do anything with Y other than display it on screen, for it to be called REST.
Well - why even display it, why not just discard it ?
Calling print(Y) is as good as calling businesslogic(Y).
Whatever further logic a human plans to do after print(Y), a machine can do the same.
In other words, REST is just step 1 of returning data from a remote function. The moment you code any additional logic on the returned data (which is 99% of use cases), it's not REST anymore ?
Sounds like an extremely limited definition /use case of REST.
The P in API is programmer’s. Specifically it is a programattic call.
REST says you get hyperlinks, which are effectively documentation in the response.
Which is nice.
But a program isn’t a person it doesn’t need docs in the response.
And URL links are not sufficient documentation to use the interface.
So I don’t get the REST use case outside of some university AI project where your program might try to “make sense”’of the API.
And therefore I have never tried to use REST and I have never seen anyone else either at anywhere I have worked.
It is a nonsense concept to me.
REST API is a contradiction in terms.