Hi Guy

On 15/01/12 16:01, Guy Pardon wrote:
Hi,

I want to inspect eTag headers in responses from a REST service, to set them on 
later PUT requests. Any guidelines on how to do this with the CXF WebClient API?

You can do something like this:

Book book = webClient.get(Book.class);
Object header = webClient.getResponse().getMetadata().getFirst("ETag");
if (header != null) {
   EntityTag eTag = EntityTag.fromString(header);
   ...
}

In JAX-RS 2.0 it will be easier to deal with Response headers.

and then

webClient.header("If-None-Match", eTag);
etc...

Cheers, Sergey



Thanks
Guy

Reply via email to