If URLs are the nouns of the web, HTTP Methods are the verbs. They provide the exact action to perform on the targeted resource.
1The Verbs of REST
We established that REST URLs should be strictly nouns (e.g., /users). So how does the server know what action to perform on that noun? This is the job of HTTP Methods (often called HTTP Verbs). By attaching a specific verb to the request, you explicitly tell the server whether you want to Read, Create, Update, or Delete the resource. This maps perfectly to the database concept of CRUD.
POST -> Create
GET -> Read
PUT -> Update
DELETE -> Delete
2GET: Reading Data
The GET method is used exclusively to request data from a specified resource. It is the most common HTTP method on the internet. Every time you type a URL into your browser and hit Enter, your browser performs a GET request under the hood. Crucially, GET requests are considered 'Safe' and 'Idempotent'. This means performing a GET request should NEVER alter or mutate data in the database. Browsers rely on this safety to cache GET responses aggressively.
GET /api/products
GET /api/products/42
3POST: Creating Data
The POST method is used to send data to the server to create a new resource. Unlike GET, POST requests carry a 'Body' (usually a JSON payload containing the new data). POST requests are NOT idempotent. This means if you execute the exact same POST request 10 times, the server will create 10 distinct, duplicate records in the database. When you submit a signup form, it sends a POST request. The browser knows this isn't safe to repeat blindly.
Content-Type: application/json
{
"name": "Alice"
}
4PUT vs PATCH: Updating Data
When you need to modify existing data, you use PUT or PATCH. While often used interchangeably by junior developers, they have a strict semantic difference. PUT is a complete replacement; it overwrites the entire resource. If you omit a field in a PUT request, that field is deleted. PATCH is a partial update; it only modifies the specific fields you send, leaving the rest of the object untouched. Modern architectures lean heavily on PATCH for safety.
PUT /users/1 { name: "B" }
// Result: { id: 1, name: "B" } (age lost!)
PATCH /users/1 { name: "B" }
// Result: { id: 1, name: "B", age: 20 }
5DELETE: Removing Data
The DELETE method is straightforward: it removes a specified resource from the server. Like GET, a DELETE request typically does not contain a body payload. The ID of the resource to be deleted is usually passed directly in the URL (e.g., /users/42). It is also idempotent; deleting a resource once removes it, and firing that same delete request again just results in a 404 (because it's already gone), leaving the server in the exact same state.
DELETE /users/42
6Step-by-Step Breakdown
The Verbs of REST. We established that REST URLs should be strictly nouns (e.g., /users). So how does the server know what action to perform on that noun? This is the job of HTTP Methods (often called HTTP Verbs). By attaching a specific verb to the request, you explicitly tell the server whether you want to Read, Create, Update, or Delete the resource. This maps perfectly to the database concept of CRUD.
GET: Reading Data. The GET method is used exclusively to request data from a specified resource. It is the most common HTTP method on the internet. Every time you type a URL into your browser and hit Enter, your browser performs a GET request under the hood. Crucially, GET requests are considered 'Safe' and 'Idempotent'. This means performing a GET request should NEVER alter or mutate data in the database.
Which of the following is a strict architectural rule regarding the GET method in a REST API?
- →GET requests must include a large JSON body payload.
- →GET requests must be 'safe'; they should never alter, mutate, or delete data in the database.
POST: Creating Data. The POST method is used to send data to the server to create a new resource. Unlike GET, POST requests carry a 'Body' (usually a JSON payload containing the new data). POST requests are NOT idempotent. This means if you execute the exact same POST request 10 times, the server will create 10 distinct, duplicate records in the database. When you submit a signup form, it sends a POST request.
PUT vs PATCH: Updating Data. When you need to modify existing data, you use PUT or PATCH. While often used interchangeably by junior developers, they have a strict semantic difference. PUT is a complete replacement; it overwrites the entire resource. If you omit a field in a PUT request, that field is deleted. PATCH is a partial update; it only modifies the specific fields you send, leaving the rest of the object untouched.
You have a user object with 20 different fields (name, email, address, etc.). The user only wants to update their email address. Which HTTP method is the most semantically correct to use?
- →PUT
- →PATCH
DELETE: Removing Data. The DELETE method is straightforward: it removes a specified resource from the server. Like GET, a DELETE request typically does not contain a body payload. The ID of the resource to be deleted is usually passed directly in the URL (e.g., /users/42). You have now mastered the grammar of the web. In the next module, we will explore the tools used to actually execute these requests.
Level Up 🚀
Advanced cheat sheets, SEO tricks, and interview prep for this topic.
Browser Support
Fully supported.
Fully supported.
Fully supported.
Fully supported.
Accessibility (A11y)
1Semantic Usage
Using the proper structure for The Verbs of REST ensures that screen readers can correctly interpret the content hierarchy and purpose.
<!-- Apply semantic elements appropriately -->SEO Implications
- 1
Contextual Relevance
Proper implementation of The Verbs of REST provides search engine crawlers with better context, improving the indexing accuracy of your page.
Best Practices
Clean Code
Always validate your structure when using The Verbs of REST to prevent layout shifts and DOM inconsistencies.
Separation of Concerns
Keep styling and behavior separate from the structural markup of The Verbs of REST.
Frequent Bugs
Unexpected layout shifts or styling failures.
Ensure all implementations related to The Verbs of REST are properly structured according to strict specifications.
Real-World Examples
Production Usage
Here is how The Verbs of REST is typically implemented in a professional, robust application.
<!-- Best practice implementation of The Verbs of REST -->
<div class="production-ready">
<!-- Content -->
</div>