PUT
If I had to change my firstname then send PUT request for Update:
{ “first”: “Nazmul”, “last”: “hasan” } So, here in order to update the first name we need to send all the parameters of the data again.
PATCH:
Patch request says that we would only send the data that we need to modify without modifying or effecting other parts of the data. Ex: if we need to update only the first name, we pass only the first name.
PUT is for complete entity replacement whereas PATCH is to partially update the entity.
put method idempotent. means if you send a request multiple time still response will be the same.
use PUT method for complete replcement of the resouce.
Patch method is partially idempotent. with each request you may get different response.
Use PUT for partial update
PUT is a full update. PATCH is partial update.