title: returned a response status of 415 Unsupported Media Type REST client
body: <p>I want to make a POST request to REST webservice and I want to pass <strong>customer java object with the POST request</strong>. But response shows 415 error code Unsupported Media type.<br><b> My REST Client</b></p>
  
  <pre><code>Client client = Client.create();
  WebResource resource = client.resource("http://localhost:8080/cthix/rest/v1/m2");
  
  Customer cust = new Customer();
  cust.setId(101L);
  ObjectMapper mapper = new ObjectMapper();
  String jsonCustomer = mapper.writeValueAsString(cust);
  
  ClientResponse restResponse = resource.accept("application/json").
                    post(ClientResponse.class,jsonCustomer);
  
                      System.out.println(restResponse.getStatus());
                      if(restResponse.getStatus()==200){
                          String output = restResponse.getEntity(String.class);
                          PrintWriter pw = response.getWriter();
                          pw.print(output);
  
                          pw.flush();
                          pw.close();
                      }
  </code></pre>
  
  <p><strong>My REST SERVICE:</strong></p>
  
  <pre><code>@Path(value = "/v1")
  public class V1_status {
      @Path("/m2")
      @POST
      @Produces(MediaType.APPLICATION_JSON)
      @Consumes(MediaType.APPLICATION_JSON)
      public Customer returnCustomerDetails(Customer customer){
          Set&lt;Integer&gt; phones = new HashSet&lt;Integer&gt;();
          phones.add(123424541);
          phones.add(123432123);
  
          List hobbies= new ArrayList();
          hobbies.add("Swimming");
          hobbies.add("coding");;
  
          customer.setHobbies(hobbies);
          customer.setPhones(phones);
          customer.setCity("Noida");
          customer.setName("abhishek");
          return customer;
      }
  }
  </code></pre>
  
  <p>Please guide how to fix it.</p>