RESTful Digest

Mansoor Aldosari
2 min readJan 23, 2023

--

Photo by Margaret Jaszowska on Unsplash

First, what is an API?
API stands for application program interface. It doesn’t have a view like other interfaces, but it’s an interface where two programs communicate.
Moreover, an API returns a data structure such as JSON (JavaScript object Node).

Second, what is REST?
REST stands for representational state transfer. It is an architectural pattern and not a protocol. For API to be RESTful, it has to comply with the following:

  1. Client-server architecture, where the communication happens between two systems
  2. Stateless communication is when requests are independent of one another.
  3. Data caching of the most frequent responses to reduce bandwidth and increase performance.
  4. Uniform interface, such as HTTP request (GET, POST, DELETE, and PUT).
  5. A layered system means intermediary servers don’t alter the request and response.
  6. Code on demand is optional, where the server can respond with an executable code instead of JSON.

How do APIs work?
So the journey starts with a client requesting information from a server, and the server responds with a resource. It is simple as that.

What about security?
The majority of public APIs have a key to control who has the right to interact with an API and limit the number of requests by a user to avoid any bottleneck that might load the system.

Why it’s important?
As you can see, REST supports many data types. It works very well with web applications and uses minimal bandwidth. The downside states are not maintained, but this is by design.

Happy Hacking + 418 + HTTP

Happy Hacking + 418 + HTTP

--

--

No responses yet