Introduction

Let's discuss how these approaches differ from one another.

PUT

The PUT method offers a technique to edit resources by delivering data that updates the entire resource.

PUT will completely swap out a resource if it already exists and creates the resource if it doesn't exist.

Imagine you wish to update the user using an API. We transmit all of the resource's attributes along with the PUT request.

PUT API request consumes more bandwidth than PATCH because we send all of the resource's contents using it.

PUT Request payload{
    "email":"[email protected]",
    "firstname":"qwerty",
    "lastname":"test",
    "pipeline_url":"https://test.com/pipeline"
}

PATCH

We're sending an email and a pipeline_url.

PATCH Request payload{
    "email":"[email protected]",
    "pipeline_url":"https://test.com/pipeline"
}

PATCH consumes less bandwidth than PUT because we only send information that needs to be updated.