当前位置:网站首页>微信小程序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
边栏推荐
- 如何以计算机的方式去思考
- Code Review Best Practices
- Using thread communication to solve the problem of cache penetrating database avalanche
- Exception calling 'downloadstring' with '1' arguments: 'operation timed out'
- [漫谈] 软件设计的目标和途径
- How Facebook open source framework simplifies pytorch experiment
- Ac86u KX Online
- How did I lose control of the team?
- Do not understand the underlying principle of database index? That's because you don't have a B tree in your heart
- Kylin on Kubernetes 在 eBay 的实践
猜你喜欢
随机推荐
统计文本中字母的频次(不区分大小写)
It's time to end bertology
分享几个我日常使用的VS Code插件
使用 Xunit.DependencyInjection 改造测试项目
A detailed explanation of microservice architecture
Awk implements SQL like join operation
CPU瞒着内存竟干出这种事
Vscode configuration
一次公交卡被“盗刷”事件带来的思考
Don't treat exceptions as business logic, which you can't afford
Exception calling 'downloadstring' with '1' arguments: 'operation timed out'
android基础-RadioButton(单选按钮)
Practice of Xiaoxiong school development board: real equipment access of smart street lamp sandbox experiment
爆一个VS2015 Update1更新带来的编译BUG【已有解决方案】
easyui dialog“缓存问题”
手撕算法-手写单例模式
Thinkphp6中where条件中字段与字段比较条件的写法
WPF 关于绘图个人总结
编程界大佬教你:一行Python代码能做出哪些神奇的事情?
The official 1909 version of win10 cannot open the real-time protection solution of virus and threat protection in windows security center.







