3 ms·
By definition, GET, HEAD, PUT and DELETE are idempotent: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.
by rmccue 14y ago
By definition, GET, HEAD, PUT and DELETE are idempotent: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
I personally agree with the parent. PATCH should be idempotent; overwriting values with new values is idempotent and that should be written into the spec rather than avoiding it in favour of things like writing logs (which IMHO should be a POST).
- quesera 14y agoYes, but GET, HEAD, PUT, and DELETE do very different things. You can write an idempotent PATCH mechanism. If that's what you want, you can do it. You control the server, so you can restrict the accepted patch formats to idempotent ones. Adding an HTTP verb doesn't make patching magically happen. Someone has to write the logic, either you or your framework authors. Obviously there will be different mechanisms and some will be effectively idempotent. Again, not in the mathematical or functional programming sense, but in the colloquial DBA sense, at least. Limiting HTTP PATCH at the protocol level would be a huge mistake, I think. None of this should be construed to mean that I see a clear need for a new HTTP verb, though.