I know this is probably the gazillion'th time a thread has been started about this, but I cannot find an answer to my specific question.
We have an internal discussion whether or not to use PUT for updates in our rest service. We have agreed that using PUT has the preference. However, PUT needs to be idempotent. Does this mean that we should mix POST and PUT verbs for different update routes according to their idempotence?
As a concrete example. We have an update route, that updates, let's say a "car". To this update route, you can (among other things) pass a hyperlink. This hyperlink will get an id when saved, and will be linked to the updated car. However, every time you update on the car, the generated id of the hyperlink will be different. Does this mean the update is no longer idempotent? Even when the actual target of the hyperlink is the same?
If so, we should use the POST verb for this update, instead of the PUT verb. However, we have many other update routes that ARE idempotent. Should they remain PUT? I believe this can become very confusing for the consumer of the service.
In short:
I've had some discussion with people outside of stackoverflow. We came to the following conclusion:
Ideally we would alter our code (from the example in the initial questions) to make sure that the id's of the hyperlinks don't change. In this case there would be no discussion about using PUT or POST. If we cannot do this, we will write a "disclaimer" in the API readme to make sure to let people know some PUT routes are not really idempotent