HTTP Verbs
HTTP verbs are methods that indicate the action to be performed on a server resource. Each verb has specific semantics used in client-server communication. These are the main HTTP verbs:
1. GET
Purpose:
Retrieve information about a resource on the server.
Characteristics:
- Does not change the server state (idempotent method).
- Data is sent in the URL.
- Usually used to view data.
Example:
GET /api/users HTTP/1.1
Host: example.com2. POST
Purpose:
Create a new resource on the server.
Characteristics:
- Sends data in the request body.
- Not idempotent (repeating the request can create multiple resources).
Example:
POST /api/users HTTP/1.1
Host: example.com
Content-Type: application/json
{
"name": "John",
"email": "john@example.com"
}3. PUT
Purpose:
Update an existing resource, or create it if it does not exist.
Characteristics:
- Idempotent (repeating the request does not change the final result).
Example:
PUT /api/users/1 HTTP/1.1
Host: example.com
Content-Type: application/json
{
"name": "John Updated",
"email": "john@example.com"
}4. PATCH
Purpose:
Partially update an existing resource.
Characteristics:
- Idempotent, but the update is limited to the fields provided.
Example:
PATCH /api/users/1 HTTP/1.1
Host: example.com
Content-Type: application/json
{
"email": "new-email@example.com"
}5. DELETE
Purpose:
Remove a resource from the server.
Characteristics:
- Idempotent (repeating the request has no further effect).
Example:
DELETE /api/users/1 HTTP/1.1
Host: example.com6. OPTIONS
Purpose:
Return the communication options available for a resource.
Characteristics:
- Usually used to check which methods an endpoint supports.
Example:
OPTIONS /api/users HTTP/1.1
Host: example.com7. HEAD
Purpose:
Request information about a resource without retrieving the response body.
Characteristics:
- Similar to GET, but returns only the response headers.
Example:
HEAD /api/users HTTP/1.1
Host: example.com8. TRACE
Purpose:
Trace the path a request takes to the server.
Characteristics:
- Used for diagnostics and testing; rarely used in production.
Example:
TRACE /api/users HTTP/1.1
Host: example.com9. CONNECT
Purpose:
Establish a communication tunnel between client and server.
Characteristics:
- Commonly used for secure connections such as HTTPS.
Example:
CONNECT example.com:443 HTTP/1.1Summary
| Method | Idempotent | Request body? | Main use |
|---|---|---|---|
| GET | Yes | No | Retrieve data |
| POST | No | Yes | Create resource |
| PUT | Yes | Yes | Replace/create |
| PATCH | Yes | Yes | Partial update |
| DELETE | Yes | No | Remove resource |
| OPTIONS | Yes | No | Supported methods |
| HEAD | Yes | No | Metadata |
| TRACE | Yes | No | Trace request |
| CONNECT | No | No | Connection tunnel |
Last updated: November 29, 2026