docs: private HttpURLConnection openConnection(String uri, String method) {
          for (String host : hosts) {
              try {
                  URL templateUrl = new URL("http://" + host  + uri);
                  HttpURLConnection connection = ( HttpURLConnection ) templateUrl.openConnection();
                  connection.setRequestMethod(method);
                  connection.setConnectTimeout(timeout);
                  connection.setUseCaches(false);
                  if (method.equalsIgnoreCase("POST") || method.equalsIgnoreCase("PUT")) {
                      connection.setDoOutput(true);
                  }
                  connection.connect();
  
                  return connection;
              } catch (IOException e) {
                  LOGGER.error("Error connecting to {}: {}", host, e);
              }
          }
  
          return null;
      }