您好我正在使用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客户端发送请求,如图所示。