Chapter 2: The network

REST

Also called RESTful

A style of designing web APIs around things rather than actions: GET /orders/42, not POST /getOrder. The word comes from Roy Fielding's 2000 dissertation, and most APIs called REST follow only part of it.

It's a convention an agent already knows, so naming it gets you predictable addresses. Don't stop there, though. "Make it RESTful" leaves plenty open, so spell out the addresses and the status codes you want, and argue about the design before the code exists.

Say it to your agent

“Use these routes: GET /orders, POST /orders, GET /orders/:id, PATCH /orders/:id, DELETE /orders/:id. Return 201 with a Location header on create, no verbs in paths, and show me the route list before you build it.”

The workshop

Name a word, or describe what you mean in everyday language.