code: public static Response forwardFormMultipartPost(URI uri, HttpServletRequest request, boolean forwardHeaders)
          throws URISyntaxException, HttpException, IllegalStateException, IOException, ServletException {
          Header[] headersToForward = null;
  
          if (request != null && forwardHeaders) {
              headersToForward = HttpUtil.getHeadersFromRequest(request);
          }
  
          // remove content headers as http client lib will care about this
          // when entity is set on the httpPost instance in the postMultiPart method
          headersToForward = removeHeaders(headersToForward, new String[]{"content-length", "content-type"});
  
          Collection<Part> parts = request.getParts();
  
          return HttpUtil.postMultiPart(uri, parts, headersToForward);
      }
docs: Forward FormMultipartPost (HTTP POST) to uri based on given request
  
  @param uri            uri The URI to forward to.
  @param request        The original {@link HttpServletRequest}
  @param forwardHeaders Should headers of request should be forwarded
  @return The HTTP response as Response object.
  @throws URISyntaxException
  @throws HttpException
  @throws IllegalStateException
  @throws IOException
  @throws ServletException