code: protected Map<String, String> getHeaders(HttpResponse resp) {
      final Map<String, String> headersAndValues = new HashMap<String, String>();
  
      final Header[] httpHeaders = resp.getAllHeaders();
      for (Header header : httpHeaders) {
        headersAndValues.put(header.getName(), header.getValue());
      }
      return headersAndValues;
    }
docs: Get the headers from the response.
  
  @param resp the response
  @return the headers as a key/value map.