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请求有同步的方式
1220浏览 • 1回复 待解决
封装HTTP请求在ArkTS中常见
4800浏览 • 1回复 已解决
HarmonyOS 取消http请求
1706浏览 • 1回复 待解决
HarmonyOS http请求封装
1217浏览 • 1回复 待解决
HarmonyOS http请求的封装
1232浏览 • 1回复 待解决
HarmonyOS http请求返回2300007
2414浏览 • 1回复 待解决
HarmonyOS Context在taskpool怎么获取
1007浏览 • 1回复 待解决
如何利用taskpool执行多任务
3199浏览 • 1回复 待解决
有使用http发送xml报文格式的请求
3029浏览 • 1回复 待解决
HarmonyOS http post请求参数传递
1450浏览 • 1回复 待解决
HarmonyOS Http请求头问题咨询
1448浏览 • 1回复 待解决
HarmonyOS taskpool无法执行C++代码
1321浏览 • 1回复 待解决
HarmonyOS http 请求 post 参数问题
3112浏览 • 1回复 待解决