code: public static Header[] headUri(String uri) throws IOException {
          CloseableHttpClient c = newHttpClient(new URL(uri));
          HttpHead head = new HttpHead(uri);
          LOG.debug("HEAD {}", uri);
          CloseableHttpResponse res = c.execute(head, HttpClientContext.create());
          checkResponse(res);
          return res.getAllHeaders();
      }
docs: Gets the response headers of specified uri.
  
  @param uri http/https uri
  
  @return response headers
  
  @throws IOException in case of any IO related issue