How to "store" the REST artifact does not create a new resource and a new URI?

The design of the REST API indicates that there are four resource archetypes: document, collection, storage, and controller.

The store does not create new resources; therefore, the repository never generates new URIs.

Example:

PUT /users/12245/favorites/boston-celtics 

The user added the Boston Celtics to his favorites list.

But how does this not create a new resource? and how does it not generate a new URI?

+4
source share
1 answer

The store does not create the resource on its own. A store user creates endpoints / URIs.

The contrast between the collection and the store

Collection A collection resource is a server-managed resource directory. Customers can offer new resources to add to the collection. However, the collection to choose to create a new resource or not. A collection resource selects what it wants to contain, and also decides the URI of each contained resource.

Store Vault is a customer-managed resource repository. A storage resource allows an API client to: insert resources, return them, and decide when to remove them.

+3
source

Source: https://habr.com/ru/post/1435117/


All Articles