3 ms·
>That POST is actually meant for updates and PUT is meant for new entities This is definitely the other way around.
by greenhatman 10y ago
>That POST is actually meant for updates and PUT is meant for new entities
This is definitely the other way around.
- bryanrasmussen 10y agohttp://stackoverflow.com/questions/630453/put-vs-post-in-rest http://stackoverflow.com/questions/630453/put-vs-post-in-res...
- TeMPOraL 10y agoLike usual, the accepted answer is somewhat correct but not quite the best. Idempotence is the thing from which correct understanding of PUT and POST is derived.
- jholman 10y agoAbsolutely not. The fact that the request-URI is to be the new home of the entity being PUT is the thing from which correct understanding of PUT is derived. Idempotence is a trivial consequence of that (so not necessary in its own right), and is not sufficient. Read the RFCs.
- jholman 10y agoIt is definitely not "definitely the other way around". POST is meant for anything and everything, absolutely including updates. PUT is meant for writing-or-overwriting a complete or partial resource, at a URI that is the Request URI. In practice, for most applications, this makes PUT impractical for new entities (because the requester cannot know the correct URI for the new resource), but in some applications it can make sense, and either way there's more to it than you assert.