@Test public void testPut() throws IOException { Person person = new Person(1, "name1", 12, "address1"); RequestBody requestBody = FormBody.create(MediaType.parse("application/json; charset=utf-8"), JSON.toJSONString(person)); String post = OkHttpClientUtil.post(host + "put",requestBody); log.info("返回结果 result = " + post); }
@RequestMapping("/put") public long put(@RequestBody Person person) { Person p = personService.save(person); return p.getId(); }
PersonController { @RequestMapping("/put") public long put(@RequestBody Person person) { Person p = personService.save(person); return p.getId(); } }
PersonController { @RequestMapping("/put") public long put(@RequestBody Person person) { Person p = personService.save(person); return p.getId(); }  }
PersonController { @RequestMapping("/put") public long put(@RequestBody Person person) { Person p = personService.save(person); return p.getId(); }  @RequestMapping("/put") long put(@RequestBody Person person); @RequestMapping("/able") Person cacheable(@RequestBody Person person); @RequestMapping("/evit") String evit(@RequestBody Person person); }
PersonController { @RequestMapping("/put") public long put(@RequestBody Person person) { Person p = personService.save(person); return p.getId(); }  @RequestMapping("/put") long put(@RequestBody Person person); @RequestMapping("/able") Person cacheable(@RequestBody Person person); @RequestMapping("/evit") String evit(@RequestBody Person person);  }