code: private HttpUriRequest buildApacheRequest(ClientRequest jerseyRequest) {
          final RequestBuilder builder = RequestBuilder
                  .create(jerseyRequest.getMethod())
                  .setUri(jerseyRequest.getUri())
                  .setEntity(getHttpEntity(jerseyRequest));
          for (String headerName : jerseyRequest.getHeaders().keySet()) {
              builder.addHeader(headerName, jerseyRequest.getHeaderString(headerName));
          }
  
          final Optional<RequestConfig> requestConfig = addJerseyRequestConfig(jerseyRequest);
          requestConfig.ifPresent(builder::setConfig);
  
          return builder.build();
      }
docs: Build a new Apache's {@link org.apache.http.client.methods.HttpUriRequest}
  from Jersey's {@link org.glassfish.jersey.client.ClientRequest}
  <p>
  Convert a method, URI, body, headers and override a user-agent if necessary
  </p>
  
  @param jerseyRequest representation of an HTTP request in Jersey
  @return a new {@link org.apache.http.client.methods.HttpUriRequest}