PUT or POST: The REST of the Story
jcalcote.wordpress.com
jcalcote.wordpress.com
After that discussion, a more realistic mapping would seem to be:
* Create = PUT iff you are sending the full content of the specified resource (URL).
* Create = POST if you are sending a command to the server to create a subordinate of the specified resource, using some server-side algorithm.
* Retrieve = GET.
* Update = PUT iff you are updating the full content of the specified resource.
* Update = POST if you are requesting the server to update one or more subordinates of the specified resource.
* Delete = DELETE.
I am not sure about "Update = POST if you are requesting the server to update one or more subordinates of the specified resource" - seems to me that if the subordinate updates are idempotent - then this can be PUT, why not. But going a bit further - of all the server side algorithms used for Create calls the most used one is computing the primary keys for auto increment columns. So if you are not using some special database functions - a Create needs to be POST if the primary key is auto-increment and can be PUT otherwise.
GET == read
PUT == (over)write
DELETE == delete
POST == invoke (custom processing)
The effect of a POST then comes down to the definition of that "custom" processing. This is outside the scope of HTTP; don't conflate the two.