org.springframework.http.converter.HttpMessageNotReadableException: Required request body 錯誤處理

[org.springframework.http.converter.HttpMessageNotReadableException: Required request body is missing

 這是因爲@RequestBody 不支持get方法所致

@GetMapping("/doQuery")
public RespPageBean getUsersByPage(@RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer size, @RequestBody User user)
{
    return userService.getUsers(page,size,user);
}

改成 @RequestMapping("/doQuery")即可

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章