docs: @FFDCIgnore(URISyntaxException.class)
      @Override
      public void prepare(Message message) throws IOException {
          // This call can possibly change the conduit endpoint address and
          // protocol from the default set in EndpointInfo that is associated
          // with the Conduit.
          Address currentAddress;
          try {
              currentAddress = setupAddress(message);
          } catch (URISyntaxException e) {
              throw new IOException(e);
          }
  
          // The need to cache the request is off by default
          boolean needToCacheRequest = false;
  
          HTTPClientPolicy csPolicy = getClient(message);
          setupConnection(message, currentAddress, csPolicy);
  
          // If the HTTP_REQUEST_METHOD is not set, the default is "POST".
          String httpRequestMethod =
              (String)message.get(Message.HTTP_REQUEST_METHOD);
          if (httpRequestMethod == null) {
              httpRequestMethod = "POST";
              message.put(Message.HTTP_REQUEST_METHOD, "POST");
          }
  
          boolean isChunking = false;
          int chunkThreshold = 0;
          final AuthorizationPolicy effectiveAuthPolicy = getEffectiveAuthPolicy(message);
          if (this.authSupplier == null) {
              this.authSupplier = createAuthSupplier(effectiveAuthPolicy.getAuthorizationType());
          }
  
          if (this.proxyAuthSupplier == null) {
              this.proxyAuthSupplier = createAuthSupplier(proxyAuthorizationPolicy.getAuthorizationType());
          }
  
          if (this.authSupplier.requiresRequestCaching()) {
              needToCacheRequest = true;
              isChunking = false;
              LOG.log(Level.FINE,
                      "Auth Supplier, but no Preemptive User Pass or Digest auth (nonce may be stale)"
                      + " We must cache request.");
          }
          if (csPolicy.isAutoRedirect()) {
              needToCacheRequest = true;
              LOG.log(Level.FINE, "AutoRedirect is turned on.");
          }
          if (csPolicy.getMaxRetransmits() > 0) {
              needToCacheRequest = true;
              LOG.log(Level.FINE, "MaxRetransmits is set > 0.");
          }
          // DELETE does not work and empty PUTs cause misleading exceptions
          // if chunking is enabled
          // TODO : ensure chunking can be enabled for non-empty PUTs - if requested
          if (csPolicy.isAllowChunking()
              && isChunkingSupported(message, httpRequestMethod)) {
              //TODO: The chunking mode be configured or at least some
              // documented client constant.
              //use -1 and allow the URL connection to pick a default value
              isChunking = true;
              chunkThreshold = csPolicy.getChunkingThreshold();
          }
          cookies.writeToMessageHeaders(message);
  
          // The trust decision is relegated to after the "flushing" of the
          // request headers.
  
  
  
          if (certConstraints != null) {
              message.put(CertConstraints.class.getName(), certConstraints);
              message.getInterceptorChain().add(CertConstraintsInterceptor.INSTANCE);
          }
  
          setHeadersByAuthorizationPolicy(message, currentAddress.getURI());
          new Headers(message).setFromClientPolicy(getClient(message));
          // Liberty change start
          // set the OutputStream on the ProxyOutputStream
          ProxyOutputStream pos = message.getContent(ProxyOutputStream.class);
          if (pos != null && message.getContent(OutputStream.class) != null) {
              OutputStream nos = createOutputStream(message,
                                                    needToCacheRequest,
                                                    isChunking,
                                                    chunkThreshold);
              pos.setWrappedOutputStream(nos);
          } else {
              message.setContent(OutputStream.class,
                                 createOutputStream(message,
                                                    needToCacheRequest,
                                                    isChunking,
                                                    chunkThreshold));
          }
          // Liberty change end
          // We are now "ready" to "send" the message.
      }