我的 post 方法被调用,但我的个人资料为空。这种方法有什么问题?我必须使用 @Requestbody 来使用 RestTemplate 吗?
Profile profile = new Profile();
profile.setEmail(email);
String response = restTemplate.postForObject("http://localhost:8080/user/", profile, String.class);
@RequestMapping(value = "/", method = RequestMethod.POST)
public @ResponseBody
Object postUser(@Valid Profile profile, BindingResult bindingResult, HttpServletResponse response) {
//Profile is null
return profile;
}