3 ms·
They're different things, just like eating and drinking are different things. I don't really know what Rails is doing with them, but it's a really simple reason
by rue 15y ago
They're different things, just like eating and drinking are different things. I don't really know what Rails is doing with them, but it's a really simple reason at the HTTP scope.
PUT is A) idempotent (meaning that repeated operations have the same result), and B) always replaces the entire resource (and by implication should contain the entire new resource).
PATCH is A) not idempotent (meaning that repeated invocations could have different results), and B) affects part or all of the resource.
So, an immediately obvious benefit[1] is that PATCH requests are potentially much lighter-weight.
[1] Aside from conceptual clarity which I frankly cannot fathom reasons for arguing against, yet many do…