uniapp uni.request
时间: 2023-08-25 18:05:29 浏览: 99
uniapp封装好的request请求
uni.request是uni-app中用于发送 HTTP 请求的方法。它可以向后端服务器发送一个异步的网络请求,并获取响应数据。 = response;
resolve(res.data);
}).catch(error => {
let [err, res = error;
reject(err);
})
});
}
export default request;
```
可以通过import方式将封装好的request函数引入到需要使用的地方,然后调用request函数来发送请求。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [uni-app里面使用uni.request请求并且渲染列表](https://blog.csdn.net/weixin_44763569/article/details/109507577)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [uni-app项目中uni.request封装和使用](https://blog.csdn.net/jsrdweiting/article/details/120511085)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文