private HttpIOExceptionHandler createBackOffRetryHandler() {
    return new HttpBackOffIOExceptionHandler(new ExponentialBackOff()) {
      @Override
      public boolean handleIOException(HttpRequest request, boolean supportsRetry)
          throws IOException {
        String requestUrl = request.getRequestMethod() + " " + request.getUrl();
        if (super.handleIOException(request, supportsRetry)) {
          logger.accept(LogEvent.warn(requestUrl + " failed and will be retried"));
          return true;
        }
        logger.accept(LogEvent.warn(requestUrl + " failed and will NOT be retried"));
        return false;
      }
    };
  }
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