title: how to convert the post request from xml to json in a restful web service
body: <pre><code>@POST    
  @Path("/users")
  @Produces(MediaType.APPLICATION_XML)
  @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
  public String createUser(@FormParam("id") int id,
  @FormParam("name") String name,
  @FormParam("profession") String profession,
  @Context HttpServletResponse servletResponse) throws IOException{
  User user = new User(id, name, profession);
  int result = userDao.addUser(user);
  if(result == 1){
  return SUCCESS_RESULT;
  }
  return FAILURE_RESULT;
  }
  </code></pre>
  
  <p><strong>strong text</strong></p>
  
  <p>reference : <a href="https://www.tutorialspoint.com/restful/restful_methods.htm" rel="nofollow noreferrer">https://www.tutorialspoint.com/restful/restful_methods.htm</a></p>