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请求有同步的方式
1244浏览 • 1回复 待解决
封装HTTP请求在ArkTS中常见
4852浏览 • 1回复 已解决
HarmonyOS http请求的封装
1256浏览 • 1回复 待解决
HarmonyOS http请求封装
1266浏览 • 1回复 待解决
HarmonyOS 取消http请求
1751浏览 • 1回复 待解决
HarmonyOS Context在taskpool怎么获取
1027浏览 • 1回复 待解决
如何利用taskpool执行多任务
3224浏览 • 1回复 待解决
有使用http发送xml报文格式的请求
3040浏览 • 1回复 待解决
HarmonyOS Http请求头问题咨询
1482浏览 • 1回复 待解决
HarmonyOS http post请求参数传递
1474浏览 • 1回复 待解决
HarmonyOS taskpool无法执行C++代码
1370浏览 • 1回复 待解决
HarmonyOS http请求返回2300007
2531浏览 • 1回复 待解决
http请求支持patch方法
3307浏览 • 1回复 待解决