Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported

后端接口代码:

    /**
     * 根据用户id修改用户信息
     */
    @PostMapping("/updateUser")
    public R updateUserById(@RequestBody User user) {
        log.info("*****************要更新的用户数据:"+user);
        boolean b = userService.updateById(user);
        if (b) {
            return R.ok().message("用户信息更新完成!");
        }
        return R.error().message("用户信息更新失败!");
    }

解决:需要在请求头加入:

"Content-Type": "application/json;charset=UTF-8"

原文地址:https://www.cnblogs.com/zjazn/p/15205555.html