code: public HttpUriRequest getHttpRequest(J4pRequest pRequest, String pPreferredMethod,
                                           Map<J4pQueryParameter, String> pProcessingOptions) throws UnsupportedEncodingException, URISyntaxException {
          String method = pPreferredMethod;
          if (method == null) {
              method = pRequest.getPreferredHttpMethod();
          }
          if (method == null) {
              method = doUseProxy(pRequest) ? HttpPost.METHOD_NAME : HttpGet.METHOD_NAME;
          }
          String queryParams = prepareQueryParameters(pProcessingOptions);
  
          // GET request
          if (method.equals(HttpGet.METHOD_NAME)) {
              if (doUseProxy(pRequest)) {
                  throw new IllegalArgumentException("Proxy mode can only be used with POST requests");
              }
              List<String> parts = pRequest.getRequestParts();
              // If parts == null the request decides, that POST *must* be used
              if (parts != null) {
                  String base = prepareBaseUrl(j4pServerUrl);
                  StringBuilder requestPath = new StringBuilder(base);
                  requestPath.append(pRequest.getType().getValue());
                  for (String p : parts) {
                      requestPath.append("/");
                      requestPath.append(escape(p));
                  }
                  return new HttpGet(createRequestURI(requestPath.toString(),queryParams));
              }
          }
  
          // We are using a post method as fallback
          JSONObject requestContent = getJsonRequestContent(pRequest);
          HttpPost postReq = new HttpPost(createRequestURI(j4pServerUrl.getPath(),queryParams));
          postReq.setEntity(new StringEntity(requestContent.toJSONString(),"utf-8"));
          return postReq;
      }
docs: Get the HttpRequest for executing the given single request
  
  @param pRequest request to convert
  @param pPreferredMethod HTTP method preferred
  @param pProcessingOptions optional map of processiong options
  @return the request used with HttpClient to obtain the result.