Re:PUT vs POST in REST
by yesbabyyes on Sunday October 23, 2011 @08:30AM
(#3145954)
It's common to use POST for creation and PUT for updates. PUT, as GET, should be idempotent.
[ Parent
| on HN ]
DELETE is idempotent as well.
GET and HEAD are not really "potent" as they don't cause state to change on the server (or at least shouldn't). So I usually prefer saying GET and HEAD are "safe".
The difference between safe and idempotent is:
- using an idempotent verb 0 or 1 times will have a different end state on the server.
- using a safe verb 0 or 1 times will have the same end state on the server.