Certain Clumio REST API resources use ETag and If-Match HTTP response headers to provide optimistic concurrency control when handling PUT and PATCH requests.
The ETag value is generated from the current state of the resource, and any updates to the resource changes the ETag value.
The "If-Match" request header uses the ETag value in its PUT and PATCH requests to validate whether the changes to the resource are made on the latest state of the resource. To achieve this requires the following assumptions and requirements:
- The GET request for the resource must return the ETag HTTP response header.
- When the client sends a PUT or PATCH request, the client must send the "If-Match" HTTP request header with the value of the ETag. If the "If-Match" header is not specified, an HTTP
403 Forbidden
status code is returned. - If the "If-Match" header value does not match the generated ETag value, an HTTP
412
status code is returned.