DEV Community

Ali Abbas
Ali Abbas

Posted on

Explain PUT and PATCH requests like I'm five

  • PUT

Top comments (2)

eimihar profile image
Rahimie Ahmad

In a scenario where they're both used to repair a toy,


PUT request is like a father buying an exact whole new toy to replace his child's (server) broken toy, except that everytime the toy needs a repair, the father has to buy the exact similar toy.


Patch is like a father only having to buy parts of the exact toy.


I don't remember having UPDATE verb in restful.

My Conclusion

The benefit of PUT over PATCH is just about giving the whole updated object/resource. This'll be a good case if you don't mess or deconstruct the object that much.

The benefit of PATCH over PUT is when you have many client controller working on ONLY several fields of one particular object/resource, and you don't want to waste time reconstruct the object details that much. Or you just want to update particular fields, without worrying about the complete object detail (or messing up with it), the client validation etc.

realabbas profile image
Ali Abbas

Great Explaination DevπŸ‘πŸ––