Tuesday, February 15, 2022

OIC - Rest HTTP Verb Put vs Patch

Following HTTP verbs are available:

GET: Retrieves information. If you select this option, you can not configure a request payload for this endpoint.

PUT: Updates information.

POST: Creates information.

DELETE: Deletes information. If you select this option, you can not configure a request payload for this endpoint.

PATCH: Partially updates existing resources. The patch verb does not work with a non-SSL rest service.

PUT vs PATCH:

The HTTP PATCH method offers a way to apply partial updates to resources. As a result, clients need to send only the differences in their request.

Where as, HTTP PUT method replaces or updates a resource entirely.

For example, /Users >>

{"User":"abc","Email":"abc@domain.com"}

PUT: It includes all parameters 

PUT /Users/1

{

"User":"cde",

"Email": "cde@gmail.com"

}

PATCH: It includes the one to be updated.

PATCH /Users/1

{

"Email":"cde@gmail.com"

}




No comments:

Post a Comment

Featured Post

11g to 12c OSB projects migration points

1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper:   File⇾Import⇾Service Bus Resources⇾ Se...