Minimalist Guide to REST API
What is RESTful API?
It is a set of rules that allow programs to talk to each other. The developer creates the API on the server and allows the client to talk to it.
Terminology
- API: Application Program Interface
- REST: REpresentational State Transfer
Why we use RESTful API?
- To expose an independent infrastructure to the outside. Authorized or unauthorized.
- To perform operations that require powerful hardware on servers rather than clients.
- In order for different applications to communicate with each other with a common data structure.
- To ensure the technological independence of clients. (Like Desktop, Mobile, Web, Console, Embedded, etc.)
- In order to respond to the needs of different clients with different endpoints. (Like XML, JSON, gRPC etc.)
- Data Security
Anatomy Of A Request
- Endpoint (Route)
- HTTP Method
- HTTP Headers
- Data (Body / Message)