How to handle "Optimistic Locking" on a collection with ETag headers?

by maximedupre   Last Updated October 04, 2018 23:05 PM - source

Consider endpoint /projects that returns a list of projects with the following headers:

HTTP/1.1 200 OK
Etag: "superEtag"

The etag value represents a hash of the entire collection and it does not allow a client to update a single resource e.g. /projects/1.

Fetching the resources individually makes no sense, so how can I handle optimistic locking with a collection?

Related Questions

What to do when “Optimistic Locking” doesn't work?

Updated October 05, 2018 18:05 PM

design java library to make HTTP request

Updated February 06, 2019 11:05 AM

How to handle deadlocks (with a REST API)?

Updated August 27, 2018 16:05 PM

REST API acceptable design flexibility

Updated February 13, 2019 14:05 PM