当前位置:网站首页>微信小程序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
边栏推荐
猜你喜欢

Vscode configuration

工作1-3年的程序员,应该具备怎么样的技术能力?该如何提升?
![[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

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

什么都2020了,LINQ查询你还在用表达式树

阿里terway源码分析

在pandas中使用pipe()提升代码可读性

Using pipe() to improve code readability in pandas

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

Got timeout reading communication packets解决方法
随机推荐
AFO
Thinkphp6中where条件中字段与字段比较条件的写法
快速上手Git
chrome浏览器跨域Cookie的SameSite问题导致访问iframe内嵌页面异常
模型预测准确率高达94%!利用机器学习完美解决2000亿美元库存难题
C language I blog assignment 03
Awk implements SQL like join operation
低代码 vs 模型驱动,它们之间到底是什么关系?
在pandas中使用pipe()提升代码可读性
How to learn technology efficiently
Adobe Prelude /Pl 2020软件安装包(附安装教程)
Web安全(三)---CSRF攻击
微服务的出现和意义的探索
看一遍就理解,图解单链表反转
Business facade and business rule
Recommend suicide, openai warns: gpt-3 is too risky for medical purposes
How to deal with data leakage and deletion related to business life and death?
Insight -- the application of sanet in arbitrary style transfer
laravel8更新之维护模式改进
awk实现类sql的join操作