使用方式: 打开Harmony第三方工具仓,找到axios,如图: 第三方工具仓网址:https://ohpm.openharmony.cn/#/cn/home 在你的项目执行命令:ohpm install @ohos/axios 前提是你已经装好了ohpm ,如果没有安装,可以在官网找到详细的安装教程; 注意:不是在你的entry目录下,比如你的项目名称: 在父级目录安装。 接着封装工具类,新建一个ts类: import axios, { AxiosError, AxiosInstance, AxiosResponse, FormData, InternalAxiosRequestConfig } from '@ohos/axios' import defaultAppManager from '@ohos.bundle.defaultAppManager'; import ResultData from './ResultData'; class AxiosUtil { private instance: AxiosInstance; constructor() {...
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Get in touch with this.getTeacher
Contact this.getTeacher, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack