3 ms·
At a high level, REST is impractical for machine-to-machine interactions where there is no immediate user and hence no need for a user-agent. REST is amazingly
by stanleydrew 11y ago
At a high level, REST is impractical for machine-to-machine interactions where there is no immediate user and hence no need for a user-agent. REST is amazingly practical for things like the human-readable web that we know and love.
If Stripe, e.g., were to build a truly REST machine-to-machine API then they wouldn't need to create any documentation of "endpoints". Developers would only need to point a generic REST client at the API's root URL and all the other endpoints would be discoverable from there.
This is impractical, because a machine-to-machine API will generally know that it wants to charge a credit card or update a billing address and will reap benefits of knowing exactly how to do that without the overhead of going to the root of the API and navigating the resource tree every time.
It can be summed up like this: pure REST is practical in situations where tight-coupling of a client and server's interactions is undesireable. In machine-to-machine interactions, there is almost always some value in tight coupling, or at least a level of coupling that pulls the system away from being "pure" REST. Hence it's rather impractical.