ETag support to prevent mid-air collisions
eTag
property, which can later on be sent back to the API
when performing an update on said data.
The API will then compare that ETag with the one on the repository: if they don’t
match it means data was updated by another process and the server will abort the update and respond with
412 - Precondition Failed; otherwise it will proceed
updating the resource.
To send the ETag to an update
endpoint, you can use the If-Match
HTTP header, or include an eTag
property
on the request body. The header takes precedence if both are informed.
The SDK implements this automatically, as long as the data obtained from a get
or list
function is updated and sent to
the respective update
function. Example: