On Wed, May 30, 2012 at 2:12 PM, Dale McCrory <
dale.m...@gmail.com> wrote:
> In regard to the value of explicit-ness in API construction. The fact
> that PATCH is explicit for partials is notable in that behavior that
> is not explicit is the common cause of poorly written clients or ugly
> server side code. I've worked with APIs that put everything into a
> POST - partials, bulk, creates, and updates. It's not pretty,
> developer experience is really weak (both getting the proper
> implementation and the performance characteristics of client-side
> code).
I dont' think it should be HTTP's job to prevent people coming up with
poor designs.. where would you stop on that crusade? PATCH will not
solve that problem on its own.
> One of the values of REST is a small set of operations that can be
> tweaked, tuned, and optimized.
I agree, which is why diluting the protocol with virtually redundant
methods like PATCH is a problem.
> Using POST as a catch-all doesn't help
> with tweaking, tuning and optimizing operations because the client use
> cases are so broad (you may as well go with SOAP :) ).
Tweaking, tuning, and optimizing operations at the scale of the web is
about intermediary processing, if the operations themselves are not
suitable candidates for that then they should not be part of HTTP.
> I think you are
> still advocating for the use of PUT, but I would say that if you say
> PATCH is irrelevant, PUT can easily fall into the same basket.
If you want to follow the letter of the law don't use PUT for partial
updates (if you want to make the most of the protocol in practice, and
your updates are idempotent, then do use PUT).
PUT is fully idempotent and recognized as such across the web - PATCH
isn't. An idempotent request can be retried a number of times and
produce the same outcome, and this means that code issuing idempotent
requests (such as PUT) can act as an intermediary and re-issue failed
automatically. So PUT enables an intermediary mechanism that is
clearly useful, particularly on choppy networks such as 3g. I'm not
aware of any similar use for PATCH
Cheers,
M