• ↑↓ to navigate
  • ↵ to open
  • ⟶ to select
  • ⌘ ⌥ ↵ to open in a panel
  • ←→ to navigate
  • esc to dismiss
⌘ '
keyboard shortcuts

The Problem

Clients need a standardized way to indicate what action they want the server to perform on a resource.

Core Idea

HTTP methods (also called verbs) define the intent of a request. Each method has semantic meaning that clients and servers can rely on.

How It Works

MethodIntentSide Effects
GETFetch dataNone (safe)
POSTCreate resourceMay create
PUTReplace entirelyIdempotent
PATCHPartial updateMay mutate
DELETERemoveIdempotent
@RestController
@RequestMapping("/api/notes")
public class NoteController {
    @GetMapping("/{id}")        // Fetch
    @PostMapping               // Create
    @PutMapping("/{id}")       // Replace
    @PatchMapping("/{id}")     // Partial update
    @DeleteMapping("/{id}")    // Remove
}

Key Properties

  • Safe methods: GET, HEAD, OPTIONS — do not modify server state
  • Idempotent methods: GET, PUT, DELETE — same result despite repeated calls
  • Non-idempotent: POST, PATCH — repeated calls produce different results

Visual Explanation

true A True Input B True Core Mechanism A->B triggers C True Output B->C produces

Semantic Network

semantic_true THIS True REL1 Related Concept THIS--REL1 related REL2 Builds Into THIS--REL2 builds into

Connections

  • Built from: HTTP (the protocol that defines these)
  • Related: HTTP Status Codes (codes pair with methods)
  • Contrasts with: Circuit Switching (connection-held methods)
  • Related: Statelessness (methods are independent requests)

Edge Cases & Gotchas

  • Use PATCH for most updates—PUT replaces entirely
  • POST creates new resources; calling twice typically creates two records
  • DELETE is idempotent—deleting already-deleted resource returns same response