Currently developing a REST API, with a suite of endpoint functions which update the "state" of a particular resource.
I am using POST to create the initial resource and then updating the state using PUT - Is PUT the correct method to be using?
The state updates are being logged in a journal, so to avoid someone updating the state with the same value multiple times, I wish to put some business logic in that avoid two repeat entries of the same state. If someone attempts to call the same function twice, lets say "CancelResource()" - should I return a 200 success on the second call, and just not make an update, or would it be better to send some sort of error response?
I was considering returning a 405 "method not allowed" but this feels a little harsh. I also don't know that 200 would be very useful for the client.