HNHacker News
TopNewBestAskShowJobs

marcelocure

89 karma · joined June 28, 2015

submissionscomments
marcelocure··on REST Anti-patterns
right, POST is not supposed to be idempotent. However, if you do a PUT on it, you are updating a resource, closing an account may involve more processes than only updating the given resource. Ok, but why did I say it should be a POST even if POST is not supposed to be idempotent? In my point of view, POST should only be idempotent when creating resources, in this case we're acting in a resource, the /close is a process that happens on that resource (4402278), not a create/update/delete/retrieve. The best way to do it would be a POST in my opinion. Also, if we want to update only a piece of the resource, it should be a PATCH. PUT is supposed to update the whole resource.
marcelocure··on Choosing good names
The general idea was to show a simple exemple. But I really appreciate your point. Thanks