• Home
Name Date Size #Lines LOC

..--

AppScope/12-May-2024-3633

entry/12-May-2024-757605

http/12-May-2024-445393

screenshots/device/12-May-2024-

.gitignoreD12-May-202493 77

README.mdD12-May-20241.4 KiB4020

README_zh.mdD12-May-20241.2 KiB3920

build-profile.json5D12-May-20241.1 KiB4745

hvigorfile.jsD12-May-2024168 21

package.jsonD12-May-2024391 1919

README.md

1# HTTP
2
3### Introduction
4
5This sample shows how to use the **TextInput** component to enter parameters and use the **Text** component to display the return result.
6
7In this example, we'll use [SystemCapability.Communication.NetStack](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-http.md) to initiate HTTP network requests to the destination URL based on specified configuration.
8
9Usage
10
111. When starting the sample application, configure the network request by specifying the destination URL, request mode, and request parameters.
12
132. Click **OK**. The request result page is displayed.
14
153. Click **Back** to return to the configuration page.
16
17NOTE: You can compile the http module into a **.tgz** package depending on your need.
18
19### Display Effect
20
21![](screenshots/device/index.png) ![](screenshots/device/result.png)
22
23### Required Permissions
24
25Access to the Internet: [ohos.permission.INTERNET](https://gitee.com/openharmony/docs/blob/master/en/application-dev/security/permission-list.md)
26
27### Dependency
28
29N/A
30
31### Constraints
32
331. This sample can only be run on standard-system devices that use the Rockchip RK3568 chip.
34
352. This sample demonstrates the stage model, which supports only the SDK of API version 9 (SDK version: 3.2.10.6).
36
373. DevEco Studio 3.1 Canary1 (Build Version: 3.1.0.100) must be used.
38
394. This sample requires network connection throughout the entire process.
40

README_zh.md

1# Http
2
3### 介绍
4
5本示例通过**TextInput**组件输入参数,**Text**组件显示返回结果。
6
7本实例使用[SystemCapability.Communication.NetStack](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-http.md)系统能力,创建了一个HTTP请求,并根据URL地址和相关配置项,发起HTTP网络请求。
8
9使用说明:
10
111.启动应用可配置网络请求,设置网址、请求方式、请求参数。
12
132.点击确认按钮,跳转请求结果页面。
14
153.点击返回按钮,返回配置页面。
16
174.支持将本示例中的http模块编译成tgz包。
18
19### 效果预览
20
21![](screenshots/device/index.png) ![](screenshots/device/result.png)
22
23### 相关权限
24
25允许使用Internet网络: [ohos.permission.INTERNET](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md)
26
27### 依赖
28
29不涉及。
30
31### 约束与限制
32
331.本示例仅支持标准系统上运行,支持设备:RK3568。
34
352.本示例仅支持API9版本SDK,版本号:3.2.10.6 及以上。
36
373.本示例需要使用DevEco Studio 3.1 Canary1 (Build Version: 3.1.0.100)及以上才可编译运行。
38
394.运行本示例需全程联网。