I’m working on implmenenting ETag functionality for a RESTful service, and I’d like to be as close to the HTTP spec as possible. The spec however is not as clear as it probably should be. Specifically:
The If-Match header – what are it’s semantics for a GET request?
Presumably, a GET with the If-Match header will, if the value is matched with the value of the ETag – return the actual Resource with 200 OK (not 304).
If the value is not matched, a 412 Precondition Failed should be returned, along with the new value of the ETag and no content?
That’s correct, expect that the new value of the
ETagon a 412 response to aIf-Matchis nowhere required by the spec. You can omit it. It’s only recommended on a 304 response to aIf-None-Match. Perhaps that’s where your confusion was caused.