问题
REST API design indicates there are four resources archetypes: document, collection, store and controller.
Store do not create new resources; therefore a store never generates new URIs.
An example:
PUT /users/12245/favorites/boston-celtics
A user added Boston Celtics to his favorites list.
But how that isn't creating a new resource ? and how it isnt generating a new URI?
回答1:
A store does not create a resource on its own. The user of the store creates endpoints / URIs.
The contrast is between a Collection and a Store
Collection A collection resource is a server-managed directory of resources. Clients may propose new resources to be added to a collection. However, it is up to the collection to choose to create a new resource, or not. A collection resource chooses what it wants to contain and also decides the URIs of each contained resource.
Store A store is a client-managed resource repository. A store resource lets an API client: put resources in, get them back out, and decide when to delete them.
来源:https://stackoverflow.com/questions/12500248/how-store-rest-archetype-isnt-creating-a-new-resource-and-a-new-uri