title: POST with Jersey client using APPLICATION_FORM_URLENCODED mediatype
body: <p>I have to post a <em>pojo</em> to a server that only accepts parameters via form data (<strong>MediaType.APPLICATION_FORM_URLENCODED</strong>). I know jersey client can convert the object to xml, json and other types but trying to convert to APPLICATION_FORM_URLENCODED gives an exception showing that no body writer for the specified types is available.</p>
  
  <p>Is there a way to serialize the object to be an application_form_urlencoded MultivaluedMap, or i have to manually take attribute by attribute to form the resultant MultivaluedMap? Creating an Adapter to use jersey serialization doesn't seem to me to be the appropriate solution according to the problem context.</p>
  
  <p><strong>Object to POST</strong></p>
  
  <pre><code>@XmlRootElement
  public class POSTableObject {
      private int a;
      private String b;
  
      public int getA() { return a; }
      public void setA(int a) { this.a = a; }
      public String getB() { return b; }
      public void setB(String b) { this.b = b; }
  }
  </code></pre>
  
  <p><strong>Post Action using Jersey client</strong></p>
  
  <pre><code>ClientResponse response = client.resource(url).type(MediaType.APPLICATION_FORM_URLENCODED).accept(MediaType.APPLICATION_JSON).post(ClientResponse.class, postableObject);
  </code></pre>