3 ms·
POST doesn't have to create a resource; it can also be used to annotate existing resources. The main problem with using PUT is that PUT is supposed to be idemp
by pdonis 12y ago
POST doesn't have to create a resource; it can also be used to annotate existing resources.
The main problem with using PUT is that PUT is supposed to be idempotent; the result of two PUTs with the same content should be the same as the result of a single PUT with that content. But two PUTs to honk the horn would honk the horn twice, not once.
Since we're all being pedantic about HTTP methods here, we should have a link to RFC 2616 :)
http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
- noonespecial 12y agoAhh. Good point. I was considering PUTting the horn into the honking state vs POSTing horn honks for execution. In the first case, 2 PUT honks would just result in a honking car, in the second, 2 POSTs would get you 2 "honks" whatever those are defined to be. I guess I was thinking of the idempotent "panic" button on my cars key fob.
- deleted 12y ago[deleted]
- daurnimator 12y agoActually it's 7231 now ;) http://tools.ietf.org/html/rfc7231#section-4 http://tools.ietf.org/html/rfc7231#section-4