你好,我正在使用Rest客户端(Postman)发送REST请求,但是遇到了错误:
{
"timestamp": 1432829209385,
"status": 415,
"error": "Unsupported Media Type",
"exception": "org.springframework.web.HttpMediaTypeNotSupportedException",
"message": "Content type 'text/plain;charset=UTF-8' not supported",
"path": "/api/v1/user"
}
我的控制器是:
@RequestMapping(value = "/user", method = RequestMethod.PUT, produces = "application/json")
public Map<String,Object> updateUser(@RequestBody @Valid User user) {
// userService.updateUser(user);
return ResponseHandler.generateResponse("", HttpStatus.ACCEPTED, false, null);
}
我正在通过REST客户端按照图片所示发送请求。