public <T> HttpResponse<T> httpRequest(String url, String method, HttpHeaders headers, Object requestBodyData,
                                                  TypeReference<T> responseFormat,
                                                  SecretKey sessionKey, String requestSignatureAlgorithm) {
        Objects.requireNonNull(url, "url must be non-null");
        Objects.requireNonNull(method, "method must be non-null");
        Objects.requireNonNull(responseFormat, "response format must be non-null");
        // Only try to load SSL configs if we have to (see KAFKA-14816)
        SslContextFactory.Client sslContextFactory = url.startsWith("https://")
                ? SSLUtils.createClientSideSslContextFactory(config)
                : null;
        HttpClient client = httpClient(sslContextFactory);
        client.setFollowRedirects(false);

        try {
            client.start();
        } catch (Exception e) {
            log.error("Failed to start RestClient: ", e);
            throw new ConnectRestException(Response.Status.INTERNAL_SERVER_ERROR, "Failed to start RestClient: " + e.getMessage(), e);
        }

        try {
            return httpRequest(client, url, method, headers, requestBodyData, responseFormat, sessionKey, requestSignatureAlgorithm);
        } finally {
            try {
                client.stop();
            } catch (Exception e) {
                log.error("Failed to stop HTTP client", e);
            }
        }
    }
Sends HTTP request to remote REST server

@param url                       HTTP connection will be established with this url, non-null.
@param method                    HTTP method ("GET", "POST", "PUT", etc.), non-null
@param headers                   HTTP headers from REST endpoint
@param requestBodyData           Object to serialize as JSON and send in the request body.
@param responseFormat            Expected format of the response to the HTTP request, non-null.
@param <T>                       The type of the deserialized response to the HTTP request.
@param sessionKey                The key to sign the request with (intended for internal requests only);
                                 may be null if the request doesn't need to be signed
@param requestSignatureAlgorithm The algorithm to sign the request with (intended for internal requests only);
                                 may be null if the request doesn't need to be signed
@return The deserialized response to the HTTP request, containing null if no data is expected or returned.
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/rest/RestClient.java