title: ETags and collections
body: <p>Many REST APIs provide the ability to search for resources.</p>
  
  <p>For example, resources of type A may be fetched using the following HTTP request:</p>
  
  <pre><code>GET /A?prop1={value1}&amp;prop2={value2}
  </code></pre>
  
  <p>I'm using optimistic locking and therefore would like to return a version for every returned resource of type A. Until now, I used the ETag header when fetching only one resource using its ID.</p>
  
  <p>Is there an HTTP way for returning version for multiple resources in the same response? If not, should I include the versions in the body?</p>
  
  <p>Thanks,
  Mickael</p>
  
  <hr>
  
  <p><strong>EDIT:</strong> I found on the web that the ETag is often generated by computing a hash of part of the reply. This approach fits well with my case since a hash of the returned collection will be computed. However, if the client decides to update one of the elements in the collection, which ETag should he put in the If-Match header? I'm thinking that including the ETags of the individual elements is the only solution...</p>