当前位置:网站首页>微信小程序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
边栏推荐
猜你喜欢
laravel8更新之维护模式改进
C language I blog assignment 03
Business Facade 与 Business Rule
Got timeout reading communication packets解决方法
How to learn technology efficiently
CPU瞒着内存竟干出这种事
工作1-3年的程序员,应该具备怎么样的技术能力?该如何提升?
计组-总线通信控制之异步串行通信的数据传输
The samesite problem of cross domain cookie of Chrome browser results in abnormal access to iframe embedded pages
websocket+probuf.原理篇
随机推荐
建议患者自杀,OpenAI警告:GPT-3用于医疗目的风险太高
In the age of screen reading, we suffer from attention deficit syndrome
阿里terway源码分析
Using pipe() to improve code readability in pandas
graph generation model
Vscode configuration
laravel8更新之维护模式改进
Business facade and business rule
Got timeout reading communication packets解决方法
一次公交卡被“盗刷”事件带来的思考
Adobe Prelude /Pl 2020软件安装包(附安装教程)
Deep into web workers (1)
关于update操作并发问题
汇编函数mcall systemstack asmcgocall syscall
「混合云」会是云计算的下一个战场吗?
delphi10的rest.json与system.json的踩坑
Exception calling 'downloadstring' with '1' arguments: 'operation timed out'
go wire 依赖注入入门
Code Review最佳实践
graph generation model