I am trying to use the ETag preconditions using the Request object but this doesn't seem to work.
I have the following code in one of my resource methods:
EntityTag etag = new EntityTag(String.valueOf(myEntity.hashCode()));
ResponseBuilder builder = request.evaluatePreconditions(etag);
Now, the evaluatePreconditions(...) method always returns null whether I send a request with no ETag header at all as in:
User-Agent: Apache-HttpClient/4.2.3 (java 1.5)
Or whether I send an ETag header with a random value, as in:
Or with a header set to the expected value (e.g. the hash code of my entity)
Is this a bug or am I missing something?
Retrieving data ...