freecoding.school100% FREE · NO SIGNUP
Endpoint BayISSUE #16 of 45

crud · the four basic ops

RestaVSThe 401 Bandit
Resta saysCRUD maps the four basic operations to HTTP methods on a resource.

Create-Read-Update-Delete is the lifecycle of most data, and REST maps it cleanly: POST (create), GET (read), PUT/PATCH (update), DELETE (delete). Master this mapping and you can model the majority of an API's endpoints by rote — the rest is filtering, relationships, and special actions.

Power-ups you unlock

The 401 Bandit attacks — common mistakes

Boss battleWrite the full CRUD endpoint set for a /tasks resource.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>POST   /tasks     create
GET    /tasks/9   read
PATCH  /tasks/9   update
DELETE /tasks/9   delete</pre></body></html>
▶ Open the interactive comic issue
‹ Resources · Nouns Over VerbsPagination · Offset · Cursor · Keyset ›