HarmonyOS taskpool里能执行http请求吗?

HarmonyOS
2024-12-27 14:00:08
819浏览
收藏 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个请求都做完了,可以走并行操作})
  • 1.
  • 2.
  • 3.

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

分享
微博
QQ
微信
回复
2024-12-27 16:23:11
相关问题
HarmonyOS http请求有同步的方式
967浏览 • 1回复 待解决
封装HTTP请求在ArkTS中常见
4437浏览 • 1回复 已解决
HarmonyOS 取消http请求
1136浏览 • 1回复 待解决
HarmonyOS http请求封装
879浏览 • 1回复 待解决
HarmonyOS http请求的封装
918浏览 • 1回复 待解决
HarmonyOS http请求返回2300007
1854浏览 • 1回复 待解决
HarmonyOS Context在taskpool怎么获取
650浏览 • 1回复 待解决
如何利用taskpool执行多任务
2914浏览 • 1回复 待解决
HarmonyOS Http请求头问题咨询
1104浏览 • 1回复 待解决
HarmonyOS http post请求参数传递
1080浏览 • 1回复 待解决
有使用http发送xml报文格式的请求
2776浏览 • 1回复 待解决
HarmonyOS taskpool无法执行C++代码
995浏览 • 1回复 待解决