private Response call(
      String httpMethod,
      URL url,
      Request request,
      HttpTransport httpTransport,
      boolean retryOnIoException) // See https://github.com/GoogleContainerTools/jib/issues/3424
      throws IOException {
    boolean clearAuthorization = !isHttpsProtocol(url) && !sendAuthorizationOverHttp;

    HttpHeaders requestHeaders =
        clearAuthorization
            ? request.getHeaders().clone().setAuthorization((String) null) // deep clone implemented
            : request.getHeaders();

    HttpRequest httpRequest =
        httpTransport
            .createRequestFactory()
            .buildRequest(httpMethod, new GenericUrl(url), request.getHttpContent())
            .setUseRawRedirectUrls(true)
            .setHeaders(requestHeaders);
    if (enableRetry && retryOnIoException) {
      httpRequest.setIOExceptionHandler(createBackOffRetryHandler());
    }
    if (request.getHttpTimeout() != null) {
      httpRequest.setConnectTimeout(request.getHttpTimeout());
      httpRequest.setReadTimeout(request.getHttpTimeout());
    }

    try {
      Response response = new Response(httpRequest.execute());
      synchronized (responsesCreated) {
        responsesCreated.add(response);
      }
      return response;
    } catch (HttpResponseException ex) {
      throw new ResponseException(ex, clearAuthorization);
    }
  }
Sends the request.

@param httpMethod the HTTP request method
@param url endpoint URL
@param request the request to send
@return the response to the sent request
@throws IOException if building the HTTP request fails.
jib-core/src/main/java/com/google/cloud/tools/jib/http/FailoverHttpClient.java