I've been pondering this for a while now but can't wrap it around my head. Say I have a tasking system exposed through REST. Tasks have their own life cycle e.g.:
CREATED -> ACTIVE -> PROCESSING -> CLOSED
| | |
| |-->ESCALATED-->|
|
--> DISMISSED
Now with POST I create the task by providing all the information in the body payload.
But now I only need to change the state of the task and maybe add a comment. So in all theory PUT is the way to go - it is updating a resource. But here is the thing:
PUT: /tasks/{taskId}?action=activate Seems legit URI however the action already has a request param that can be used to change the state of a resource - what about the PUT payload ? Is it intuitive for the user of this endpoint to send requests with 0 length message ?
UPDATE:
Sorry for my bad English as well. What I mean - is it a good practice to change the state of a resource by PUT request ONLY using URI parameter, without BODY (Content-Lenght:0) hence the URI: /tasks/32/?action=CLOSED to change "Task" state from PROCESSING to CLOSED.
If this is a bad practice approach - what approach is considered better practice ?