Jax-RS : extracting specific header from head call response?

148 Views Asked by At

I have the following code:

MultivaluedMap<String, Object> headers = requestBuilder.build("persons", queryParams).head().getHeaders();

//print all headers for trace
for(Object header : headers.keySet()){
  System.out.println(header);
 }

What is the most efficient way to extract one header: i.e. "count" from the above map of header responses?

1

There are 1 best solutions below

0
On BEST ANSWER

Get it from the map by the key name:

headers.get("count")