An Interest In:
Web News this Week
- April 20, 2024
- April 19, 2024
- April 18, 2024
- April 17, 2024
- April 16, 2024
- April 15, 2024
- April 14, 2024
The Difference between HTTP PATCH and PUT methods
PUT and PATCH might be doing the same thing of updating a resource at a location, but they do it differently
What is PUT?
PUT is a method of modifying resource where the client sends data that updates the entire resource. It is used to set an entitys information completely. PUT is similar to POST in that it can create resources, but it does so when there is a defined URI. PUT overwrites the entire entity if it already exists, and creates a new resource if it doesnt exist.
For example, when you want to change the first name of a person in a database, you need to send the entire resource when making a PUT request.
Unlike PUT, PATCH applies a partial update to the resource.
This means that you are only required to send the data that you want to update, and it wont affect or change anything else. So if you want to update the first name on a database, you will only be required to send the first parameter; the first name.
Original Link: https://dev.to/espoirndayishimiye/the-difference-between-http-patch-and-put-methods-3pa8
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To