当前位置:网站首页>微信小程序request报400错误 @RequestBody接收不到
微信小程序request报400错误 @RequestBody接收不到
2020-11-07 21:03:00 【麦漁翁】
后台springboot做的接口,参数用@RequestBody JSONObject接 但是小程序wx.request访问提示400,后台观察也报错了,说明已经传到后台了,检查后发现是小程序request默认使用get方式,更改成post后台@RequestBody就可以接收到了
wx.request({
url: "api地址",
data: {a:1,b:2},
method: "POST",
header: {
'content-type': 'application/json'
},
success(res) {
console.log(res.data)
}
})
版权声明
本文为[麦漁翁]所创,转载请带上原文链接,感谢
https://my.oschina.net/u/3204029/blog/4707690
边栏推荐
猜你喜欢
随机推荐
The official 1909 version of win10 cannot open the real-time protection solution of virus and threat protection in windows security center.
static+代码块+多态+异常
Principles of websocket + probuf
看一遍就理解,图解单链表反转
工作1-3年的程序员,应该具备怎么样的技术能力?该如何提升?
There's not much time left for Kwai Chung.
C语言Ⅰ博客作业03
What should be considered in the promotion plan outside the station?
京淘项目day09
Tips for Mac novices
Web安全(二)---跨域资源共享
如何以计算机的方式去思考
On the coverage technology and best practice of go code
Code Review最佳实践
我们为什么需要软件工程——从一个简单的项目进行观察
屏读时代,我们患上了注意力缺失候群症
Win10官方1909版本无法打开windows安全中心中病毒和威胁防护的实时保护解决方案。
laravel8更新之维护模式改进
聊一聊数据库中的锁
Implementation of multi GPU distributed training with horovod in Amazon sagemaker pipeline mode






