Idempotent method

An HTTP method is idempotent when repeating the same request produces the same intended server-side effect as making it once. GET, PUT, and DELETE are idempotent by definition, while POST is not guaranteed to be idempotent.

Minimal example

ts
await api.request("/v1/restaurants/5", {
  method: "GET",
});

Learn this concept

Lesson 4.19 · Resilient client patterns

Used in exercises

Exercise 4.20 · API request retry utility
Prerequisite conceptsHTTP status codes