当前位置:网站首页>解决uni-app中uni.request发送POST请求没有反应。
解决uni-app中uni.request发送POST请求没有反应。
2022-07-07 21:33:00 【No Bug】
首先在postman测试了可以发送请求并且接收到返回数据。
然后在uni-app使用uni.request发送POST请求就没有反应。
uni.request({
url: "http://1.14.142.212:8080/tobraille",
method: "POST",
data: {
text: "hello get",
language: "en-us"
}
});
经过一番查询知道了uni.request发送POST请求需要加上
header: {
'content-type': 'application/json;charset:utf-8'
}
加上之后
uni.request({
url: "http://1.14.142.212:8080/tobraille",
method: "POST",
header: {
'content-type': 'application/json;charset:utf-8'
},
data: {
text: "hello get",
language: "en-us"
}
});
可以成功发送。
边栏推荐
- Le capital - investissement est - il légal en Chine? C'est sûr?
- Unity3d 4.3.4f1 execution project
- 【OpenCV 例程200篇】223. 特征提取之多边形拟合(cv.approxPolyDP)
- Micro service remote debug, nocalhost + rainbow micro service development second bullet
- SQL注入报错注入函数图文详解
- 恶魔奶爸 A1 语音听力初挑战
- 201215-03-19 - cocos2dx memory management - specific explanation "recommended collection"
- 反诈困境,国有大行如何破局?
- 恶魔奶爸 C
- How to meet the dual needs of security and confidentiality of medical devices?
猜你喜欢
Default constraint and zero fill constraint of MySQL constraint
[200 opencv routines] 223 Polygon fitting for feature extraction (cv.approxpolydp)
解决使用uni-app MediaError MediaError ErrorCode -5
[C language] advanced pointer --- do you really understand pointer?
Usage of MySQL subquery keywords (exists)
Cantata9.0 | new features
Codesonar enhances software reliability through innovative static analysis
Mysql子查询关键字的使用方式(exists)
Magic weapon - sensitive file discovery tool
MySQL约束之默认约束default与零填充约束zerofill
随机推荐
刚开户的能买什么股票呢?炒股账户安全吗
C language helps you understand pointers from multiple perspectives (1. Character pointers 2. Array pointers and pointer arrays, array parameter passing and pointer parameter passing 3. Function point
解决使用uni-app MediaError MediaError ErrorCode -5
目标:不排斥 yaml 语法。争取快速上手
object-c编程tips-timer「建议收藏」
The latest version of codesonar has improved functional security and supports Misra, c++ parsing and visualization
部署、收回和删除解决方式—-STSADM和PowerShell「建议收藏」
95年专注安全这一件事 沃尔沃未来聚焦智能驾驶与电气化领域安全
Jetty: configure connector [easy to understand]
Cantata9.0 | new features
2022年在启牛开中银股票的账户安全吗?
Is embedded system really safe? [how does onespin comprehensively solve the IC integrity problem for the development team]
Devil daddy B1 hearing the last barrier, break through with all his strength
openGl超级宝典学习笔记 (1)第一个三角形「建议收藏」
POJ 3140 Contestants Division「建议收藏」
C语言 整型 和 浮点型 数据在内存中存储详解(内含原码反码补码,大小端存储等详解)
Word inversion implements "suggestions collection"
Le capital - investissement est - il légal en Chine? C'est sûr?
Arlo's troubles
Magic weapon - sensitive file discovery tool