2024-03-26Hünkar Döner

What is REST API? The Foundation of Modern Web

APIRESTWeb Development
W

What is REST API?

REST (Representational State Transfer) is an architectural style for providing data exchange between distributed systems. It was defined by Roy Fielding in his doctoral dissertation in 2000. Today, the vast majority of web services rely on REST architecture.

Core Principles

For a system to be considered RESTful, it must adhere to the following constraints:

  1. Client-Server: The client (requester) and server (provider) are independent of each other.
  2. Statelessness: The server does not store client context (session). Every request must contain all information necessary to fulfill it.
  3. Cacheability: Server responses must define themselves as cacheable or not.
  4. Layered System: The client does not need to know whether it is connected directly to the end server or to an intermediary.
  5. Uniform Interface: Communication happens via a standard interface (usually HTTP).

HTTP Methods

REST APIs use different HTTP methods depending on the operation:

  • GET: Used to retrieve data. (e.g., Get user list)
  • POST: Used to create new data. (e.g., Add new user)
  • PUT: Used to update existing data. (e.g., Modify user info)
  • DELETE: Used to delete data. (e.g., Delete user)

REST APIs have become the standard in modern software development due to their simplicity, scalability, and platform independence.