code: public WellRestedResponse submitRequest(Request request, HttpEntity httpEntity, List<Header> headers) {
          try {
              if (httpEntity != null) {
                  request.body(httpEntity);
              }
              if (headers != null && !headers.isEmpty()) {
                  headers.forEach(request::addHeader);
              }
              if (this.globalHeaders != null && !this.globalHeaders.isEmpty()) {
                  this.globalHeaders.forEach(request::addHeader);
              }
              if (this.proxy != null) {
                  request.viaProxy(proxy);
              }
              setRequestTimeout(request);
              HttpResponse httpResponse;
              if (credentials != null) {
                  Executor executor;
                  if (disableCookiesForAuthRequests) {
                      executor = Executor.newInstance(internalStatelessHttpClient);
                      executor.clearCookies();
                      executor.clearAuth();
                  } else {
                      executor = Executor.newInstance();
                  }
  
                  if (uri.getPort() > 0) {
                      executor.authPreemptive(uri.getHost() + ":" + uri.getPort());
                  } else {
                      executor.authPreemptive(uri.getHost());
                  }
  
                  executor.auth(credentials);
                  httpResponse = executor.execute(request).returnResponse();
              } else {
                  httpResponse = request.execute().returnResponse();
              }
              return WellRestedUtil.buildWellRestedResponse(httpResponse, uri.toString());
          } catch (ConnectTimeoutException cte) {
              log.error("Connection timeout for request: {}", request.toString(), cte);
              return WellRestedUtil.buildConnectionTimeoutWellRestedResponse(uri.toString());
          } catch (SocketTimeoutException ste) {
              log.error("Socket timeout for request: {}", request.toString(), ste);
              return WellRestedUtil.buildSocketTimeoutWellRestedResponse(uri.toString());
          } catch (IOException ex) {
              log.error("Error occurred after executing the request to: {}", uri.toString(), ex);
          }
          return WellRestedUtil.buildErrorWellRestedResponse(uri.toString());
      }
docs: ******************** GENERAL ******************************************************************