title: Using the jersey client to do a POST operation with request params and a request body
body: <p>I'm trying to figure how how to use the Jersey client to send both the request params and the request body of a POST operation.</p>
  
  <p>Currently I know how to do it both of those way individually, but not together.</p>
  
  <p>From here: <a href="https://stackoverflow.com/questions/2136119/using-the-jersey-client-to-do-a-post-operation">Using the Jersey client to do a POST operation</a></p>
  
  <p>I've gotten this for the request parms:</p>
  
  <pre><code>MultivaluedMap formData = new MultivaluedMapImpl();
  formData.add("name1", "val1");
  formData.add("name2", "val2");
  ClientResponse response = webResource.type("application/x-www-form-urlencoded").post(ClientResponse.class, formData);
  </code></pre>
  
  <p>And for the request body I can do the following:</p>
  
  <pre><code>String jsonObject ="... valid json object";
  webResource.type(MediaType.APPLICATION_JSON_TYPE).post(String.class, jsonObject);
  </code></pre>
  
  <p>How do I post both a request param with a request body?</p>
  
  <p>Thanks</p>