7. NetworkingAPI styles
API styles
API styles are the different conventions for how one program asks another for data or actions over a network. REST treats everything as resources at URLs that you read and change with standard HTTP verbs like GET and POST; it’s simple, cacheable and works anywhere. gRPC lets you call a function on another service almost as if it were local, sending compact binary messages over HTTP/2, which makes it quick and well suited to internal service-to-service calls. GraphQL exposes one endpoint where the client describes exactly the fields it wants, avoiding several round trips or bloated responses. The choice is mostly about who the clients are and what they need.
In this lesson: The same request as REST, gRPC and GraphQL side by side. WebSockets vs polling on a timeline.