Rest
Rest
For example:
sql
CopyEdit
GET /users → Get all users
GET /users/1 → Get user with ID 1
POST /users → Create a new user
PUT /users/1 → Update user with ID 1
DELETE /users/1 → Delete user with ID 1
5. Cacheability
Responses must define whether they can be cached to improve performance.
● Keep it stateless
200 OK
201 Created
401 Unauthorized
403 Forbidden
🧠 Summary
● A RESTful API follows REST principles and uses HTTP methods to interact with
resources.
● REST is widely used due to its simplicity, scalability, and compatibility with the web.