# harmonyOs 请求封装 **Repository Path**: demozyun/harmonyos_http ## Basic Information - **Project Name**: harmonyOs 请求封装 - **Description**: harmonyOs 请求封装,5.0.1(api12/13)支持 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2025-01-23 - **Last Updated**: 2025-01-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### 用法 ```ts import { Post, Get } from '../api/request'; @Entry @Component struct Index { aboutToAppear() { this.requestIndex(); } requestIndex(){ let param: RequestIndexParam = new RequestIndexParam(); param.auth_except = 1; Post(this.getUIContext(), 'index/index', param).then(res => { console.info('请求首页 结果', JSON.stringify(res)) }) // 此时可额外携带get参数在请求路径上 // Post(this.getUIContext(), ['index/index', {isapp: 1}], param).then(res => { // console.info('请求首页 结果', JSON.stringify(res)) // }) } } ``` ### 下载下方文件放入ets文件夹下(即pages同级目录) [git下载](https://gitee.com/YofFawn/harmonyos_http)