public static <T> HttpResponse<T> httpRequest(Logger logger, String url, String method,
            Object requestBodyData, TypeReference<T> responseFormat, int maxTries)
            throws IOException, InterruptedException {
        IOException exc = null;
        for (int tries = 0; tries < maxTries; tries++) {
            if (tries > 0) {
                Thread.sleep(tries > 1 ? 10 : 2);
            }
            try {
                return httpRequest(logger, url, method, requestBodyData, responseFormat);
            } catch (IOException e) {
                logger.info("{} {}: error: {}", method, url, e.getMessage());
                exc = e;
            }
        }
        throw exc;
    }
Make an HTTP request with retries.

@param logger            The logger to use.
@param url               HTTP connection will be established with this url.
@param method            HTTP method ("GET", "POST", "PUT", etc.)
@param requestBodyData   Object to serialize as JSON and send in the request body.
@param responseFormat    Expected format of the response to the HTTP request.
@param <T>               The type of the deserialized response to the HTTP request.
@return The deserialized response to the HTTP request, or null if no data is expected.
trogdor/src/main/java/org/apache/kafka/trogdor/rest/JsonRestServer.java