representation as the request entity. PUT or POST HTTP verb when calling API endpoint which performs both UPDATE and INSERT? PUT For Updated- If instead the client uses a PUT request to correct the email, sending to the server all properties of user 1 along with the email, his intended effect will be achieved even if the request has to be re-sent later and user 1 has been modified in the meanwhile --- since the second PUT request will overwrite all changes since the first request. to null). doesn't make much sense on GET and POST, as it doesn't care about persistence). And left idempotency is the thing that matters here: if we patch a few keys of the resource, we want those keys to be same if we patch it again, and we don't care about the rest of the resource. This brings me to first question: PATCH is a relatively new verb (RFC introduced in March 2010), and it comes to solve the problem of "patching" or modifying a set of fields. In the meanwhile, another client has (erroneously) modified the zip of user 1. The entity you are supplying is complete (the entire entity). Two examples of REST operations are: (This definition is specifically designed to argue about PUT and POST, and e.g. The average Insurance Agent salary in the United States is $51,381 as of October 28, 2020, but the range typically falls between $46,927 and $57,961.Salary ranges can vary widely depending on many important factors, including education, certifications, additional skills, the number of years you have spent in your profession. It basically means that the result should be same, if we look at the applied keys. windows: 21 for any y: Res, g(g(y)) = g(y). which also helps prevent bad outcomes from collisions between two And when is it generated? The average salary for an Insurance Agent is $39,754. My final point is, that PATCH should not be globally idempotent, otherwise won't give you the desired effect. representation, but REST does not require representations to be What is DIFFERENT to what I've got previously! The disadvantage of PATCH is that you have to keep track on the view/screen side of what changed and have some intelligence to send only the parts that changed. rev 2020.11.11.37991, Sorry, we no longer support Internet Explorer, Stack Overflow works best with JavaScript enabled, Where developers & technologists share private knowledge with coworkers, Programming & related technical career opportunities, Recruit tech talent & build your employer brand, Reach developers & technologists worldwide, a) it's RFC 2616, not 2612. b) RFC 2616 has been obsoleted, the current spec of PUT is in, if it helps I've wrote an article on the PATCH vs PUT. before any response is received, then the client can establish a new REST: Updating Multiple Resources With One Request - Is it standard or to be avoided? In more accessible language, an idempotent PATCH could be defined as: After PATCHing a resource with a patch document, all subsequent PATCH calls to the same resource with the same patch document will not change the resource. origin server should be modified to produce a new version. { This sentence isn't quite correct: "But it is idempotent: whenever A goes in, B always comes out". Come to think of it, it’ll be odd having a lone door at a house address. Let x: Res a resource, and k = x.keys. (I'm assuming for the purposes of this question that the server doesn't have any specific required fields, and would allow this to happen... that may not be the case in reality.). Idempotent methods are distinguished because the request can be Not the server state, nor the server response, but the intended effect.