HTTP Methods

The verbs (GET, POST, PUT, PATCH, DELETE) that indicate the desired action to be performed on a resource.

Internet3 min readConcept 10 of 35

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.

$10.00

Send HTTP Request

Server Logs

Waiting for requests...

Check yourself

Pick an answer to lock it in, then read why. Getting one wrong is part of how it sticks.

  1. 1Which HTTP method should be used to retrieve user profile data without modifying it?
  2. 2You need to update just the email address of an existing user profile, leaving all other fields intact. Which method is most semantically appropriate?
  3. 3What does it mean for an HTTP method to be 'idempotent'?

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.