当前位置:网站首页>解决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"
}
});
可以成功发送。
边栏推荐
- Codeforces round 275 (Div. 2) C – diverse permutation (construction) [easy to understand]
- Description of the difference between character varying and character in PostgreSQL database
- Lex & yacc of Pisa proxy SQL parsing
- Ubuntu安装mysql8遇到的问题以及详细安装过程
- Intelligent transportation is full of vitality. What will happen in the future? [easy to understand]
- UVA 11080 – Place the Guards(二分图判定)
- Ten thousand word summary data storage, three knowledge points
- Prometheus remote_ write InfluxDB,unable to parse authentication credentials,authorization failed
- MySQL storage expression error
- Is embedded system really safe? [how does onespin comprehensively solve the IC integrity problem for the development team]
猜你喜欢
Lex & yacc of Pisa proxy SQL parsing
Klocwork code static analysis tool
The new version of onespin 360 DV has been released, refreshing the experience of FPGA formal verification function
SQL injection error report injection function graphic explanation
使用枚举实现英文转盲文
目标:不排斥 yaml 语法。争取快速上手
[C language] advanced pointer --- do you really understand pointer?
The latest version of codesonar has improved functional security and supports Misra, c++ parsing and visualization
[200 opencv routines] 223 Polygon fitting for feature extraction (cv.approxpolydp)
Ten thousand word summary data storage, three knowledge points
随机推荐
[uvalive 6663 count the regions] (DFS + discretization) [easy to understand]
HOJ 2245 浮游三角胞(数学啊 )
私募基金在中國合法嗎?安全嗎?
Codesonar Webinar
使用枚举实现英文转盲文
SQL injection error report injection function graphic explanation
Codeforces round 275 (Div. 2) C – diverse permutation (construction) [easy to understand]
201215-03-19 - cocos2dx memory management - specific explanation "recommended collection"
Intelligent transportation is full of vitality. What will happen in the future? [easy to understand]
201215-03-19—cocos2dx内存管理–具体解释「建议收藏」
国家正规的股票交易app有哪些?使用安不安全
Validutil, "Rethinking the setting of semi supervised learning on graphs"
Postgresql数据库character varying和character的区别说明
开户必须往账户里面赚钱吗,资金安全吗?
FatMouse' Trade (Hangdian 1009)
Ubuntu安装mysql8遇到的问题以及详细安装过程
Code of "digital image processing principle and Practice (matlab version)" part2[easy to understand]
Tupu digital twin coal mining system to create "hard power" of coal mining
Restore backup data on persistent volumes
Magic weapon - sensitive file discovery tool