DEV Community

loading...

Discussion on: HTTP Methods and why you should be using them on your API

Collapse
ankitverma31 profile image
Ankit Verma

Can you explain the difference between PUT and PATCH! As both modify the resource, what's the exact difference?

Collapse
rafaelcpalmeida profile image
Rafael Almeida Author

Sure!

You should use PUT if you wish to update a resource entirely, like a User. I.e.: Update the whole user object. If you just want to update the username or the password you should use PATH.

Is this clear?