What REST Means: Resource-Oriented Architecture
What you'll learn: How REST structures APIs around resources and uniform operations, not arbitrary endpoints.
The Core Idea
REST (Representational State Transfer) is an architectural style that treats everything in your system as a resource with a unique identifier (URI). Instead of defining custom endpoints like /getUserProfile or /deleteOrder, REST forces you to think: "What thing am I manipulating?" and use standard HTTP methods to interact with it.
In REST:
- Every meaningful entity is a resource (user, order, product)
- Each resource has a URI (
/users/123,/orders/456) - You manipulate resources with uniform operations: GET (read), POST (create), PUT/PATCH (update), DELETE (remove)
- Resources return representations (JSON, XML) of their current state
Why This Matters
Think of REST like a library catalog system. You don't have separate desks for "borrow-book," "return-book," "check-availability." Instead, you have books (resources) with catalog numbers (URIs), and you perform standard actions: check out, return, search. The uniformity makes the system predictable and scalable.
Compare:
Non-RESTful: POST /createUser, POST /updateUserEmail, POST /deleteUser
RESTful: POST /users, PATCH /users/123, DELETE /users/123
The RESTful approach uses nouns (resources) + verbs (HTTP methods), making APIs self-documenting and cacheable. It also enables statelessness—each request contains all information needed, no session memory required on the server.
Key Takeaway: REST structures APIs around resources identified by URIs and manipulated through uniform HTTP methods, creating predictable, scalable, and stateless interfaces that align with web architecture principles.