Reputation: 33235
My resource URL looks like this: /container/:id
I need an API to append items to a container, so I come up with something like /container/:id/items
, now what should be the verb? POST?
Upvotes: 1
Views: 195
Reputation: 43354
Yes POST is correct here. It is used when creating new resources. An item in a container is a resource.
Say your container is a chat, and items are chat messages,
POST to /chat/:id/messages
makes perfect sense.
Upvotes: 2