我是靠谱客的博主 小巧高跟鞋,这篇文章主要介绍spring boot Required request parameter ‘xxx‘ for method parameter type xxx is not present,现在分享给大家,希望可以做个参考。
前端请求方式不同,后端处理方式不同
content-Type为 application/x-www-form-urlencoded
后端处理方式为
复制代码
1
2
3
4
5@PostMapping("register") public R insertUser(User user){ return R.ok().data("data",UserService.save(user)); }
content-type 为application/json,返回结果为user对象的json字符串,为String类型,需要使用fastJson进行处理再插入数据。
最后
以上就是小巧高跟鞋最近收集整理的关于spring boot Required request parameter ‘xxx‘ for method parameter type xxx is not present的全部内容,更多相关spring内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复