HTTP PATCH verb with specific header can be used for 3 different Update/Create scenarios 1. Upsert, 2. Update Only, and 3. Create Only

PATCH <serviceroot>/api/data/v8.0/calendars(id of the record)

 

Header Behaviour
Absence of both If-Match and If-None-Match header Upsert

if record already exists, updates it else Creates it.

If-Match: “*” Update Only

Create does not happen because If-Match:”*” fails if the record does not exist

If-None-Match : “*” Create Only

Update does not happen because If-None-Match:”*” fails if the record already exists

Leave a Reply

Your email address will not be published. Required fields are marked *