Resources as Nouns, Not Verbs
What you'll learn: You'll understand why REST APIs should name resources after "things" rather than "actions."
The Core Principle
In REST API design, your URLs should represent entities (nouns) in your system, not the operations (verbs) you perform on them. Think of resources as the objects in your domain—users, orders, products, invoices—not what you do to them.
The HTTP verbs (GET, POST, PUT, DELETE) already tell the server what action to take. Your resource names should only identify what you're working with.
Wrong vs. Right
❌ Wrong (verb-based URLs):
/getAllUsers/createNewOrder/deleteProduct/123/updateUserProfile
✅ Right (noun-based URLs):
GET /users(retrieves all users)POST /orders(creates a new order)DELETE /products/123(deletes product 123)PUT /users/profile(updates user profile)
Why This Matters
Using nouns keeps your API clean, predictable, and truly RESTful. When resources are nouns, clients can intuitively understand what data they're accessing. The HTTP verb provides the action, so adding verbs to URLs is redundant and breaks the uniform interface principle you learned earlier.
Think of it like a library: you don't ask to "retrieveBook" or "returnBook"—you work with the "books" resource, and your action (checking out, returning) is separate from identifying what books are.
Key Takeaway: REST resources should be named as nouns representing entities in your system; use HTTP verbs (GET, POST, PUT, DELETE) to specify the action, keeping URLs clean and intuitive.