Required request body is missing报错及解决
发布时间:2024年01月04日
今天,我在尝试调用后端接口展示文章数据时遇到了错误,错误原因是请求体缺失,

?但是我明明传了参数


然后我找了很久错误原因,发现在之前跟着写的一个差不多的功能时,请求方式是post

?而我写的确是get

?将get改为post后,并将前端请求方式也改为了post

?然后重启后端项目,打开页面

?成功调用后端接口并显示数据,并可以实现文章条件搜索分页查询

?总结:json格式的请求体可以用post,不能用get
文章来源:https://blog.csdn.net/qq_62768655/article/details/135392201
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若内容造成侵权/违法违规/事实不符,请联系我的编程经验分享网邮箱:chenni525@qq.com进行投诉反馈,一经查实,立即删除!