当前位置:网站首页>微信小程序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 most hard core of the whole network explains the computer startup process
- There's not much time left for Kwai Chung.
- 「混合云」会是云计算的下一个战场吗?
- awk实现类sql的join操作
- Three steps, one pit, five steps and one thunder, how to lead the technical team under the rapid growth?
- 分享几个我日常使用的VS Code插件
- Business Facade 与 Business Rule
- Technical debt is a lack of real understanding of business functions- daverupert.com
- 不要把异常当做业务逻辑,这性能可能你无法承受
- Design pattern of facade and mediator
猜你喜欢

构造请求日志分析系统

工作1-3年的程序员,应该具备怎么样的技术能力?该如何提升?

websocket+probuf.原理篇

一万四千字分布式事务原理解析,全部掌握你还怕面试被问?

On hiz buffer

Why do we need software engineering -- looking at a simple project

来自不同行业领域的50多个对象检测数据集

Bgfx compilation tutorial
![[original] the influence of arm platform memory and cache on the real-time performance of xenomai](/img/cb/0395507ece572556b2bab373f013a5.jpg)
[original] the influence of arm platform memory and cache on the real-time performance of xenomai

chrome浏览器跨域Cookie的SameSite问题导致访问iframe内嵌页面异常
随机推荐
C language I blog assignment 03
工作1-3年的程序员,应该具备怎么样的技术能力?该如何提升?
awk实现类sql的join操作
【原创】ARM平台内存和cache对xenomai实时性的影响
awk实现类sql的join操作
The samesite problem of cross domain cookie of Chrome browser results in abnormal access to iframe embedded pages
Stack bracket matching
Implementation of Caesar cipher
use Xunit.DependencyInjection Transformation test project
一次公交卡被“盜刷”事件帶來的思考
Using pipe() to improve code readability in pandas
在pandas中使用pipe()提升代码可读性
什么都2020了,LINQ查询你还在用表达式树
栈-括号的匹配
工作1-3年的程序员,应该具备怎么样的技术能力?该如何提升?
Recommend suicide, openai warns: gpt-3 is too risky for medical purposes
深入web workers (上)
年薪90万程序员不如月入3800公务员?安稳与高收入,到底如何选择?
Technical debt is a lack of real understanding of business functions- daverupert.com
【解决方案】分布式定时任务解决方案