HTTP Methods
The verbs (GET, POST, PUT, PATCH, DELETE) that indicate the desired action to be performed on a resource.
What it is
**HTTP Methods** (or Verbs) indicate the desired action to be performed on a specific resource. The most common methods are **GET** (retrieve), **POST** (submit/create), **PUT** (replace), **PATCH** (partially modify), and **DELETE** (remove). Some methods are **Safe** (read-only, no state change) and some are **Idempotent** (doing it multiple times has the same end result as doing it once).
Why it matters
Standardized verbs are the foundation of RESTful API design. Knowing which method corresponds to which CRUD operation ensures your APIs are predictable, maintainable, and cacheable by browsers.
How it works
The HTTP method is the very first word in the request's start line (e.g., POST /api/users HTTP/1.1). Under the hood, functions like fetch({ method: 'POST' }) simply build this starting string.
Try it
Test the Idempotency Vending Machine below to see how different HTTP methods affect the state of the server.
Send HTTP Request
Server Logs
Check yourself
Pick an answer to lock it in, then read why. Getting one wrong is part of how it sticks.
Remember this
- GET is for retrieving data (Safe and Idempotent).
- POST is for creating new resources or submitting data (Not Safe, Not Idempotent).
- PUT replaces an entire resource (Idempotent), while PATCH updates partial fields.
- DELETE removes a resource (Idempotent).
Done with this concept?
Mark it complete to track your progress. No login needed.