Idempotent PUT in a concurrent environment
问题 Context I have a REST API where multiple clients (applications) can update the state of a resource with PUT. For the example, this resource is a lamp that you can turn ON or OFF . This resource is also automatically updated by the system when it detects that an electricity failure has occurs, leading to have a lamp in a BROKEN state. I want to made the distinction between BROKEN and OFF , a lamp in BROKEN can not be turn ON ! Problem I use PUT method to do this, something like PUT http:/