当前位置:网站首页>微信小程序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
边栏推荐
猜你喜欢
使用 Xunit.DependencyInjection 改造测试项目
大数据算法——布隆过滤器
Code Review最佳实践
The most hard core of the whole network explains the computer startup process
你可能不知道的Animation动画技巧与细节
How to choose a good company
来自不同行业领域的50多个对象检测数据集
On hiz buffer
某618大促项目的复盘总结
The official 1909 version of win10 cannot open the real-time protection solution of virus and threat protection in windows security center.
随机推荐
A detailed explanation of microservice architecture
AFO
AC86U kx上网
The prediction accuracy of the model is as high as 94%! Using machine learning to solve the 200 billion dollar inventory problem perfectly
What kind of technical ability should a programmer who has worked for 1-3 years? How to improve?
What do you think of the most controversial programming ideas?
技术债务是对业务功能缺乏真正的理解 -daverupert.com
What is the relationship between low code vs model driven?
Got timeout reading communication packets解决方法
Git代码提交操作,以及git push提示failed to push some refs'XXX'
深入web workers (上)
Big data algorithm - bloon filter
Annual salary of 900000 programmers is not as good as 3800 civil servants a month? How to choose between stability and high income?
Don't treat exceptions as business logic, which you can't afford
盘点那些争议最大的编程观点,你是什么看法呢?
使用“1”个参数调用“DownloadString”时发生异常:“操作超时”
【解决方案】分布式定时任务解决方案
Bgfx compilation tutorial
小熊派开发板实践:智慧路灯沙箱实验之真实设备接入
[漫谈] 软件设计的目标和途径