I.e. we have a system with entities (requests) from one type of users. There are another type of users, which can accept or decline these entities. What should I use (PUT or POST) to accept/decline concrete request for concrete user? As I understand, POST should create a new resource, but we don't create any new resource. PUT should update a resource, but in our case we don't update a resource, we make some actions about resource for concrete user. What should be better to use, PUT or POST in this case?
Asked
Active
Viewed 367 times
0
-
There is no absolute in terms of verbs usage, but the most common case I've come across for HTTP verbs for custom actions is to use POST on a named sub-resource (i.e. POST /users/{some-identifier}/accept, POST /users/{some-identifier}/decline). – Simon Belanger Mar 20 '16 at 16:48
-
Possible duplicate of [PUT vs POST in REST](http://stackoverflow.com/questions/630453/put-vs-post-in-rest) – Luca Ghersi Mar 21 '16 at 08:16
-
1it kinda sounds like you're updating the state of an entity (something like submitted -> accepted/declined), so perhaps a PUT is actually what you're looking for – Alexandru Marculescu May 31 '16 at 06:30