private Pair<Integer, String> getUrlContent(URL url) throws Exception {
    try (CloseableHttpClient client =
      createHttpClient(UserGroupInformation.getCurrentUser().getUserName())) {
      CloseableHttpResponse resp = client.execute(new HttpGet(url.toURI()));
      int code = resp.getStatusLine().getStatusCode();
      if (code == HttpURLConnection.HTTP_OK) {
        return new Pair<>(code, EntityUtils.toString(resp.getEntity()));
      }
      return new Pair<>(code, null);
    }
  }
Retrieves the content of the specified URL. The content will only be returned if the status
code for the operation was HTTP 200/OK.
hbase-server/src/test/java/org/apache/hadoop/hbase/http/TestInfoServersACL.java