Skip to content

HTTP Methods Cheat Sheet

HTTP methods (also called HTTP verbs) define the action to be performed on a resource in a client–server architecture. Each method has a specific purpose and semantic meaning.


GET

Retrieves data from the server without modifying the resource.

GET /users HTTP/1.1
GET /users/42 HTTP/1.1

POST

Sends data to the server to create a new resource.

POST /users HTTP/1.1
Content-Type: application/json
POST /users HTTP/1.1
{
  "name": "Alice",
  "email": "alice@example.com"
}

PUT

Replaces an existing resource with the provided data.

PUT /users/42 HTTP/1.1
Content-Type: application/json
PUT /users/42 HTTP/1.1
{
  "name": "Alice",
  "email": "alice@newmail.com"
}

PATCH

Partially updates an existing resource.

PATCH /users/42 HTTP/1.1
Content-Type: application/json
PATCH /users/42 HTTP/1.1
{
  "email": "alice@updated.com"
}

DELETE

Removes a resource from the server.

DELETE /users/42 HTTP/1.1
DELETE /sessions/current HTTP/1.1

Requests headers only, without the response body.

HEAD /users HTTP/1.1
HEAD /health HTTP/1.1

OPTIONS

Describes the communication options for a resource.

OPTIONS /users HTTP/1.1
OPTIONS /api HTTP/1.1

TRACE

Echoes the received request for diagnostic purposes.

TRACE / HTTP/1.1
TRACE /debug HTTP/1.1

CONNECT

Establishes a tunnel to the server, commonly used for HTTPS proxies.

CONNECT example.com:443 HTTP/1.1
CONNECT api.example.com:443 HTTP/1.1

Method Safety and Idempotency

Some HTTP methods are considered safe or idempotent.

Safe methods:     GET, HEAD, OPTIONS
Idempotent:       GET, PUT, DELETE, HEAD, OPTIONS
Not idempotent:   POST, PATCH