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:

http
GET /api/users HTTP/1.1
Host: example.com

2. 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:

http
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:

http
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:

http
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:

http
DELETE /api/users/1 HTTP/1.1
Host: example.com

6. OPTIONS

Purpose:

Return the communication options available for a resource.

Characteristics:

  • Usually used to check which methods an endpoint supports.

Example:

http
OPTIONS /api/users HTTP/1.1
Host: example.com

7. HEAD

Purpose:

Request information about a resource without retrieving the response body.

Characteristics:

  • Similar to GET, but returns only the response headers.

Example:

http
HEAD /api/users HTTP/1.1
Host: example.com

8. TRACE

Purpose:

Trace the path a request takes to the server.

Characteristics:

  • Used for diagnostics and testing; rarely used in production.

Example:

http
TRACE /api/users HTTP/1.1
Host: example.com

9. CONNECT

Purpose:

Establish a communication tunnel between client and server.

Characteristics:

  • Commonly used for secure connections such as HTTPS.

Example:

http
CONNECT example.com:443 HTTP/1.1

Summary

MethodIdempotentRequest body?Main use
GETYesNoRetrieve data
POSTNoYesCreate resource
PUTYesYesReplace/create
PATCHYesYesPartial update
DELETEYesNoRemove resource
OPTIONSYesNoSupported methods
HEADYesNoMetadata
TRACEYesNoTrace request
CONNECTNoNoConnection tunnel

Last updated: November 29, 2026