HarmonyOS taskpool里能执行http请求吗?

HarmonyOS
2024-12-27 14:00:08
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
Heiang

taskpool里能执行http请求。

let promise1 = https.get(xxx).then((data)=>{xxx}) 
let promise2 = https.post(xxx).then((data)=>{xxx}) 
Promise.all([promise1,promise2]).then(()=>{// 这里2个请求都做完了,可以走并行操作})

目前应用多线程有数量限制,网络请求这块推荐使用promise来进行处理。

分享
微博
QQ
微信
回复
2024-12-27 16:23:11
相关问题
HarmonyOS http请求有同步的方式
1198浏览 • 1回复 待解决
封装HTTP请求在ArkTS中常见
4782浏览 • 1回复 已解决
HarmonyOS 取消http请求
1676浏览 • 1回复 待解决
HarmonyOS http请求封装
1183浏览 • 1回复 待解决
如何利用taskpool执行多任务
3171浏览 • 1回复 待解决
HarmonyOS Context在taskpool怎么获取
986浏览 • 1回复 待解决
HarmonyOS http请求返回2300007
2357浏览 • 1回复 待解决
HarmonyOS http请求的封装
1208浏览 • 1回复 待解决
HarmonyOS taskpool无法执行C++代码
1292浏览 • 1回复 待解决
有使用http发送xml报文格式的请求
3017浏览 • 1回复 待解决
HarmonyOS http 请求 post 参数问题
3051浏览 • 1回复 待解决
HarmonyOS http get请求不到内容
1469浏览 • 1回复 待解决