Cianplan

Level 1: Foundations · L1.1 APIs: REST, gRPC, GraphQL, WebSockets/SSE, webhooks

REST basics: resources, verbs, status codes

Model resources and pick correct HTTP methods and status codes.

12 min · Free

What you take away

  • REST models nouns (resources) and reuses HTTP's small set of verbs, rather than inventing a verb per operation.
  • GET is safe and cacheable; PUT and DELETE are idempotent; POST is neither, which is why retrying it is the hard case.
  • Status codes are the machine-readable half of your API: caches, proxies, clients and dashboards all act on them.
  • REST is a set of constraints — uniform interface, statelessness, cacheability — not 'JSON over HTTP'.

How the class is laid out

  1. The problem
  2. The simple version
  3. The verbs, and what each promises
  4. Status codes are an interface
  5. Check your understanding