How to POST JSON object to spring controller?
问题 I have spring controller: @RequestMapping(value = "/add", method = RequestMethod.POST, consumes = "application/json") public @ResponseBody ResponseDto<Job> add(User user) { ... } I can POST the object like this with APACHE HTTP CLIENT: HttpPost post = new HttpPost(url); List nameValuePairs = new ArrayList(); nameValuePairs.add(new BasicNameValuePair("name", "xxx")); post.setEntity(new UrlEncodedFormEntity(nameValuePairs)); HttpResponse response = client.execute(post); In controller I get user