Learn VisualLearn API

Collection and Item Each Accept a Different Set of Operations

A collection URL like /users accepts GET to list every item and POST to create a new one. At creation time the new user doesn't exist yet, so it has no id — the client sends POST to /users, and the server picks the id when it creates the user and returns it in the response.

An item URL like /users/42 accepts GET to read that one item, PUT or PATCH to update it, and DELETE to remove it. POST on an item URL and PUT or DELETE on a collection URL aren't part of this mapping — /users has no id saying which single item to replace or delete, so PUT and DELETE there have no clear target.

GOAL

Match create, read, update, and delete operations to the right HTTP method and target — a collection URL or an item URL.

A client wants to delete the user with id 9. Which request fits?