未验证 提交 2db42691 编写于 作者: K king_he 提交者: Gitee

update en/application-dev/connectivity/http-request.md.

Signed-off-by: Nking_he <6384784@qq.com>
上级 38a82978
...@@ -12,20 +12,20 @@ To use related APIs, you must declare the **ohos.permission.INTERNET** permissio ...@@ -12,20 +12,20 @@ To use related APIs, you must declare the **ohos.permission.INTERNET** permissio
The following table describes the related APIs. The following table describes the related APIs.
| API | Description | | API | Description |
| ----------------------------------------- | ----------------------------------- | | ----------------------------------------- | --------------------------------------------------------- |
| createHttp() | Creates an HTTP request. | | createHttp() | Creates an HTTP request. |
| request() | Initiates an HTTP request to a given URL. | | request() | Initiates an HTTP request to a given URL. |
| destroy() | Destroys an HTTP request. | | destroy() | Destroys an HTTP request. |
| on(type: 'headersReceive') | Registers an observer for HTTP Response Header events. | | on(type: 'headersReceive') | Registers an observer for HTTP Response Header events. |
| off(type: 'headersReceive') | Unregisters the observer for HTTP Response Header events.| | off(type: 'headersReceive') | Unregisters the observer for HTTP Response Header events. |
## How to Develop ## How to Develop
1. Import the required HTTP module. 1. Import the required HTTP module.
2. Create an **HttpRequest** object. 2. Create an **HttpRequest** object.
3. (Optional) Listen for HTTP Response Header events. 3. (Optional) Listen for HTTP Response Header events.
4. Initiates an HTTP request to a given URL. 4. Initiate an HTTP request to a given URL.
5. (Optional) Process the HTTP Response Header event and the return result of the HTTP request. 5. (Optional) Process the HTTP Response Header event and the return result of the HTTP request.
```js ```js
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册