code: public Map<String, String> getResponseHeaders(){
          Collection<String> names  = RequestContext.getHttpResponse().getHeaderNames();
          Map<String, String> headers = new HashMap<>();
          for (String name : names) {
              headers.put(name, RequestContext.getHttpResponse().getHeader(name));
          }
          return headers;
      }
docs: Returns response headers
  
  @return map with response headers.