161847f8eSopenharmony_ci/*
261847f8eSopenharmony_ci * Copyright (c) 2021-2023 Huawei Device Co., Ltd.
361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
461847f8eSopenharmony_ci * you may not use this file except in compliance with the License.
561847f8eSopenharmony_ci * You may obtain a copy of the License at
661847f8eSopenharmony_ci *
761847f8eSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
861847f8eSopenharmony_ci *
961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and
1361847f8eSopenharmony_ci * limitations under the License.
1461847f8eSopenharmony_ci */
1561847f8eSopenharmony_ci
1661847f8eSopenharmony_ci/**
1761847f8eSopenharmony_ci * @file
1861847f8eSopenharmony_ci * @kit NetworkKit
1961847f8eSopenharmony_ci */
2061847f8eSopenharmony_ci
2161847f8eSopenharmony_ciimport type { AsyncCallback, Callback } from './@ohos.base';
2261847f8eSopenharmony_ciimport type connection from './@ohos.net.connection';
2361847f8eSopenharmony_ci
2461847f8eSopenharmony_ci/**
2561847f8eSopenharmony_ci * Provides http related APIs.
2661847f8eSopenharmony_ci * @namespace http
2761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetStack
2861847f8eSopenharmony_ci * @since 6
2961847f8eSopenharmony_ci */
3061847f8eSopenharmony_ci/**
3161847f8eSopenharmony_ci * Provides http related APIs.
3261847f8eSopenharmony_ci * @namespace http
3361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetStack
3461847f8eSopenharmony_ci * @crossplatform
3561847f8eSopenharmony_ci * @since 10
3661847f8eSopenharmony_ci */
3761847f8eSopenharmony_ci/**
3861847f8eSopenharmony_ci * Provides http related APIs.
3961847f8eSopenharmony_ci * @namespace http
4061847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetStack
4161847f8eSopenharmony_ci * @crossplatform
4261847f8eSopenharmony_ci * @atomicservice
4361847f8eSopenharmony_ci * @since 11
4461847f8eSopenharmony_ci */
4561847f8eSopenharmony_cideclare namespace http {
4661847f8eSopenharmony_ci  /**
4761847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
4861847f8eSopenharmony_ci   * @since 10
4961847f8eSopenharmony_ci   */
5061847f8eSopenharmony_ci  /**
5161847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
5261847f8eSopenharmony_ci   * @atomicservice
5361847f8eSopenharmony_ci   * @since 11
5461847f8eSopenharmony_ci   */
5561847f8eSopenharmony_ci  /**
5661847f8eSopenharmony_ci   * @typedef { connection.HttpProxy }
5761847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
5861847f8eSopenharmony_ci   * @crossplatform
5961847f8eSopenharmony_ci   * @atomicservice
6061847f8eSopenharmony_ci   * @since 12
6161847f8eSopenharmony_ci   */
6261847f8eSopenharmony_ci  type HttpProxy = connection.HttpProxy;
6361847f8eSopenharmony_ci
6461847f8eSopenharmony_ci  /**
6561847f8eSopenharmony_ci   * Creates an HTTP request task.
6661847f8eSopenharmony_ci   * @returns { HttpRequest } the HttpRequest of the createHttp.
6761847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
6861847f8eSopenharmony_ci   * @since 6
6961847f8eSopenharmony_ci   */
7061847f8eSopenharmony_ci  /**
7161847f8eSopenharmony_ci   * Creates an HTTP request task.
7261847f8eSopenharmony_ci   * @returns { HttpRequest } the HttpRequest of the createHttp.
7361847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
7461847f8eSopenharmony_ci   * @crossplatform
7561847f8eSopenharmony_ci   * @since 10
7661847f8eSopenharmony_ci   */
7761847f8eSopenharmony_ci  /**
7861847f8eSopenharmony_ci   * Creates an HTTP request task.
7961847f8eSopenharmony_ci   * @returns { HttpRequest } the HttpRequest of the createHttp.
8061847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
8161847f8eSopenharmony_ci   * @crossplatform
8261847f8eSopenharmony_ci   * @atomicservice
8361847f8eSopenharmony_ci   * @since 11
8461847f8eSopenharmony_ci   */
8561847f8eSopenharmony_ci  function createHttp(): HttpRequest;
8661847f8eSopenharmony_ci
8761847f8eSopenharmony_ci  /**
8861847f8eSopenharmony_ci   * Specifies the type and value range of the optional parameters in the HTTP request.
8961847f8eSopenharmony_ci   * @interface HttpRequestOptions
9061847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
9161847f8eSopenharmony_ci   * @since 6
9261847f8eSopenharmony_ci   */
9361847f8eSopenharmony_ci  /**
9461847f8eSopenharmony_ci   * Specifies the type and value range of the optional parameters in the HTTP request.
9561847f8eSopenharmony_ci   * @interface HttpRequestOptions
9661847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
9761847f8eSopenharmony_ci   * @crossplatform
9861847f8eSopenharmony_ci   * @since 10
9961847f8eSopenharmony_ci   */
10061847f8eSopenharmony_ci  /**
10161847f8eSopenharmony_ci   * Specifies the type and value range of the optional parameters in the HTTP request.
10261847f8eSopenharmony_ci   * @interface HttpRequestOptions
10361847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
10461847f8eSopenharmony_ci   * @crossplatform
10561847f8eSopenharmony_ci   * @atomicservice
10661847f8eSopenharmony_ci   * @since 11
10761847f8eSopenharmony_ci   */
10861847f8eSopenharmony_ci  export interface HttpRequestOptions {
10961847f8eSopenharmony_ci    /**
11061847f8eSopenharmony_ci     * Request method,default is GET.
11161847f8eSopenharmony_ci     * @type {?RequestMethod}
11261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
11361847f8eSopenharmony_ci     * @since 6
11461847f8eSopenharmony_ci     */
11561847f8eSopenharmony_ci    /**
11661847f8eSopenharmony_ci     * Request method,default is GET.
11761847f8eSopenharmony_ci     * @type {?RequestMethod}
11861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
11961847f8eSopenharmony_ci     * @crossplatform
12061847f8eSopenharmony_ci     * @since 10
12161847f8eSopenharmony_ci     */
12261847f8eSopenharmony_ci    /**
12361847f8eSopenharmony_ci     * Request method,default is GET.
12461847f8eSopenharmony_ci     * @type {?RequestMethod}
12561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
12661847f8eSopenharmony_ci     * @crossplatform
12761847f8eSopenharmony_ci     * @atomicservice
12861847f8eSopenharmony_ci     * @since 11
12961847f8eSopenharmony_ci     */
13061847f8eSopenharmony_ci    method?: RequestMethod;
13161847f8eSopenharmony_ci
13261847f8eSopenharmony_ci    /**
13361847f8eSopenharmony_ci     * Additional data of the request.
13461847f8eSopenharmony_ci     * extraData can be a string or an Object (API 6) or an ArrayBuffer(API 8).
13561847f8eSopenharmony_ci     * @type {?string | Object | ArrayBuffer}
13661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
13761847f8eSopenharmony_ci     * @since 6
13861847f8eSopenharmony_ci     */
13961847f8eSopenharmony_ci    /**
14061847f8eSopenharmony_ci     * Additional data of the request.
14161847f8eSopenharmony_ci     * extraData can be a string or an Object (API 6) or an ArrayBuffer(API 8).
14261847f8eSopenharmony_ci     * @type {?string | Object | ArrayBuffer}
14361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
14461847f8eSopenharmony_ci     * @crossplatform
14561847f8eSopenharmony_ci     * @since 10
14661847f8eSopenharmony_ci     */
14761847f8eSopenharmony_ci    /**
14861847f8eSopenharmony_ci     * Additional data of the request.
14961847f8eSopenharmony_ci     * extraData can be a string or an Object (API 6) or an ArrayBuffer(API 8).
15061847f8eSopenharmony_ci     * @type { ?(string | Object | ArrayBuffer) }
15161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
15261847f8eSopenharmony_ci     * @crossplatform
15361847f8eSopenharmony_ci     * @atomicservice
15461847f8eSopenharmony_ci     * @since 11
15561847f8eSopenharmony_ci     */
15661847f8eSopenharmony_ci    extraData?: string | Object | ArrayBuffer;
15761847f8eSopenharmony_ci
15861847f8eSopenharmony_ci    /**
15961847f8eSopenharmony_ci     * Data type to be returned. If this parameter is set, the system preferentially returns the specified type.
16061847f8eSopenharmony_ci     * @type {?HttpDataType}
16161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
16261847f8eSopenharmony_ci     * @since 9
16361847f8eSopenharmony_ci     */
16461847f8eSopenharmony_ci    /**
16561847f8eSopenharmony_ci     * Data type to be returned. If this parameter is set, the system preferentially returns the specified type.
16661847f8eSopenharmony_ci     * @type {?HttpDataType}
16761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
16861847f8eSopenharmony_ci     * @crossplatform
16961847f8eSopenharmony_ci     * @since 10
17061847f8eSopenharmony_ci     */
17161847f8eSopenharmony_ci    /**
17261847f8eSopenharmony_ci     * Data type to be returned. If this parameter is set, the system preferentially returns the specified type.
17361847f8eSopenharmony_ci     * @type {?HttpDataType}
17461847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
17561847f8eSopenharmony_ci     * @crossplatform
17661847f8eSopenharmony_ci     * @atomicservice
17761847f8eSopenharmony_ci     * @since 11
17861847f8eSopenharmony_ci     */
17961847f8eSopenharmony_ci    expectDataType?: HttpDataType;
18061847f8eSopenharmony_ci
18161847f8eSopenharmony_ci    /**
18261847f8eSopenharmony_ci     * default is true
18361847f8eSopenharmony_ci     * @type {?boolean}
18461847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
18561847f8eSopenharmony_ci     * @since 9
18661847f8eSopenharmony_ci     */
18761847f8eSopenharmony_ci    /**
18861847f8eSopenharmony_ci     * default is true
18961847f8eSopenharmony_ci     * @type {?boolean}
19061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
19161847f8eSopenharmony_ci     * @crossplatform
19261847f8eSopenharmony_ci     * @since 10
19361847f8eSopenharmony_ci     */
19461847f8eSopenharmony_ci    /**
19561847f8eSopenharmony_ci     * default is true
19661847f8eSopenharmony_ci     * @type {?boolean}
19761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
19861847f8eSopenharmony_ci     * @crossplatform
19961847f8eSopenharmony_ci     * @atomicservice
20061847f8eSopenharmony_ci     * @since 11
20161847f8eSopenharmony_ci     */
20261847f8eSopenharmony_ci    usingCache?: boolean;
20361847f8eSopenharmony_ci
20461847f8eSopenharmony_ci    /**
20561847f8eSopenharmony_ci     * [1, 1000], default is 1.
20661847f8eSopenharmony_ci     * @type {?number}
20761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
20861847f8eSopenharmony_ci     * @since 9
20961847f8eSopenharmony_ci     */
21061847f8eSopenharmony_ci    /**
21161847f8eSopenharmony_ci     * [1, 1000], default is 1.
21261847f8eSopenharmony_ci     * @type {?number}
21361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
21461847f8eSopenharmony_ci     * @crossplatform
21561847f8eSopenharmony_ci     * @since 10
21661847f8eSopenharmony_ci     */
21761847f8eSopenharmony_ci    /**
21861847f8eSopenharmony_ci     * [1, 1000], default is 1.
21961847f8eSopenharmony_ci     * @type {?number}
22061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
22161847f8eSopenharmony_ci     * @crossplatform
22261847f8eSopenharmony_ci     * @atomicservice
22361847f8eSopenharmony_ci     * @since 11
22461847f8eSopenharmony_ci     */
22561847f8eSopenharmony_ci    priority?: number;
22661847f8eSopenharmony_ci
22761847f8eSopenharmony_ci    /**
22861847f8eSopenharmony_ci     * HTTP request header. default is 'content-type': 'application/json'
22961847f8eSopenharmony_ci     * @type {?Object}
23061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
23161847f8eSopenharmony_ci     * @since 6
23261847f8eSopenharmony_ci     */
23361847f8eSopenharmony_ci    /**
23461847f8eSopenharmony_ci     * HTTP request header. default is 'content-type': 'application/json'
23561847f8eSopenharmony_ci     * @type {?Object}
23661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
23761847f8eSopenharmony_ci     * @crossplatform
23861847f8eSopenharmony_ci     * @since 10
23961847f8eSopenharmony_ci     */
24061847f8eSopenharmony_ci    /**
24161847f8eSopenharmony_ci     * HTTP request header. default is 'content-type': 'application/json'
24261847f8eSopenharmony_ci     * @type {?Object}
24361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
24461847f8eSopenharmony_ci     * @crossplatform
24561847f8eSopenharmony_ci     * @atomicservice
24661847f8eSopenharmony_ci     * @since 11
24761847f8eSopenharmony_ci     */
24861847f8eSopenharmony_ci    header?: Object;
24961847f8eSopenharmony_ci
25061847f8eSopenharmony_ci    /**
25161847f8eSopenharmony_ci     * Read timeout period. The default value is 60,000, in ms.
25261847f8eSopenharmony_ci     * @type {?number}
25361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
25461847f8eSopenharmony_ci     * @since 6
25561847f8eSopenharmony_ci     */
25661847f8eSopenharmony_ci    /**
25761847f8eSopenharmony_ci     * Read timeout period. The default value is 60,000, in ms.
25861847f8eSopenharmony_ci     * @type {?number}
25961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
26061847f8eSopenharmony_ci     * @crossplatform
26161847f8eSopenharmony_ci     * @since 10
26261847f8eSopenharmony_ci     */
26361847f8eSopenharmony_ci    /**
26461847f8eSopenharmony_ci     * Read timeout period. The default value is 60,000, in ms.
26561847f8eSopenharmony_ci     * @type {?number}
26661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
26761847f8eSopenharmony_ci     * @crossplatform
26861847f8eSopenharmony_ci     * @atomicservice
26961847f8eSopenharmony_ci     * @since 11
27061847f8eSopenharmony_ci     */
27161847f8eSopenharmony_ci    readTimeout?: number;
27261847f8eSopenharmony_ci
27361847f8eSopenharmony_ci    /**
27461847f8eSopenharmony_ci     * Connection timeout interval. The default value is 60,000, in ms.
27561847f8eSopenharmony_ci     * @type {?number}
27661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
27761847f8eSopenharmony_ci     * @since 6
27861847f8eSopenharmony_ci     */
27961847f8eSopenharmony_ci    /**
28061847f8eSopenharmony_ci     * Connection timeout interval. The default value is 60,000, in ms.
28161847f8eSopenharmony_ci     * @type {?number}
28261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
28361847f8eSopenharmony_ci     * @crossplatform
28461847f8eSopenharmony_ci     * @since 10
28561847f8eSopenharmony_ci     */
28661847f8eSopenharmony_ci    /**
28761847f8eSopenharmony_ci     * Connection timeout interval. The default value is 60,000, in ms.
28861847f8eSopenharmony_ci     * @type {?number}
28961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
29061847f8eSopenharmony_ci     * @crossplatform
29161847f8eSopenharmony_ci     * @atomicservice
29261847f8eSopenharmony_ci     * @since 11
29361847f8eSopenharmony_ci     */
29461847f8eSopenharmony_ci    connectTimeout?: number;
29561847f8eSopenharmony_ci
29661847f8eSopenharmony_ci    /**
29761847f8eSopenharmony_ci     * default is automatically specified by the system.
29861847f8eSopenharmony_ci     * @type {?HttpProtocol}
29961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
30061847f8eSopenharmony_ci     * @since 9
30161847f8eSopenharmony_ci     */
30261847f8eSopenharmony_ci    /**
30361847f8eSopenharmony_ci     * default is automatically specified by the system.
30461847f8eSopenharmony_ci     * @type {?HttpProtocol}
30561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
30661847f8eSopenharmony_ci     * @crossplatform
30761847f8eSopenharmony_ci     * @since 10
30861847f8eSopenharmony_ci     */
30961847f8eSopenharmony_ci    /**
31061847f8eSopenharmony_ci     * default is automatically specified by the system.
31161847f8eSopenharmony_ci     * @type {?HttpProtocol}
31261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
31361847f8eSopenharmony_ci     * @crossplatform
31461847f8eSopenharmony_ci     * @atomicservice
31561847f8eSopenharmony_ci     * @since 11
31661847f8eSopenharmony_ci     */
31761847f8eSopenharmony_ci    usingProtocol?: HttpProtocol;
31861847f8eSopenharmony_ci
31961847f8eSopenharmony_ci    /**
32061847f8eSopenharmony_ci     * If this parameter is set as type of boolean, the system will use default proxy or not use proxy.
32161847f8eSopenharmony_ci     * If this parameter is set as type of HttpProxy, the system will use the specified HttpProxy.
32261847f8eSopenharmony_ci     * @type {?boolean | HttpProxy}
32361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
32461847f8eSopenharmony_ci     * @since 10
32561847f8eSopenharmony_ci     */
32661847f8eSopenharmony_ci    /**
32761847f8eSopenharmony_ci     * If this parameter is set as type of boolean, the system will use default proxy or not use proxy.
32861847f8eSopenharmony_ci     * If this parameter is set as type of HttpProxy, the system will use the specified HttpProxy.
32961847f8eSopenharmony_ci     * @type { ?(boolean | HttpProxy) }
33061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
33161847f8eSopenharmony_ci     * @atomicservice
33261847f8eSopenharmony_ci     * @since 11
33361847f8eSopenharmony_ci     */
33461847f8eSopenharmony_ci    /**
33561847f8eSopenharmony_ci     * If this parameter is set as type of boolean, the system will use default proxy or not use proxy.
33661847f8eSopenharmony_ci     * If this parameter is set as type of HttpProxy, the system will use the specified HttpProxy.
33761847f8eSopenharmony_ci     * @type { ?(boolean | HttpProxy) }
33861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
33961847f8eSopenharmony_ci     * @crossplatform
34061847f8eSopenharmony_ci     * @atomicservice
34161847f8eSopenharmony_ci     * @since 12
34261847f8eSopenharmony_ci     */
34361847f8eSopenharmony_ci    usingProxy?: boolean | HttpProxy;
34461847f8eSopenharmony_ci
34561847f8eSopenharmony_ci    /**
34661847f8eSopenharmony_ci     * If this parameter is set, the system will use ca path specified by user, or else use preset ca by the system. 
34761847f8eSopenharmony_ci     * @type {?string}
34861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
34961847f8eSopenharmony_ci     * @since 10
35061847f8eSopenharmony_ci     */
35161847f8eSopenharmony_ci    /**
35261847f8eSopenharmony_ci     * If this parameter is set, the system will use ca path specified by user, or else use preset ca by the system.
35361847f8eSopenharmony_ci     * @type {?string}
35461847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
35561847f8eSopenharmony_ci     * @atomicservice
35661847f8eSopenharmony_ci     * @since 11
35761847f8eSopenharmony_ci     */
35861847f8eSopenharmony_ci    /**
35961847f8eSopenharmony_ci     * If this parameter is set, the system will use ca path specified by user, or else use preset ca by the system.
36061847f8eSopenharmony_ci     * @type {?string}
36161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
36261847f8eSopenharmony_ci     * @crossplatform
36361847f8eSopenharmony_ci     * @atomicservice
36461847f8eSopenharmony_ci     * @since 12
36561847f8eSopenharmony_ci     */
36661847f8eSopenharmony_ci    caPath?: string;
36761847f8eSopenharmony_ci
36861847f8eSopenharmony_ci    /**
36961847f8eSopenharmony_ci     * Used to set to uploading or downloading the start bytes. The default value is 0.
37061847f8eSopenharmony_ci     * HTTP standard (RFC 7233 section 3.1) allows servers to ignore range requests.
37161847f8eSopenharmony_ci     * For HTTP PUT uploads this option should not be used, since it may conflict with other options.
37261847f8eSopenharmony_ci     * @type {?number}
37361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
37461847f8eSopenharmony_ci     * @since 11
37561847f8eSopenharmony_ci     */
37661847f8eSopenharmony_ci    /**
37761847f8eSopenharmony_ci     * Used to set to uploading or downloading the start bytes. The default value is 0.
37861847f8eSopenharmony_ci     * HTTP standard (RFC 7233 section 3.1) allows servers to ignore range requests.
37961847f8eSopenharmony_ci     * For HTTP PUT uploads this option should not be used, since it may conflict with other options.
38061847f8eSopenharmony_ci     * @type {?number}
38161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
38261847f8eSopenharmony_ci     * @crossplatform
38361847f8eSopenharmony_ci     * @since 12
38461847f8eSopenharmony_ci     */
38561847f8eSopenharmony_ci    resumeFrom?: number;
38661847f8eSopenharmony_ci
38761847f8eSopenharmony_ci    /**
38861847f8eSopenharmony_ci     * Used to set to uploading or downloading the end bytes. Translate to the end if not set.
38961847f8eSopenharmony_ci     * HTTP standard (RFC 7233 section 3.1) allows servers to ignore range requests.
39061847f8eSopenharmony_ci     * For HTTP PUT uploads this option should not be used, since it may conflict with other options.
39161847f8eSopenharmony_ci     * @type {?number}
39261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
39361847f8eSopenharmony_ci     * @since 11
39461847f8eSopenharmony_ci     */
39561847f8eSopenharmony_ci    /**
39661847f8eSopenharmony_ci     * Used to set to uploading or downloading the end bytes. Translate to the end if not set.
39761847f8eSopenharmony_ci     * HTTP standard (RFC 7233 section 3.1) allows servers to ignore range requests.
39861847f8eSopenharmony_ci     * For HTTP PUT uploads this option should not be used, since it may conflict with other options.
39961847f8eSopenharmony_ci     * @type {?number}
40061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
40161847f8eSopenharmony_ci     * @crossplatform
40261847f8eSopenharmony_ci     * @since 12
40361847f8eSopenharmony_ci     */
40461847f8eSopenharmony_ci    resumeTo?: number;
40561847f8eSopenharmony_ci
40661847f8eSopenharmony_ci    /**
40761847f8eSopenharmony_ci     * Support the application to pass in client certificates, allowing the server to verify the client's identity.
40861847f8eSopenharmony_ci     * @type {?ClientCert}
40961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
41061847f8eSopenharmony_ci     * @since 11
41161847f8eSopenharmony_ci     */
41261847f8eSopenharmony_ci    /**
41361847f8eSopenharmony_ci     * Support the application to pass in client certificates, allowing the server to verify the client's identity.
41461847f8eSopenharmony_ci     * @type {?ClientCert}
41561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
41661847f8eSopenharmony_ci     * @crossplatform
41761847f8eSopenharmony_ci     * @since 12
41861847f8eSopenharmony_ci     */
41961847f8eSopenharmony_ci    clientCert?: ClientCert;
42061847f8eSopenharmony_ci
42161847f8eSopenharmony_ci    /**
42261847f8eSopenharmony_ci     * If this parameter is set, incoming DNS resolution server URL for the DoH server to use for name resolving.
42361847f8eSopenharmony_ci     * The parameter must be URL-encoded in the following format: "https://host:port/path".
42461847f8eSopenharmony_ci     * It MUST specify an HTTPS URL.
42561847f8eSopenharmony_ci     * @type {?string}
42661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
42761847f8eSopenharmony_ci     * @since 11
42861847f8eSopenharmony_ci     */
42961847f8eSopenharmony_ci    /**
43061847f8eSopenharmony_ci     * If this parameter is set, incoming DNS resolution server URL for the DoH server to use for name resolving.
43161847f8eSopenharmony_ci     * The parameter must be URL-encoded in the following format: "https://host:port/path".
43261847f8eSopenharmony_ci     * It MUST specify an HTTPS URL.
43361847f8eSopenharmony_ci     * @type {?string}
43461847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
43561847f8eSopenharmony_ci     * @crossplatform
43661847f8eSopenharmony_ci     * @since 12
43761847f8eSopenharmony_ci     */
43861847f8eSopenharmony_ci    dnsOverHttps?: string;
43961847f8eSopenharmony_ci
44061847f8eSopenharmony_ci    /**
44161847f8eSopenharmony_ci     * If this parameter is set, use the specified DNS server for DNS resolution.
44261847f8eSopenharmony_ci     * Multiple DNS resolution servers can be set up, with a maximum of 3 servers.
44361847f8eSopenharmony_ci     * Only take the first three if there are more than three.
44461847f8eSopenharmony_ci     * @type {?Array<string>}
44561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
44661847f8eSopenharmony_ci     * @since 11
44761847f8eSopenharmony_ci     */
44861847f8eSopenharmony_ci    /**
44961847f8eSopenharmony_ci     * If this parameter is set, use the specified DNS server for DNS resolution.
45061847f8eSopenharmony_ci     * Multiple DNS resolution servers can be set up, with a maximum of 3 servers.
45161847f8eSopenharmony_ci     * Only take the first three if there are more than three.
45261847f8eSopenharmony_ci     * @type {?Array<string>}
45361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
45461847f8eSopenharmony_ci     * @crossplatform
45561847f8eSopenharmony_ci     * @since 12
45661847f8eSopenharmony_ci     */
45761847f8eSopenharmony_ci    dnsServers?: Array<string>;
45861847f8eSopenharmony_ci
45961847f8eSopenharmony_ci    /**
46061847f8eSopenharmony_ci     * The maximum limit of the response body. The default value is 5 * 1024 * 1024, in Byte.
46161847f8eSopenharmony_ci     * The maximum value is 100 * 1024 *1024, in Byte.
46261847f8eSopenharmony_ci     * @type {?number}
46361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
46461847f8eSopenharmony_ci     * @since 11
46561847f8eSopenharmony_ci     */
46661847f8eSopenharmony_ci    /**
46761847f8eSopenharmony_ci     * The maximum limit of the response body. The default value is 5 * 1024 * 1024, in Byte.
46861847f8eSopenharmony_ci     * The maximum value is 100 * 1024 *1024, in Byte.
46961847f8eSopenharmony_ci     * @type {?number}
47061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
47161847f8eSopenharmony_ci     * @crossplatform
47261847f8eSopenharmony_ci     * @since 12
47361847f8eSopenharmony_ci     */
47461847f8eSopenharmony_ci    maxLimit?: number;
47561847f8eSopenharmony_ci
47661847f8eSopenharmony_ci    /**
47761847f8eSopenharmony_ci     * The data fields which is supported by the HTTP protocol to post
47861847f8eSopenharmony_ci     * forms and by the SMTP and IMAP protocols to provide
47961847f8eSopenharmony_ci     * the email data to send/upload.
48061847f8eSopenharmony_ci     * @type {?Array<MultiFormData>}
48161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
48261847f8eSopenharmony_ci     * @since 11
48361847f8eSopenharmony_ci     */
48461847f8eSopenharmony_ci    /**
48561847f8eSopenharmony_ci     * The data fields which is supported by the HTTP protocol to post
48661847f8eSopenharmony_ci     * forms and by the SMTP and IMAP protocols to provide
48761847f8eSopenharmony_ci     * the email data to send/upload.
48861847f8eSopenharmony_ci     * @type {?Array<MultiFormData>}
48961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
49061847f8eSopenharmony_ci     * @crossplatform
49161847f8eSopenharmony_ci     * @since 12
49261847f8eSopenharmony_ci     */
49361847f8eSopenharmony_ci    multiFormDataList?: Array<MultiFormData>;
49461847f8eSopenharmony_ci
49561847f8eSopenharmony_ci    /**
49661847f8eSopenharmony_ci     * Certificate pinning option. If server certificate's digest does not match
49761847f8eSopenharmony_ci     * {@link CertificatePinning.publicKeyHash}, request will fail.
49861847f8eSopenharmony_ci     * @type {?(CertificatePinning | CertificatePinning[])}
49961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
50061847f8eSopenharmony_ci     * @since 12
50161847f8eSopenharmony_ci     */
50261847f8eSopenharmony_ci    certificatePinning?: CertificatePinning | CertificatePinning[];
50361847f8eSopenharmony_ci  }
50461847f8eSopenharmony_ci
50561847f8eSopenharmony_ci  /**
50661847f8eSopenharmony_ci   * Represents the properties of a form object.
50761847f8eSopenharmony_ci   * @interface MultiFormData
50861847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
50961847f8eSopenharmony_ci   * @since 11
51061847f8eSopenharmony_ci   */
51161847f8eSopenharmony_ci  /**
51261847f8eSopenharmony_ci   * Represents the properties of a form object.
51361847f8eSopenharmony_ci   * @interface MultiFormData
51461847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
51561847f8eSopenharmony_ci   * @crossplatform
51661847f8eSopenharmony_ci   * @since 12
51761847f8eSopenharmony_ci   */
51861847f8eSopenharmony_ci  export interface MultiFormData {
51961847f8eSopenharmony_ci    /**
52061847f8eSopenharmony_ci     * MIME name for the data field.
52161847f8eSopenharmony_ci     * @type {string}
52261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
52361847f8eSopenharmony_ci     * @since 11
52461847f8eSopenharmony_ci     */
52561847f8eSopenharmony_ci    /**
52661847f8eSopenharmony_ci     * MIME name for the data field.
52761847f8eSopenharmony_ci     * @type {string}
52861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
52961847f8eSopenharmony_ci     * @crossplatform
53061847f8eSopenharmony_ci     * @since 12
53161847f8eSopenharmony_ci     */
53261847f8eSopenharmony_ci    name: string;
53361847f8eSopenharmony_ci
53461847f8eSopenharmony_ci    /**
53561847f8eSopenharmony_ci     * Content type of the data field.
53661847f8eSopenharmony_ci     * @type {string}
53761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
53861847f8eSopenharmony_ci     * @since 11
53961847f8eSopenharmony_ci     */
54061847f8eSopenharmony_ci    /**
54161847f8eSopenharmony_ci     * Content type of the data field.
54261847f8eSopenharmony_ci     * @type {string}
54361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
54461847f8eSopenharmony_ci     * @crossplatform
54561847f8eSopenharmony_ci     * @since 12
54661847f8eSopenharmony_ci     */
54761847f8eSopenharmony_ci    contentType: string;
54861847f8eSopenharmony_ci
54961847f8eSopenharmony_ci    /**
55061847f8eSopenharmony_ci     * Remote file name for the data field.
55161847f8eSopenharmony_ci     * @type {?string}
55261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
55361847f8eSopenharmony_ci     * @since 11
55461847f8eSopenharmony_ci     */
55561847f8eSopenharmony_ci    /**
55661847f8eSopenharmony_ci     * Remote file name for the data field.
55761847f8eSopenharmony_ci     * @type {?string}
55861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
55961847f8eSopenharmony_ci     * @crossplatform
56061847f8eSopenharmony_ci     * @since 12
56161847f8eSopenharmony_ci     */
56261847f8eSopenharmony_ci    remoteFileName?: string;
56361847f8eSopenharmony_ci
56461847f8eSopenharmony_ci    /**
56561847f8eSopenharmony_ci     * This parameter sets a mime part's body content from memory data.
56661847f8eSopenharmony_ci     * @type {?(string | Object | ArrayBuffer)}
56761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
56861847f8eSopenharmony_ci     * @since 11
56961847f8eSopenharmony_ci     */
57061847f8eSopenharmony_ci    /**
57161847f8eSopenharmony_ci     * This parameter sets a mime part's body content from memory data.
57261847f8eSopenharmony_ci     * @type {?(string | Object | ArrayBuffer)}
57361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
57461847f8eSopenharmony_ci     * @crossplatform
57561847f8eSopenharmony_ci     * @since 12
57661847f8eSopenharmony_ci     */
57761847f8eSopenharmony_ci    data?: string | Object | ArrayBuffer;
57861847f8eSopenharmony_ci
57961847f8eSopenharmony_ci    /**
58061847f8eSopenharmony_ci     * This parameter sets a mime part's body content from the file's contents.
58161847f8eSopenharmony_ci     * This is an alternative to curl_mime_data for setting data to a mime part.
58261847f8eSopenharmony_ci     * If data is empty, filePath must be set.
58361847f8eSopenharmony_ci     * If data has a value, filePath does not take effect.
58461847f8eSopenharmony_ci     * @type {?string}
58561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
58661847f8eSopenharmony_ci     * @since 11
58761847f8eSopenharmony_ci     */
58861847f8eSopenharmony_ci    /**
58961847f8eSopenharmony_ci     * This parameter sets a mime part's body content from the file's contents.
59061847f8eSopenharmony_ci     * This is an alternative to curl_mime_data for setting data to a mime part.
59161847f8eSopenharmony_ci     * If data is empty, filePath must be set.
59261847f8eSopenharmony_ci     * If data has a value, filePath does not take effect.
59361847f8eSopenharmony_ci     * @type {?string}
59461847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
59561847f8eSopenharmony_ci     * @crossplatform
59661847f8eSopenharmony_ci     * @since 12
59761847f8eSopenharmony_ci     */
59861847f8eSopenharmony_ci    filePath?: string;
59961847f8eSopenharmony_ci  }
60061847f8eSopenharmony_ci
60161847f8eSopenharmony_ci  /**
60261847f8eSopenharmony_ci   * Enum for certificate types
60361847f8eSopenharmony_ci   * @enum {string}
60461847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
60561847f8eSopenharmony_ci   * @since 11
60661847f8eSopenharmony_ci   */
60761847f8eSopenharmony_ci  /**
60861847f8eSopenharmony_ci   * Enum for certificate types
60961847f8eSopenharmony_ci   * @enum {string}
61061847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
61161847f8eSopenharmony_ci   * @crossplatform
61261847f8eSopenharmony_ci   * @since 12
61361847f8eSopenharmony_ci   */
61461847f8eSopenharmony_ci  export enum CertType {
61561847f8eSopenharmony_ci    /**
61661847f8eSopenharmony_ci     * PEM format certificate
61761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
61861847f8eSopenharmony_ci     * @since 11
61961847f8eSopenharmony_ci     */
62061847f8eSopenharmony_ci    /**
62161847f8eSopenharmony_ci     * PEM format certificate
62261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
62361847f8eSopenharmony_ci     * @crossplatform
62461847f8eSopenharmony_ci     * @since 12
62561847f8eSopenharmony_ci     */
62661847f8eSopenharmony_ci    PEM = 'PEM',
62761847f8eSopenharmony_ci
62861847f8eSopenharmony_ci    /**
62961847f8eSopenharmony_ci     * DER format certificate
63061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
63161847f8eSopenharmony_ci     * @since 11
63261847f8eSopenharmony_ci     */
63361847f8eSopenharmony_ci    /**
63461847f8eSopenharmony_ci     * DER format certificate
63561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
63661847f8eSopenharmony_ci     * @crossplatform
63761847f8eSopenharmony_ci     * @since 12
63861847f8eSopenharmony_ci     */
63961847f8eSopenharmony_ci    DER = 'DER',
64061847f8eSopenharmony_ci
64161847f8eSopenharmony_ci    /**
64261847f8eSopenharmony_ci     * P12 format certificate
64361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
64461847f8eSopenharmony_ci     * @since 11
64561847f8eSopenharmony_ci     */
64661847f8eSopenharmony_ci    /**
64761847f8eSopenharmony_ci     * P12 format certificate
64861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
64961847f8eSopenharmony_ci     * @crossplatform
65061847f8eSopenharmony_ci     * @since 12
65161847f8eSopenharmony_ci     */
65261847f8eSopenharmony_ci    P12 = 'P12'
65361847f8eSopenharmony_ci  }
65461847f8eSopenharmony_ci
65561847f8eSopenharmony_ci  /**
65661847f8eSopenharmony_ci   * The clientCert field of the client certificate, which includes 4 attributes:
65761847f8eSopenharmony_ci   * client certificate (cert), client certificate type (certType), certificate private key (key), and passphrase (keyPassword).
65861847f8eSopenharmony_ci   * @interface ClientCert
65961847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
66061847f8eSopenharmony_ci   * @since 11
66161847f8eSopenharmony_ci   */
66261847f8eSopenharmony_ci  /**
66361847f8eSopenharmony_ci   * The clientCert field of the client certificate, which includes 4 attributes:
66461847f8eSopenharmony_ci   * client certificate (cert), client certificate type (certType), certificate private key (key), and passphrase (keyPassword).
66561847f8eSopenharmony_ci   * @interface ClientCert
66661847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
66761847f8eSopenharmony_ci   * @crossplatform
66861847f8eSopenharmony_ci   * @since 12
66961847f8eSopenharmony_ci   */
67061847f8eSopenharmony_ci  export interface ClientCert {
67161847f8eSopenharmony_ci    /**
67261847f8eSopenharmony_ci     * The path to the client certificate file.
67361847f8eSopenharmony_ci     * @type {string}
67461847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
67561847f8eSopenharmony_ci     * @since 11
67661847f8eSopenharmony_ci     */
67761847f8eSopenharmony_ci    /**
67861847f8eSopenharmony_ci     * The path to the client certificate file.
67961847f8eSopenharmony_ci     * @type {string}
68061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
68161847f8eSopenharmony_ci     * @crossplatform
68261847f8eSopenharmony_ci     * @since 12
68361847f8eSopenharmony_ci     */
68461847f8eSopenharmony_ci    certPath: string;
68561847f8eSopenharmony_ci
68661847f8eSopenharmony_ci    /**
68761847f8eSopenharmony_ci     * The type of the client certificate.
68861847f8eSopenharmony_ci     * @type {?CertType}
68961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
69061847f8eSopenharmony_ci     * @since 11
69161847f8eSopenharmony_ci     */
69261847f8eSopenharmony_ci    /**
69361847f8eSopenharmony_ci     * The type of the client certificate.
69461847f8eSopenharmony_ci     * @type {?CertType}
69561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
69661847f8eSopenharmony_ci     * @crossplatform
69761847f8eSopenharmony_ci     * @since 12
69861847f8eSopenharmony_ci     */
69961847f8eSopenharmony_ci    certType?: CertType;
70061847f8eSopenharmony_ci
70161847f8eSopenharmony_ci    /**
70261847f8eSopenharmony_ci     * The path of the client certificate private key file.
70361847f8eSopenharmony_ci     * @type {string}
70461847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
70561847f8eSopenharmony_ci     * @since 11
70661847f8eSopenharmony_ci     */
70761847f8eSopenharmony_ci    /**
70861847f8eSopenharmony_ci     * The path of the client certificate private key file.
70961847f8eSopenharmony_ci     * @type {string}
71061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
71161847f8eSopenharmony_ci     * @crossplatform
71261847f8eSopenharmony_ci     * @since 12
71361847f8eSopenharmony_ci     */
71461847f8eSopenharmony_ci    keyPath: string;
71561847f8eSopenharmony_ci
71661847f8eSopenharmony_ci    /**
71761847f8eSopenharmony_ci     * Password required to use the client certificate private key.
71861847f8eSopenharmony_ci     * @type {?string}
71961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
72061847f8eSopenharmony_ci     * @since 11
72161847f8eSopenharmony_ci     */
72261847f8eSopenharmony_ci    /**
72361847f8eSopenharmony_ci     * Password required to use the client certificate private key.
72461847f8eSopenharmony_ci     * @type {?string}
72561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
72661847f8eSopenharmony_ci     * @crossplatform
72761847f8eSopenharmony_ci     * @since 12
72861847f8eSopenharmony_ci     */
72961847f8eSopenharmony_ci    keyPassword?: string;
73061847f8eSopenharmony_ci  }
73161847f8eSopenharmony_ci
73261847f8eSopenharmony_ci  /**
73361847f8eSopenharmony_ci   * Certificate pinning option.
73461847f8eSopenharmony_ci   * @interface CertificatePinning
73561847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
73661847f8eSopenharmony_ci   * @since 12
73761847f8eSopenharmony_ci   */
73861847f8eSopenharmony_ci  interface CertificatePinning {
73961847f8eSopenharmony_ci    /**
74061847f8eSopenharmony_ci     * Public key hash.
74161847f8eSopenharmony_ci     * @type {string}
74261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
74361847f8eSopenharmony_ci     * @since 12
74461847f8eSopenharmony_ci     */
74561847f8eSopenharmony_ci    publicKeyHash: string;
74661847f8eSopenharmony_ci    /**
74761847f8eSopenharmony_ci     * Certificate public key hash algorithm.
74861847f8eSopenharmony_ci     * @type {'SHA-256'}
74961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
75061847f8eSopenharmony_ci     * @since 12
75161847f8eSopenharmony_ci     */
75261847f8eSopenharmony_ci    hashAlgorithm: 'SHA-256';
75361847f8eSopenharmony_ci  }
75461847f8eSopenharmony_ci
75561847f8eSopenharmony_ci  /**
75661847f8eSopenharmony_ci   * <p>Defines an HTTP request task. Before invoking APIs provided by HttpRequest,
75761847f8eSopenharmony_ci   * you must call createHttp() to create an HttpRequestTask object.</p>
75861847f8eSopenharmony_ci   * @interface HttpRequest
75961847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
76061847f8eSopenharmony_ci   * @since 6
76161847f8eSopenharmony_ci   */
76261847f8eSopenharmony_ci  /**
76361847f8eSopenharmony_ci   * <p>Defines an HTTP request task. Before invoking APIs provided by HttpRequest,
76461847f8eSopenharmony_ci   * you must call createHttp() to create an HttpRequestTask object.</p>
76561847f8eSopenharmony_ci   * @interface HttpRequest
76661847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
76761847f8eSopenharmony_ci   * @crossplatform
76861847f8eSopenharmony_ci   * @since 10
76961847f8eSopenharmony_ci   */
77061847f8eSopenharmony_ci  /**
77161847f8eSopenharmony_ci   * <p>Defines an HTTP request task. Before invoking APIs provided by HttpRequest,
77261847f8eSopenharmony_ci   * you must call createHttp() to create an HttpRequestTask object.</p>
77361847f8eSopenharmony_ci   * @interface HttpRequest
77461847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
77561847f8eSopenharmony_ci   * @crossplatform
77661847f8eSopenharmony_ci   * @atomicservice
77761847f8eSopenharmony_ci   * @since 11
77861847f8eSopenharmony_ci   */
77961847f8eSopenharmony_ci  export interface HttpRequest {
78061847f8eSopenharmony_ci    /**
78161847f8eSopenharmony_ci     * Initiates an HTTP request to a given URL.
78261847f8eSopenharmony_ci     * @permission ohos.permission.INTERNET
78361847f8eSopenharmony_ci     * @param { string } url - URL for initiating an HTTP request.
78461847f8eSopenharmony_ci     * @param { AsyncCallback<HttpResponse> } callback - the callback of request. 
78561847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error.
78661847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission denied.
78761847f8eSopenharmony_ci     * @throws { BusinessError } 2300001 - Unsupported protocol.
78861847f8eSopenharmony_ci     * @throws { BusinessError } 2300003 - Invalid URL format or missing URL.
78961847f8eSopenharmony_ci     * @throws { BusinessError } 2300005 - Failed to resolve the proxy name.
79061847f8eSopenharmony_ci     * @throws { BusinessError } 2300006 - Failed to resolve the host name.
79161847f8eSopenharmony_ci     * @throws { BusinessError } 2300007 - Failed to connect to the server.
79261847f8eSopenharmony_ci     * @throws { BusinessError } 2300008 - Invalid server response.
79361847f8eSopenharmony_ci     * @throws { BusinessError } 2300009 - Access to the remote resource denied.
79461847f8eSopenharmony_ci     * @throws { BusinessError } 2300016 - Error in the HTTP2 framing layer.
79561847f8eSopenharmony_ci     * @throws { BusinessError } 2300018 - Transferred a partial file.
79661847f8eSopenharmony_ci     * @throws { BusinessError } 2300023 - Failed to write the received data to the disk or application.
79761847f8eSopenharmony_ci     * @throws { BusinessError } 2300025 - Upload failed.
79861847f8eSopenharmony_ci     * @throws { BusinessError } 2300026 - Failed to open or read local data from the file or application.
79961847f8eSopenharmony_ci     * @throws { BusinessError } 2300027 - Out of memory.
80061847f8eSopenharmony_ci     * @throws { BusinessError } 2300028 - Operation timeout.
80161847f8eSopenharmony_ci     * @throws { BusinessError } 2300047 - The number of redirections reaches the maximum allowed.
80261847f8eSopenharmony_ci     * @throws { BusinessError } 2300052 - The server returned nothing (no header or data).
80361847f8eSopenharmony_ci     * @throws { BusinessError } 2300055 - Failed to send data to the peer.
80461847f8eSopenharmony_ci     * @throws { BusinessError } 2300056 - Failed to receive data from the peer.
80561847f8eSopenharmony_ci     * @throws { BusinessError } 2300058 - Local SSL certificate error.
80661847f8eSopenharmony_ci     * @throws { BusinessError } 2300059 - The specified SSL cipher cannot be used.
80761847f8eSopenharmony_ci     * @throws { BusinessError } 2300060 - Invalid SSL peer certificate or SSH remote key.
80861847f8eSopenharmony_ci     * @throws { BusinessError } 2300061 - Invalid HTTP encoding format.
80961847f8eSopenharmony_ci     * @throws { BusinessError } 2300063 - Maximum file size exceeded.
81061847f8eSopenharmony_ci     * @throws { BusinessError } 2300070 - Remote disk full.
81161847f8eSopenharmony_ci     * @throws { BusinessError } 2300073 - Remote file already exists.
81261847f8eSopenharmony_ci     * @throws { BusinessError } 2300077 - The SSL CA certificate does not exist or is inaccessible.
81361847f8eSopenharmony_ci     * @throws { BusinessError } 2300078 - Remote file not found.
81461847f8eSopenharmony_ci     * @throws { BusinessError } 2300094 - Authentication error.
81561847f8eSopenharmony_ci     * @throws { BusinessError } 2300999 - Unknown error.
81661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
81761847f8eSopenharmony_ci     * @since 6
81861847f8eSopenharmony_ci     */
81961847f8eSopenharmony_ci    /**
82061847f8eSopenharmony_ci     * Initiates an HTTP request to a given URL.
82161847f8eSopenharmony_ci     * @permission ohos.permission.INTERNET
82261847f8eSopenharmony_ci     * @param { string } url - URL for initiating an HTTP request.
82361847f8eSopenharmony_ci     * @param { AsyncCallback<HttpResponse> } callback - the callback of request.
82461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error.
82561847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission denied.
82661847f8eSopenharmony_ci     * @throws { BusinessError } 2300001 - Unsupported protocol.
82761847f8eSopenharmony_ci     * @throws { BusinessError } 2300003 - Invalid URL format or missing URL.
82861847f8eSopenharmony_ci     * @throws { BusinessError } 2300005 - Failed to resolve the proxy name.
82961847f8eSopenharmony_ci     * @throws { BusinessError } 2300006 - Failed to resolve the host name.
83061847f8eSopenharmony_ci     * @throws { BusinessError } 2300007 - Failed to connect to the server.
83161847f8eSopenharmony_ci     * @throws { BusinessError } 2300008 - Invalid server response.
83261847f8eSopenharmony_ci     * @throws { BusinessError } 2300009 - Access to the remote resource denied.
83361847f8eSopenharmony_ci     * @throws { BusinessError } 2300016 - Error in the HTTP2 framing layer.
83461847f8eSopenharmony_ci     * @throws { BusinessError } 2300018 - Transferred a partial file.
83561847f8eSopenharmony_ci     * @throws { BusinessError } 2300023 - Failed to write the received data to the disk or application.
83661847f8eSopenharmony_ci     * @throws { BusinessError } 2300025 - Upload failed.
83761847f8eSopenharmony_ci     * @throws { BusinessError } 2300026 - Failed to open or read local data from the file or application.
83861847f8eSopenharmony_ci     * @throws { BusinessError } 2300027 - Out of memory.
83961847f8eSopenharmony_ci     * @throws { BusinessError } 2300028 - Operation timeout.
84061847f8eSopenharmony_ci     * @throws { BusinessError } 2300047 - The number of redirections reaches the maximum allowed.
84161847f8eSopenharmony_ci     * @throws { BusinessError } 2300052 - The server returned nothing (no header or data).
84261847f8eSopenharmony_ci     * @throws { BusinessError } 2300055 - Failed to send data to the peer.
84361847f8eSopenharmony_ci     * @throws { BusinessError } 2300056 - Failed to receive data from the peer.
84461847f8eSopenharmony_ci     * @throws { BusinessError } 2300058 - Local SSL certificate error.
84561847f8eSopenharmony_ci     * @throws { BusinessError } 2300059 - The specified SSL cipher cannot be used.
84661847f8eSopenharmony_ci     * @throws { BusinessError } 2300060 - Invalid SSL peer certificate or SSH remote key.
84761847f8eSopenharmony_ci     * @throws { BusinessError } 2300061 - Invalid HTTP encoding format.
84861847f8eSopenharmony_ci     * @throws { BusinessError } 2300063 - Maximum file size exceeded.
84961847f8eSopenharmony_ci     * @throws { BusinessError } 2300070 - Remote disk full.
85061847f8eSopenharmony_ci     * @throws { BusinessError } 2300073 - Remote file already exists.
85161847f8eSopenharmony_ci     * @throws { BusinessError } 2300077 - The SSL CA certificate does not exist or is inaccessible.
85261847f8eSopenharmony_ci     * @throws { BusinessError } 2300078 - Remote file not found.
85361847f8eSopenharmony_ci     * @throws { BusinessError } 2300094 - Authentication error.
85461847f8eSopenharmony_ci     * @throws { BusinessError } 2300999 - Unknown error.
85561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
85661847f8eSopenharmony_ci     * @crossplatform
85761847f8eSopenharmony_ci     * @since 10
85861847f8eSopenharmony_ci     */
85961847f8eSopenharmony_ci    /**
86061847f8eSopenharmony_ci     * Initiates an HTTP request to a given URL.
86161847f8eSopenharmony_ci     * @permission ohos.permission.INTERNET
86261847f8eSopenharmony_ci     * @param { string } url - URL for initiating an HTTP request.
86361847f8eSopenharmony_ci     * @param { AsyncCallback<HttpResponse> } callback - the callback of request.
86461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error.
86561847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission denied.
86661847f8eSopenharmony_ci     * @throws { BusinessError } 2300001 - Unsupported protocol.
86761847f8eSopenharmony_ci     * @throws { BusinessError } 2300003 - Invalid URL format or missing URL.
86861847f8eSopenharmony_ci     * @throws { BusinessError } 2300005 - Failed to resolve the proxy name.
86961847f8eSopenharmony_ci     * @throws { BusinessError } 2300006 - Failed to resolve the host name.
87061847f8eSopenharmony_ci     * @throws { BusinessError } 2300007 - Failed to connect to the server.
87161847f8eSopenharmony_ci     * @throws { BusinessError } 2300008 - Invalid server response.
87261847f8eSopenharmony_ci     * @throws { BusinessError } 2300009 - Access to the remote resource denied.
87361847f8eSopenharmony_ci     * @throws { BusinessError } 2300016 - Error in the HTTP2 framing layer.
87461847f8eSopenharmony_ci     * @throws { BusinessError } 2300018 - Transferred a partial file.
87561847f8eSopenharmony_ci     * @throws { BusinessError } 2300023 - Failed to write the received data to the disk or application.
87661847f8eSopenharmony_ci     * @throws { BusinessError } 2300025 - Upload failed.
87761847f8eSopenharmony_ci     * @throws { BusinessError } 2300026 - Failed to open or read local data from the file or application.
87861847f8eSopenharmony_ci     * @throws { BusinessError } 2300027 - Out of memory.
87961847f8eSopenharmony_ci     * @throws { BusinessError } 2300028 - Operation timeout.
88061847f8eSopenharmony_ci     * @throws { BusinessError } 2300047 - The number of redirections reaches the maximum allowed.
88161847f8eSopenharmony_ci     * @throws { BusinessError } 2300052 - The server returned nothing (no header or data).
88261847f8eSopenharmony_ci     * @throws { BusinessError } 2300055 - Failed to send data to the peer.
88361847f8eSopenharmony_ci     * @throws { BusinessError } 2300056 - Failed to receive data from the peer.
88461847f8eSopenharmony_ci     * @throws { BusinessError } 2300058 - Local SSL certificate error.
88561847f8eSopenharmony_ci     * @throws { BusinessError } 2300059 - The specified SSL cipher cannot be used.
88661847f8eSopenharmony_ci     * @throws { BusinessError } 2300060 - Invalid SSL peer certificate or SSH remote key.
88761847f8eSopenharmony_ci     * @throws { BusinessError } 2300061 - Invalid HTTP encoding format.
88861847f8eSopenharmony_ci     * @throws { BusinessError } 2300063 - Maximum file size exceeded.
88961847f8eSopenharmony_ci     * @throws { BusinessError } 2300070 - Remote disk full.
89061847f8eSopenharmony_ci     * @throws { BusinessError } 2300073 - Remote file already exists.
89161847f8eSopenharmony_ci     * @throws { BusinessError } 2300077 - The SSL CA certificate does not exist or is inaccessible.
89261847f8eSopenharmony_ci     * @throws { BusinessError } 2300078 - Remote file not found.
89361847f8eSopenharmony_ci     * @throws { BusinessError } 2300094 - Authentication error.
89461847f8eSopenharmony_ci     * @throws { BusinessError } 2300999 - Unknown error.
89561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
89661847f8eSopenharmony_ci     * @crossplatform
89761847f8eSopenharmony_ci     * @atomicservice
89861847f8eSopenharmony_ci     * @since 11
89961847f8eSopenharmony_ci     */
90061847f8eSopenharmony_ci    request(url: string, callback: AsyncCallback<HttpResponse>): void;
90161847f8eSopenharmony_ci
90261847f8eSopenharmony_ci    /**
90361847f8eSopenharmony_ci     * Initiates an HTTP request to a given URL.
90461847f8eSopenharmony_ci     * @permission ohos.permission.INTERNET
90561847f8eSopenharmony_ci     * @param { string } url - URL for initiating an HTTP request.
90661847f8eSopenharmony_ci     * @param { HttpRequestOptions } options - Optional parameters {@link HttpRequestOptions}.
90761847f8eSopenharmony_ci     * @param { AsyncCallback<HttpResponse> } callback - the callback of request..
90861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error.
90961847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission denied.
91061847f8eSopenharmony_ci     * @throws { BusinessError } 2300001 - Unsupported protocol.
91161847f8eSopenharmony_ci     * @throws { BusinessError } 2300003 - Invalid URL format or missing URL.
91261847f8eSopenharmony_ci     * @throws { BusinessError } 2300005 - Failed to resolve the proxy name.
91361847f8eSopenharmony_ci     * @throws { BusinessError } 2300006 - Failed to resolve the host name.
91461847f8eSopenharmony_ci     * @throws { BusinessError } 2300007 - Failed to connect to the server.
91561847f8eSopenharmony_ci     * @throws { BusinessError } 2300008 - Invalid server response.
91661847f8eSopenharmony_ci     * @throws { BusinessError } 2300009 - Access to the remote resource denied.
91761847f8eSopenharmony_ci     * @throws { BusinessError } 2300016 - Error in the HTTP2 framing layer.
91861847f8eSopenharmony_ci     * @throws { BusinessError } 2300018 - Transferred a partial file.
91961847f8eSopenharmony_ci     * @throws { BusinessError } 2300023 - Failed to write the received data to the disk or application.
92061847f8eSopenharmony_ci     * @throws { BusinessError } 2300025 - Upload failed.
92161847f8eSopenharmony_ci     * @throws { BusinessError } 2300026 - Failed to open or read local data from the file or application.
92261847f8eSopenharmony_ci     * @throws { BusinessError } 2300027 - Out of memory.
92361847f8eSopenharmony_ci     * @throws { BusinessError } 2300028 - Operation timeout.
92461847f8eSopenharmony_ci     * @throws { BusinessError } 2300047 - The number of redirections reaches the maximum allowed.
92561847f8eSopenharmony_ci     * @throws { BusinessError } 2300052 - The server returned nothing (no header or data).
92661847f8eSopenharmony_ci     * @throws { BusinessError } 2300055 - Failed to send data to the peer.
92761847f8eSopenharmony_ci     * @throws { BusinessError } 2300056 - Failed to receive data from the peer.
92861847f8eSopenharmony_ci     * @throws { BusinessError } 2300058 - Local SSL certificate error.
92961847f8eSopenharmony_ci     * @throws { BusinessError } 2300059 - The specified SSL cipher cannot be used.
93061847f8eSopenharmony_ci     * @throws { BusinessError } 2300060 - Invalid SSL peer certificate or SSH remote key.
93161847f8eSopenharmony_ci     * @throws { BusinessError } 2300061 - Invalid HTTP encoding format.
93261847f8eSopenharmony_ci     * @throws { BusinessError } 2300063 - Maximum file size exceeded.
93361847f8eSopenharmony_ci     * @throws { BusinessError } 2300070 - Remote disk full.
93461847f8eSopenharmony_ci     * @throws { BusinessError } 2300073 - Remote file already exists.
93561847f8eSopenharmony_ci     * @throws { BusinessError } 2300077 - The SSL CA certificate does not exist or is inaccessible.
93661847f8eSopenharmony_ci     * @throws { BusinessError } 2300078 - Remote file not found.
93761847f8eSopenharmony_ci     * @throws { BusinessError } 2300094 - Authentication error.
93861847f8eSopenharmony_ci     * @throws { BusinessError } 2300999 - Unknown error.
93961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
94061847f8eSopenharmony_ci     * @since 6
94161847f8eSopenharmony_ci     */
94261847f8eSopenharmony_ci    /**
94361847f8eSopenharmony_ci     * Initiates an HTTP request to a given URL.
94461847f8eSopenharmony_ci     * @permission ohos.permission.INTERNET
94561847f8eSopenharmony_ci     * @param { string } url - URL for initiating an HTTP request.
94661847f8eSopenharmony_ci     * @param { HttpRequestOptions } options - Optional parameters {@link HttpRequestOptions}.
94761847f8eSopenharmony_ci     * @param { AsyncCallback<HttpResponse> } callback - the callback of request.
94861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error.
94961847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission denied.
95061847f8eSopenharmony_ci     * @throws { BusinessError } 2300001 - Unsupported protocol.
95161847f8eSopenharmony_ci     * @throws { BusinessError } 2300003 - Invalid URL format or missing URL.
95261847f8eSopenharmony_ci     * @throws { BusinessError } 2300005 - Failed to resolve the proxy name.
95361847f8eSopenharmony_ci     * @throws { BusinessError } 2300006 - Failed to resolve the host name.
95461847f8eSopenharmony_ci     * @throws { BusinessError } 2300007 - Failed to connect to the server.
95561847f8eSopenharmony_ci     * @throws { BusinessError } 2300008 - Invalid server response.
95661847f8eSopenharmony_ci     * @throws { BusinessError } 2300009 - Access to the remote resource denied.
95761847f8eSopenharmony_ci     * @throws { BusinessError } 2300016 - Error in the HTTP2 framing layer.
95861847f8eSopenharmony_ci     * @throws { BusinessError } 2300018 - Transferred a partial file.
95961847f8eSopenharmony_ci     * @throws { BusinessError } 2300023 - Failed to write the received data to the disk or application.
96061847f8eSopenharmony_ci     * @throws { BusinessError } 2300025 - Upload failed.
96161847f8eSopenharmony_ci     * @throws { BusinessError } 2300026 - Failed to open or read local data from the file or application.
96261847f8eSopenharmony_ci     * @throws { BusinessError } 2300027 - Out of memory.
96361847f8eSopenharmony_ci     * @throws { BusinessError } 2300028 - Operation timeout.
96461847f8eSopenharmony_ci     * @throws { BusinessError } 2300047 - The number of redirections reaches the maximum allowed.
96561847f8eSopenharmony_ci     * @throws { BusinessError } 2300052 - The server returned nothing (no header or data).
96661847f8eSopenharmony_ci     * @throws { BusinessError } 2300055 - Failed to send data to the peer.
96761847f8eSopenharmony_ci     * @throws { BusinessError } 2300056 - Failed to receive data from the peer.
96861847f8eSopenharmony_ci     * @throws { BusinessError } 2300058 - Local SSL certificate error.
96961847f8eSopenharmony_ci     * @throws { BusinessError } 2300059 - The specified SSL cipher cannot be used.
97061847f8eSopenharmony_ci     * @throws { BusinessError } 2300060 - Invalid SSL peer certificate or SSH remote key.
97161847f8eSopenharmony_ci     * @throws { BusinessError } 2300061 - Invalid HTTP encoding format.
97261847f8eSopenharmony_ci     * @throws { BusinessError } 2300063 - Maximum file size exceeded.
97361847f8eSopenharmony_ci     * @throws { BusinessError } 2300070 - Remote disk full.
97461847f8eSopenharmony_ci     * @throws { BusinessError } 2300073 - Remote file already exists.
97561847f8eSopenharmony_ci     * @throws { BusinessError } 2300077 - The SSL CA certificate does not exist or is inaccessible.
97661847f8eSopenharmony_ci     * @throws { BusinessError } 2300078 - Remote file not found.
97761847f8eSopenharmony_ci     * @throws { BusinessError } 2300094 - Authentication error.
97861847f8eSopenharmony_ci     * @throws { BusinessError } 2300999 - Unknown error.
97961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
98061847f8eSopenharmony_ci     * @crossplatform
98161847f8eSopenharmony_ci     * @since 10
98261847f8eSopenharmony_ci     */
98361847f8eSopenharmony_ci    /**
98461847f8eSopenharmony_ci     * Initiates an HTTP request to a given URL.
98561847f8eSopenharmony_ci     * @permission ohos.permission.INTERNET
98661847f8eSopenharmony_ci     * @param { string } url - URL for initiating an HTTP request.
98761847f8eSopenharmony_ci     * @param { HttpRequestOptions } options - Optional parameters {@link HttpRequestOptions}.
98861847f8eSopenharmony_ci     * @param { AsyncCallback<HttpResponse> } callback - the callback of request.
98961847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error.
99061847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission denied.
99161847f8eSopenharmony_ci     * @throws { BusinessError } 2300001 - Unsupported protocol.
99261847f8eSopenharmony_ci     * @throws { BusinessError } 2300003 - Invalid URL format or missing URL.
99361847f8eSopenharmony_ci     * @throws { BusinessError } 2300005 - Failed to resolve the proxy name.
99461847f8eSopenharmony_ci     * @throws { BusinessError } 2300006 - Failed to resolve the host name.
99561847f8eSopenharmony_ci     * @throws { BusinessError } 2300007 - Failed to connect to the server.
99661847f8eSopenharmony_ci     * @throws { BusinessError } 2300008 - Invalid server response.
99761847f8eSopenharmony_ci     * @throws { BusinessError } 2300009 - Access to the remote resource denied.
99861847f8eSopenharmony_ci     * @throws { BusinessError } 2300016 - Error in the HTTP2 framing layer.
99961847f8eSopenharmony_ci     * @throws { BusinessError } 2300018 - Transferred a partial file.
100061847f8eSopenharmony_ci     * @throws { BusinessError } 2300023 - Failed to write the received data to the disk or application.
100161847f8eSopenharmony_ci     * @throws { BusinessError } 2300025 - Upload failed.
100261847f8eSopenharmony_ci     * @throws { BusinessError } 2300026 - Failed to open or read local data from the file or application.
100361847f8eSopenharmony_ci     * @throws { BusinessError } 2300027 - Out of memory.
100461847f8eSopenharmony_ci     * @throws { BusinessError } 2300028 - Operation timeout.
100561847f8eSopenharmony_ci     * @throws { BusinessError } 2300047 - The number of redirections reaches the maximum allowed.
100661847f8eSopenharmony_ci     * @throws { BusinessError } 2300052 - The server returned nothing (no header or data).
100761847f8eSopenharmony_ci     * @throws { BusinessError } 2300055 - Failed to send data to the peer.
100861847f8eSopenharmony_ci     * @throws { BusinessError } 2300056 - Failed to receive data from the peer.
100961847f8eSopenharmony_ci     * @throws { BusinessError } 2300058 - Local SSL certificate error.
101061847f8eSopenharmony_ci     * @throws { BusinessError } 2300059 - The specified SSL cipher cannot be used.
101161847f8eSopenharmony_ci     * @throws { BusinessError } 2300060 - Invalid SSL peer certificate or SSH remote key.
101261847f8eSopenharmony_ci     * @throws { BusinessError } 2300061 - Invalid HTTP encoding format.
101361847f8eSopenharmony_ci     * @throws { BusinessError } 2300063 - Maximum file size exceeded.
101461847f8eSopenharmony_ci     * @throws { BusinessError } 2300070 - Remote disk full.
101561847f8eSopenharmony_ci     * @throws { BusinessError } 2300073 - Remote file already exists.
101661847f8eSopenharmony_ci     * @throws { BusinessError } 2300077 - The SSL CA certificate does not exist or is inaccessible.
101761847f8eSopenharmony_ci     * @throws { BusinessError } 2300078 - Remote file not found.
101861847f8eSopenharmony_ci     * @throws { BusinessError } 2300094 - Authentication error.
101961847f8eSopenharmony_ci     * @throws { BusinessError } 2300999 - Unknown error.
102061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
102161847f8eSopenharmony_ci     * @crossplatform
102261847f8eSopenharmony_ci     * @atomicservice
102361847f8eSopenharmony_ci     * @since 11
102461847f8eSopenharmony_ci     */
102561847f8eSopenharmony_ci    request(url: string, options: HttpRequestOptions, callback: AsyncCallback<HttpResponse>): void;
102661847f8eSopenharmony_ci
102761847f8eSopenharmony_ci    /**
102861847f8eSopenharmony_ci     * Initiates an HTTP request to a given URL.
102961847f8eSopenharmony_ci     * @permission ohos.permission.INTERNET
103061847f8eSopenharmony_ci     * @param { string } url - URL for initiating an HTTP request.
103161847f8eSopenharmony_ci     * @param { HttpRequestOptions } [options] - Optional parameters {@link HttpRequestOptions}.
103261847f8eSopenharmony_ci     * @returns { Promise<HttpResponse> } The promise returned by the function. 
103361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error.
103461847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission denied.
103561847f8eSopenharmony_ci     * @throws { BusinessError } 2300001 - Unsupported protocol.
103661847f8eSopenharmony_ci     * @throws { BusinessError } 2300003 - Invalid URL format or missing URL.
103761847f8eSopenharmony_ci     * @throws { BusinessError } 2300005 - Failed to resolve the proxy name.
103861847f8eSopenharmony_ci     * @throws { BusinessError } 2300006 - Failed to resolve the host name.
103961847f8eSopenharmony_ci     * @throws { BusinessError } 2300007 - Failed to connect to the server.
104061847f8eSopenharmony_ci     * @throws { BusinessError } 2300008 - Invalid server response.
104161847f8eSopenharmony_ci     * @throws { BusinessError } 2300009 - Access to the remote resource denied.
104261847f8eSopenharmony_ci     * @throws { BusinessError } 2300016 - Error in the HTTP2 framing layer.
104361847f8eSopenharmony_ci     * @throws { BusinessError } 2300018 - Transferred a partial file.
104461847f8eSopenharmony_ci     * @throws { BusinessError } 2300023 - Failed to write the received data to the disk or application.
104561847f8eSopenharmony_ci     * @throws { BusinessError } 2300025 - Upload failed.
104661847f8eSopenharmony_ci     * @throws { BusinessError } 2300026 - Failed to open or read local data from the file or application.
104761847f8eSopenharmony_ci     * @throws { BusinessError } 2300027 - Out of memory.
104861847f8eSopenharmony_ci     * @throws { BusinessError } 2300028 - Operation timeout.
104961847f8eSopenharmony_ci     * @throws { BusinessError } 2300047 - The number of redirections reaches the maximum allowed.
105061847f8eSopenharmony_ci     * @throws { BusinessError } 2300052 - The server returned nothing (no header or data).
105161847f8eSopenharmony_ci     * @throws { BusinessError } 2300055 - Failed to send data to the peer.
105261847f8eSopenharmony_ci     * @throws { BusinessError } 2300056 - Failed to receive data from the peer.
105361847f8eSopenharmony_ci     * @throws { BusinessError } 2300058 - Local SSL certificate error.
105461847f8eSopenharmony_ci     * @throws { BusinessError } 2300059 - The specified SSL cipher cannot be used.
105561847f8eSopenharmony_ci     * @throws { BusinessError } 2300060 - Invalid SSL peer certificate or SSH remote key.
105661847f8eSopenharmony_ci     * @throws { BusinessError } 2300061 - Invalid HTTP encoding format.
105761847f8eSopenharmony_ci     * @throws { BusinessError } 2300063 - Maximum file size exceeded.
105861847f8eSopenharmony_ci     * @throws { BusinessError } 2300070 - Remote disk full.
105961847f8eSopenharmony_ci     * @throws { BusinessError } 2300073 - Remote file already exists.
106061847f8eSopenharmony_ci     * @throws { BusinessError } 2300077 - The SSL CA certificate does not exist or is inaccessible.
106161847f8eSopenharmony_ci     * @throws { BusinessError } 2300078 - Remote file not found.
106261847f8eSopenharmony_ci     * @throws { BusinessError } 2300094 - Authentication error.
106361847f8eSopenharmony_ci     * @throws { BusinessError } 2300999 - Unknown error.
106461847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
106561847f8eSopenharmony_ci     * @since 6
106661847f8eSopenharmony_ci     */
106761847f8eSopenharmony_ci    /**
106861847f8eSopenharmony_ci     * Initiates an HTTP request to a given URL.
106961847f8eSopenharmony_ci     * @permission ohos.permission.INTERNET
107061847f8eSopenharmony_ci     * @param { string } url - URL for initiating an HTTP request.
107161847f8eSopenharmony_ci     * @param { HttpRequestOptions } [options] - Optional parameters {@link HttpRequestOptions}.
107261847f8eSopenharmony_ci     * @returns { Promise<HttpResponse> } The promise returned by the function. 
107361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error.
107461847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission denied.
107561847f8eSopenharmony_ci     * @throws { BusinessError } 2300001 - Unsupported protocol.
107661847f8eSopenharmony_ci     * @throws { BusinessError } 2300003 - Invalid URL format or missing URL.
107761847f8eSopenharmony_ci     * @throws { BusinessError } 2300005 - Failed to resolve the proxy name.
107861847f8eSopenharmony_ci     * @throws { BusinessError } 2300006 - Failed to resolve the host name.
107961847f8eSopenharmony_ci     * @throws { BusinessError } 2300007 - Failed to connect to the server.
108061847f8eSopenharmony_ci     * @throws { BusinessError } 2300008 - Invalid server response.
108161847f8eSopenharmony_ci     * @throws { BusinessError } 2300009 - Access to the remote resource denied.
108261847f8eSopenharmony_ci     * @throws { BusinessError } 2300016 - Error in the HTTP2 framing layer.
108361847f8eSopenharmony_ci     * @throws { BusinessError } 2300018 - Transferred a partial file.
108461847f8eSopenharmony_ci     * @throws { BusinessError } 2300023 - Failed to write the received data to the disk or application.
108561847f8eSopenharmony_ci     * @throws { BusinessError } 2300025 - Upload failed.
108661847f8eSopenharmony_ci     * @throws { BusinessError } 2300026 - Failed to open or read local data from the file or application.
108761847f8eSopenharmony_ci     * @throws { BusinessError } 2300027 - Out of memory.
108861847f8eSopenharmony_ci     * @throws { BusinessError } 2300028 - Operation timeout.
108961847f8eSopenharmony_ci     * @throws { BusinessError } 2300047 - The number of redirections reaches the maximum allowed.
109061847f8eSopenharmony_ci     * @throws { BusinessError } 2300052 - The server returned nothing (no header or data).
109161847f8eSopenharmony_ci     * @throws { BusinessError } 2300055 - Failed to send data to the peer.
109261847f8eSopenharmony_ci     * @throws { BusinessError } 2300056 - Failed to receive data from the peer.
109361847f8eSopenharmony_ci     * @throws { BusinessError } 2300058 - Local SSL certificate error.
109461847f8eSopenharmony_ci     * @throws { BusinessError } 2300059 - The specified SSL cipher cannot be used.
109561847f8eSopenharmony_ci     * @throws { BusinessError } 2300060 - Invalid SSL peer certificate or SSH remote key.
109661847f8eSopenharmony_ci     * @throws { BusinessError } 2300061 - Invalid HTTP encoding format.
109761847f8eSopenharmony_ci     * @throws { BusinessError } 2300063 - Maximum file size exceeded.
109861847f8eSopenharmony_ci     * @throws { BusinessError } 2300070 - Remote disk full.
109961847f8eSopenharmony_ci     * @throws { BusinessError } 2300073 - Remote file already exists.
110061847f8eSopenharmony_ci     * @throws { BusinessError } 2300077 - The SSL CA certificate does not exist or is inaccessible.
110161847f8eSopenharmony_ci     * @throws { BusinessError } 2300078 - Remote file not found.
110261847f8eSopenharmony_ci     * @throws { BusinessError } 2300094 - Authentication error.
110361847f8eSopenharmony_ci     * @throws { BusinessError } 2300999 - Unknown error.
110461847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
110561847f8eSopenharmony_ci     * @crossplatform
110661847f8eSopenharmony_ci     * @since 10
110761847f8eSopenharmony_ci     */
110861847f8eSopenharmony_ci    /**
110961847f8eSopenharmony_ci     * Initiates an HTTP request to a given URL.
111061847f8eSopenharmony_ci     * @permission ohos.permission.INTERNET
111161847f8eSopenharmony_ci     * @param { string } url - URL for initiating an HTTP request.
111261847f8eSopenharmony_ci     * @param { HttpRequestOptions } [options] - Optional parameters {@link HttpRequestOptions}.
111361847f8eSopenharmony_ci     * @returns { Promise<HttpResponse> } The promise returned by the function.
111461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error.
111561847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission denied.
111661847f8eSopenharmony_ci     * @throws { BusinessError } 2300001 - Unsupported protocol.
111761847f8eSopenharmony_ci     * @throws { BusinessError } 2300003 - Invalid URL format or missing URL.
111861847f8eSopenharmony_ci     * @throws { BusinessError } 2300005 - Failed to resolve the proxy name.
111961847f8eSopenharmony_ci     * @throws { BusinessError } 2300006 - Failed to resolve the host name.
112061847f8eSopenharmony_ci     * @throws { BusinessError } 2300007 - Failed to connect to the server.
112161847f8eSopenharmony_ci     * @throws { BusinessError } 2300008 - Invalid server response.
112261847f8eSopenharmony_ci     * @throws { BusinessError } 2300009 - Access to the remote resource denied.
112361847f8eSopenharmony_ci     * @throws { BusinessError } 2300016 - Error in the HTTP2 framing layer.
112461847f8eSopenharmony_ci     * @throws { BusinessError } 2300018 - Transferred a partial file.
112561847f8eSopenharmony_ci     * @throws { BusinessError } 2300023 - Failed to write the received data to the disk or application.
112661847f8eSopenharmony_ci     * @throws { BusinessError } 2300025 - Upload failed.
112761847f8eSopenharmony_ci     * @throws { BusinessError } 2300026 - Failed to open or read local data from the file or application.
112861847f8eSopenharmony_ci     * @throws { BusinessError } 2300027 - Out of memory.
112961847f8eSopenharmony_ci     * @throws { BusinessError } 2300028 - Operation timeout.
113061847f8eSopenharmony_ci     * @throws { BusinessError } 2300047 - The number of redirections reaches the maximum allowed.
113161847f8eSopenharmony_ci     * @throws { BusinessError } 2300052 - The server returned nothing (no header or data).
113261847f8eSopenharmony_ci     * @throws { BusinessError } 2300055 - Failed to send data to the peer.
113361847f8eSopenharmony_ci     * @throws { BusinessError } 2300056 - Failed to receive data from the peer.
113461847f8eSopenharmony_ci     * @throws { BusinessError } 2300058 - Local SSL certificate error.
113561847f8eSopenharmony_ci     * @throws { BusinessError } 2300059 - The specified SSL cipher cannot be used.
113661847f8eSopenharmony_ci     * @throws { BusinessError } 2300060 - Invalid SSL peer certificate or SSH remote key.
113761847f8eSopenharmony_ci     * @throws { BusinessError } 2300061 - Invalid HTTP encoding format.
113861847f8eSopenharmony_ci     * @throws { BusinessError } 2300063 - Maximum file size exceeded.
113961847f8eSopenharmony_ci     * @throws { BusinessError } 2300070 - Remote disk full.
114061847f8eSopenharmony_ci     * @throws { BusinessError } 2300073 - Remote file already exists.
114161847f8eSopenharmony_ci     * @throws { BusinessError } 2300077 - The SSL CA certificate does not exist or is inaccessible.
114261847f8eSopenharmony_ci     * @throws { BusinessError } 2300078 - Remote file not found.
114361847f8eSopenharmony_ci     * @throws { BusinessError } 2300094 - Authentication error.
114461847f8eSopenharmony_ci     * @throws { BusinessError } 2300999 - Unknown error.
114561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
114661847f8eSopenharmony_ci     * @crossplatform
114761847f8eSopenharmony_ci     * @atomicservice
114861847f8eSopenharmony_ci     * @since 11
114961847f8eSopenharmony_ci     */
115061847f8eSopenharmony_ci    request(url: string, options?: HttpRequestOptions): Promise<HttpResponse>;
115161847f8eSopenharmony_ci
115261847f8eSopenharmony_ci    /**
115361847f8eSopenharmony_ci     * Initiates an HTTP request to a given URL, applicable to scenarios where http response supports streaming.
115461847f8eSopenharmony_ci     * @permission ohos.permission.INTERNET
115561847f8eSopenharmony_ci     * @param { string } url - URL for initiating an HTTP request.
115661847f8eSopenharmony_ci     * @param { AsyncCallback<number> } callback - Returns the callback of requestInStream {@link ResponseCode},
115761847f8eSopenharmony_ci     * should use on_headersReceive and on_dataReceive to get http response.
115861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error.
115961847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission denied.
116061847f8eSopenharmony_ci     * @throws { BusinessError } 2300001 - Unsupported protocol.
116161847f8eSopenharmony_ci     * @throws { BusinessError } 2300003 - Invalid URL format or missing URL.
116261847f8eSopenharmony_ci     * @throws { BusinessError } 2300005 - Failed to resolve the proxy name.
116361847f8eSopenharmony_ci     * @throws { BusinessError } 2300006 - Failed to resolve the host name.
116461847f8eSopenharmony_ci     * @throws { BusinessError } 2300007 - Failed to connect to the server.
116561847f8eSopenharmony_ci     * @throws { BusinessError } 2300008 - Invalid server response.
116661847f8eSopenharmony_ci     * @throws { BusinessError } 2300009 - Access to the remote resource denied.
116761847f8eSopenharmony_ci     * @throws { BusinessError } 2300016 - Error in the HTTP2 framing layer.
116861847f8eSopenharmony_ci     * @throws { BusinessError } 2300018 - Transferred a partial file.
116961847f8eSopenharmony_ci     * @throws { BusinessError } 2300023 - Failed to write the received data to the disk or application.
117061847f8eSopenharmony_ci     * @throws { BusinessError } 2300025 - Upload failed.
117161847f8eSopenharmony_ci     * @throws { BusinessError } 2300026 - Failed to open or read local data from the file or application.
117261847f8eSopenharmony_ci     * @throws { BusinessError } 2300027 - Out of memory.
117361847f8eSopenharmony_ci     * @throws { BusinessError } 2300028 - Operation timeout.
117461847f8eSopenharmony_ci     * @throws { BusinessError } 2300047 - The number of redirections reaches the maximum allowed.
117561847f8eSopenharmony_ci     * @throws { BusinessError } 2300052 - The server returned nothing (no header or data).
117661847f8eSopenharmony_ci     * @throws { BusinessError } 2300055 - Failed to send data to the peer.
117761847f8eSopenharmony_ci     * @throws { BusinessError } 2300056 - Failed to receive data from the peer.
117861847f8eSopenharmony_ci     * @throws { BusinessError } 2300058 - Local SSL certificate error.
117961847f8eSopenharmony_ci     * @throws { BusinessError } 2300059 - The specified SSL cipher cannot be used.
118061847f8eSopenharmony_ci     * @throws { BusinessError } 2300060 - Invalid SSL peer certificate or SSH remote key.
118161847f8eSopenharmony_ci     * @throws { BusinessError } 2300061 - Invalid HTTP encoding format.
118261847f8eSopenharmony_ci     * @throws { BusinessError } 2300063 - Maximum file size exceeded.
118361847f8eSopenharmony_ci     * @throws { BusinessError } 2300070 - Remote disk full.
118461847f8eSopenharmony_ci     * @throws { BusinessError } 2300073 - Remote file already exists.
118561847f8eSopenharmony_ci     * @throws { BusinessError } 2300077 - The SSL CA certificate does not exist or is inaccessible.
118661847f8eSopenharmony_ci     * @throws { BusinessError } 2300078 - Remote file not found.
118761847f8eSopenharmony_ci     * @throws { BusinessError } 2300094 - Authentication error.
118861847f8eSopenharmony_ci     * @throws { BusinessError } 2300999 - Unknown error.
118961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
119061847f8eSopenharmony_ci     * @since 10
119161847f8eSopenharmony_ci     */
119261847f8eSopenharmony_ci    requestInStream(url: string, callback: AsyncCallback<number>): void;
119361847f8eSopenharmony_ci
119461847f8eSopenharmony_ci    /**
119561847f8eSopenharmony_ci     * Initiates an HTTP request to a given URL, applicable to scenarios where http response supports streaming.
119661847f8eSopenharmony_ci     * @permission ohos.permission.INTERNET
119761847f8eSopenharmony_ci     * @param { string } url - URL for initiating an HTTP request.
119861847f8eSopenharmony_ci     * @param { HttpRequestOptions } options - Optional parameters {@link HttpRequestOptions}.
119961847f8eSopenharmony_ci     * @param { AsyncCallback<number> } callback - the callback of requestInStream.
120061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error.
120161847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission denied.
120261847f8eSopenharmony_ci     * @throws { BusinessError } 2300001 - Unsupported protocol.
120361847f8eSopenharmony_ci     * @throws { BusinessError } 2300003 - Invalid URL format or missing URL.
120461847f8eSopenharmony_ci     * @throws { BusinessError } 2300005 - Failed to resolve the proxy name.
120561847f8eSopenharmony_ci     * @throws { BusinessError } 2300006 - Failed to resolve the host name.
120661847f8eSopenharmony_ci     * @throws { BusinessError } 2300007 - Failed to connect to the server.
120761847f8eSopenharmony_ci     * @throws { BusinessError } 2300008 - Invalid server response.
120861847f8eSopenharmony_ci     * @throws { BusinessError } 2300009 - Access to the remote resource denied.
120961847f8eSopenharmony_ci     * @throws { BusinessError } 2300016 - Error in the HTTP2 framing layer.
121061847f8eSopenharmony_ci     * @throws { BusinessError } 2300018 - Transferred a partial file.
121161847f8eSopenharmony_ci     * @throws { BusinessError } 2300023 - Failed to write the received data to the disk or application.
121261847f8eSopenharmony_ci     * @throws { BusinessError } 2300025 - Upload failed.
121361847f8eSopenharmony_ci     * @throws { BusinessError } 2300026 - Failed to open or read local data from the file or application.
121461847f8eSopenharmony_ci     * @throws { BusinessError } 2300027 - Out of memory.
121561847f8eSopenharmony_ci     * @throws { BusinessError } 2300028 - Operation timeout.
121661847f8eSopenharmony_ci     * @throws { BusinessError } 2300047 - The number of redirections reaches the maximum allowed.
121761847f8eSopenharmony_ci     * @throws { BusinessError } 2300052 - The server returned nothing (no header or data).
121861847f8eSopenharmony_ci     * @throws { BusinessError } 2300055 - Failed to send data to the peer.
121961847f8eSopenharmony_ci     * @throws { BusinessError } 2300056 - Failed to receive data from the peer.
122061847f8eSopenharmony_ci     * @throws { BusinessError } 2300058 - Local SSL certificate error.
122161847f8eSopenharmony_ci     * @throws { BusinessError } 2300059 - The specified SSL cipher cannot be used.
122261847f8eSopenharmony_ci     * @throws { BusinessError } 2300060 - Invalid SSL peer certificate or SSH remote key.
122361847f8eSopenharmony_ci     * @throws { BusinessError } 2300061 - Invalid HTTP encoding format.
122461847f8eSopenharmony_ci     * @throws { BusinessError } 2300063 - Maximum file size exceeded.
122561847f8eSopenharmony_ci     * @throws { BusinessError } 2300070 - Remote disk full.
122661847f8eSopenharmony_ci     * @throws { BusinessError } 2300073 - Remote file already exists.
122761847f8eSopenharmony_ci     * @throws { BusinessError } 2300077 - The SSL CA certificate does not exist or is inaccessible.
122861847f8eSopenharmony_ci     * @throws { BusinessError } 2300078 - Remote file not found.
122961847f8eSopenharmony_ci     * @throws { BusinessError } 2300094 - Authentication error.
123061847f8eSopenharmony_ci     * @throws { BusinessError } 2300999 - Unknown error.
123161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
123261847f8eSopenharmony_ci     * @since 10
123361847f8eSopenharmony_ci     */
123461847f8eSopenharmony_ci    requestInStream(url: string, options: HttpRequestOptions, callback: AsyncCallback<number>): void;
123561847f8eSopenharmony_ci
123661847f8eSopenharmony_ci    /**
123761847f8eSopenharmony_ci     * Initiates an HTTP request to a given URL, applicable to scenarios where http response supports streaming.
123861847f8eSopenharmony_ci     * @permission ohos.permission.INTERNET
123961847f8eSopenharmony_ci     * @param { string } url - URL for initiating an HTTP request.
124061847f8eSopenharmony_ci     * @param { HttpRequestOptions } [options] - Optional parameters {@link HttpRequestOptions}.
124161847f8eSopenharmony_ci     * @returns { Promise<number> } the promise returned by the function.
124261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error.
124361847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission denied.
124461847f8eSopenharmony_ci     * @throws { BusinessError } 2300001 - Unsupported protocol.
124561847f8eSopenharmony_ci     * @throws { BusinessError } 2300003 - Invalid URL format or missing URL.
124661847f8eSopenharmony_ci     * @throws { BusinessError } 2300005 - Failed to resolve the proxy name.
124761847f8eSopenharmony_ci     * @throws { BusinessError } 2300006 - Failed to resolve the host name.
124861847f8eSopenharmony_ci     * @throws { BusinessError } 2300007 - Failed to connect to the server.
124961847f8eSopenharmony_ci     * @throws { BusinessError } 2300008 - Invalid server response.
125061847f8eSopenharmony_ci     * @throws { BusinessError } 2300009 - Access to the remote resource denied.
125161847f8eSopenharmony_ci     * @throws { BusinessError } 2300016 - Error in the HTTP2 framing layer.
125261847f8eSopenharmony_ci     * @throws { BusinessError } 2300018 - Transferred a partial file.
125361847f8eSopenharmony_ci     * @throws { BusinessError } 2300023 - Failed to write the received data to the disk or application.
125461847f8eSopenharmony_ci     * @throws { BusinessError } 2300025 - Upload failed.
125561847f8eSopenharmony_ci     * @throws { BusinessError } 2300026 - Failed to open or read local data from the file or application.
125661847f8eSopenharmony_ci     * @throws { BusinessError } 2300027 - Out of memory.
125761847f8eSopenharmony_ci     * @throws { BusinessError } 2300028 - Operation timeout.
125861847f8eSopenharmony_ci     * @throws { BusinessError } 2300047 - The number of redirections reaches the maximum allowed.
125961847f8eSopenharmony_ci     * @throws { BusinessError } 2300052 - The server returned nothing (no header or data).
126061847f8eSopenharmony_ci     * @throws { BusinessError } 2300055 - Failed to send data to the peer.
126161847f8eSopenharmony_ci     * @throws { BusinessError } 2300056 - Failed to receive data from the peer.
126261847f8eSopenharmony_ci     * @throws { BusinessError } 2300058 - Local SSL certificate error.
126361847f8eSopenharmony_ci     * @throws { BusinessError } 2300059 - The specified SSL cipher cannot be used.
126461847f8eSopenharmony_ci     * @throws { BusinessError } 2300060 - Invalid SSL peer certificate or SSH remote key.
126561847f8eSopenharmony_ci     * @throws { BusinessError } 2300061 - Invalid HTTP encoding format.
126661847f8eSopenharmony_ci     * @throws { BusinessError } 2300063 - Maximum file size exceeded.
126761847f8eSopenharmony_ci     * @throws { BusinessError } 2300070 - Remote disk full.
126861847f8eSopenharmony_ci     * @throws { BusinessError } 2300073 - Remote file already exists.
126961847f8eSopenharmony_ci     * @throws { BusinessError } 2300077 - The SSL CA certificate does not exist or is inaccessible.
127061847f8eSopenharmony_ci     * @throws { BusinessError } 2300078 - Remote file not found.
127161847f8eSopenharmony_ci     * @throws { BusinessError } 2300094 - Authentication error.
127261847f8eSopenharmony_ci     * @throws { BusinessError } 2300999 - Unknown error.
127361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
127461847f8eSopenharmony_ci     * @since 10
127561847f8eSopenharmony_ci     */
127661847f8eSopenharmony_ci    requestInStream(url: string, options?: HttpRequestOptions): Promise<number>;
127761847f8eSopenharmony_ci
127861847f8eSopenharmony_ci    /**
127961847f8eSopenharmony_ci     * Destroys an HTTP request.
128061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
128161847f8eSopenharmony_ci     * @since 6
128261847f8eSopenharmony_ci     */
128361847f8eSopenharmony_ci    /**
128461847f8eSopenharmony_ci     * Destroys an HTTP request.
128561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
128661847f8eSopenharmony_ci     * @crossplatform
128761847f8eSopenharmony_ci     * @since 10
128861847f8eSopenharmony_ci     */
128961847f8eSopenharmony_ci    /**
129061847f8eSopenharmony_ci     * Destroys an HTTP request.
129161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
129261847f8eSopenharmony_ci     * @crossplatform
129361847f8eSopenharmony_ci     * @atomicservice
129461847f8eSopenharmony_ci     * @since 11
129561847f8eSopenharmony_ci     */
129661847f8eSopenharmony_ci    destroy(): void;
129761847f8eSopenharmony_ci
129861847f8eSopenharmony_ci    /**
129961847f8eSopenharmony_ci     * Registers an observer for HTTP Response Header events.
130061847f8eSopenharmony_ci     * @param { "headerReceive" } type - Indicates Event name.
130161847f8eSopenharmony_ci     * @param { AsyncCallback<Object> } callback - the callback used to return the result.
130261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
130361847f8eSopenharmony_ci     * @since 6
130461847f8eSopenharmony_ci     * @deprecated since 8
130561847f8eSopenharmony_ci     * @useinstead on_headersReceive
130661847f8eSopenharmony_ci     */
130761847f8eSopenharmony_ci    on(type: "headerReceive", callback: AsyncCallback<Object>): void;
130861847f8eSopenharmony_ci
130961847f8eSopenharmony_ci    /**
131061847f8eSopenharmony_ci     * Unregisters the observer for HTTP Response Header events.
131161847f8eSopenharmony_ci     * @param { "headerReceive" } type - Indicates Event name.
131261847f8eSopenharmony_ci     * @param { AsyncCallback<Object> } [callback] - the callback used to return the result.
131361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
131461847f8eSopenharmony_ci     * @since 6
131561847f8eSopenharmony_ci     * @deprecated since 8
131661847f8eSopenharmony_ci     * @useinstead off_headersReceive
131761847f8eSopenharmony_ci     */
131861847f8eSopenharmony_ci    off(type: "headerReceive", callback?: AsyncCallback<Object>): void;
131961847f8eSopenharmony_ci
132061847f8eSopenharmony_ci    /**
132161847f8eSopenharmony_ci     * Registers an observer for HTTP Response Header events.
132261847f8eSopenharmony_ci     * @param { "headersReceive" } type - Indicates Event name.
132361847f8eSopenharmony_ci     * @param { Callback<Object> } callback - the callback used to return the result.
132461847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
132561847f8eSopenharmony_ci     * @since 8
132661847f8eSopenharmony_ci     */
132761847f8eSopenharmony_ci    /**
132861847f8eSopenharmony_ci     * Registers an observer for HTTP Response Header events.
132961847f8eSopenharmony_ci     * @param { "headersReceive" } type - Indicates Event name.
133061847f8eSopenharmony_ci     * @param { Callback<Object> } callback - the callback used to return the result.
133161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
133261847f8eSopenharmony_ci     * @crossplatform
133361847f8eSopenharmony_ci     * @since 10
133461847f8eSopenharmony_ci     */
133561847f8eSopenharmony_ci    /**
133661847f8eSopenharmony_ci     * Registers an observer for HTTP Response Header events.
133761847f8eSopenharmony_ci     * @param { "headersReceive" } type - Indicates Event name.
133861847f8eSopenharmony_ci     * @param { Callback<Object> } callback - the callback used to return the result.
133961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
134061847f8eSopenharmony_ci     * @crossplatform
134161847f8eSopenharmony_ci     * @atomicservice
134261847f8eSopenharmony_ci     * @since 11
134361847f8eSopenharmony_ci     */
134461847f8eSopenharmony_ci    on(type: "headersReceive", callback: Callback<Object>): void;
134561847f8eSopenharmony_ci
134661847f8eSopenharmony_ci    /**
134761847f8eSopenharmony_ci     * Unregisters the observer for HTTP Response Header events.
134861847f8eSopenharmony_ci     * @param { "headersReceive" } type - Indicates Event name.
134961847f8eSopenharmony_ci     * @param { Callback<Object> } callback - the callback used to return the result.
135061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
135161847f8eSopenharmony_ci     * @since 8
135261847f8eSopenharmony_ci     */
135361847f8eSopenharmony_ci    /**
135461847f8eSopenharmony_ci     * Unregisters the observer for HTTP Response Header events.
135561847f8eSopenharmony_ci     * @param { "headersReceive" } type - Indicates Event name.
135661847f8eSopenharmony_ci     * @param { Callback<Object> } callback - the callback used to return the result.
135761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
135861847f8eSopenharmony_ci     * @crossplatform
135961847f8eSopenharmony_ci     * @since 10
136061847f8eSopenharmony_ci     */
136161847f8eSopenharmony_ci    /**
136261847f8eSopenharmony_ci     * Unregisters the observer for HTTP Response Header events.
136361847f8eSopenharmony_ci     * @param { "headersReceive" } type - Indicates Event name.
136461847f8eSopenharmony_ci     * @param { Callback<Object> } [callback] - the callback used to return the result.
136561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
136661847f8eSopenharmony_ci     * @crossplatform
136761847f8eSopenharmony_ci     * @atomicservice
136861847f8eSopenharmony_ci     * @since 11
136961847f8eSopenharmony_ci     */
137061847f8eSopenharmony_ci    off(type: "headersReceive", callback?: Callback<Object>): void;
137161847f8eSopenharmony_ci
137261847f8eSopenharmony_ci    /**
137361847f8eSopenharmony_ci     * Registers a one-time observer for HTTP Response Header events.
137461847f8eSopenharmony_ci     * @param { "headersReceive" } type - Indicates Event name.
137561847f8eSopenharmony_ci     * @param { Callback<Object> } callback - the callback used to return the result.
137661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
137761847f8eSopenharmony_ci     * @since 8
137861847f8eSopenharmony_ci     */
137961847f8eSopenharmony_ci    /**
138061847f8eSopenharmony_ci     * Registers a one-time observer for HTTP Response Header events.
138161847f8eSopenharmony_ci     * @param { "headersReceive" } type - Indicates Event name.
138261847f8eSopenharmony_ci     * @param { Callback<Object> } callback - the callback used to return the result.
138361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
138461847f8eSopenharmony_ci     * @crossplatform
138561847f8eSopenharmony_ci     * @since 10
138661847f8eSopenharmony_ci     */
138761847f8eSopenharmony_ci    once(type: "headersReceive", callback: Callback<Object>): void;
138861847f8eSopenharmony_ci
138961847f8eSopenharmony_ci    /**
139061847f8eSopenharmony_ci     * Registers an observer for receiving HTTP Response data events continuously.
139161847f8eSopenharmony_ci     * @param { "dataReceive" } type - Indicates Event name.
139261847f8eSopenharmony_ci     * @param { Callback<ArrayBuffer> } callback - the callback used to return the result.
139361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
139461847f8eSopenharmony_ci     * @since 10
139561847f8eSopenharmony_ci     */
139661847f8eSopenharmony_ci    on(type: "dataReceive", callback: Callback<ArrayBuffer>): void;
139761847f8eSopenharmony_ci
139861847f8eSopenharmony_ci    /**
139961847f8eSopenharmony_ci     * Unregisters an observer for receiving HTTP Response data events continuously.
140061847f8eSopenharmony_ci     * @param { "dataReceive" } type - Indicates Event name.
140161847f8eSopenharmony_ci     * @param { Callback<ArrayBuffer> } [callback] - the callback used to return the result.
140261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
140361847f8eSopenharmony_ci     * @since 10
140461847f8eSopenharmony_ci     */
140561847f8eSopenharmony_ci    off(type: "dataReceive", callback?: Callback<ArrayBuffer>): void;
140661847f8eSopenharmony_ci
140761847f8eSopenharmony_ci    /**
140861847f8eSopenharmony_ci     * Registers an observer for receiving HTTP Response data ends events.
140961847f8eSopenharmony_ci     * @param { "dataEnd" } type - Indicates Event name.
141061847f8eSopenharmony_ci     * @param { Callback<void> } callback - the callback used to return the result.
141161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
141261847f8eSopenharmony_ci     * @since 10
141361847f8eSopenharmony_ci     */
141461847f8eSopenharmony_ci    on(type: "dataEnd", callback: Callback<void>): void;
141561847f8eSopenharmony_ci
141661847f8eSopenharmony_ci    /**
141761847f8eSopenharmony_ci     * Unregisters an observer for receiving HTTP Response data ends events.
141861847f8eSopenharmony_ci     * @param { "dataEnd" } type - Indicates Event name.
141961847f8eSopenharmony_ci     * @param { Callback<void> } [callback] - the callback used to return the result.
142061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
142161847f8eSopenharmony_ci     * @since 10
142261847f8eSopenharmony_ci     */
142361847f8eSopenharmony_ci    off(type: "dataEnd", callback?: Callback<void>): void;
142461847f8eSopenharmony_ci
142561847f8eSopenharmony_ci    /**
142661847f8eSopenharmony_ci     * Registers an observer for progress of receiving HTTP Response data events.
142761847f8eSopenharmony_ci     * @param { 'dataReceiveProgress' } type - Indicates Event name.
142861847f8eSopenharmony_ci     * @param { Callback<{ receiveSize: number, totalSize: number }> } callback - the callback used to return the result.
142961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
143061847f8eSopenharmony_ci     * @since 10
143161847f8eSopenharmony_ci     */
143261847f8eSopenharmony_ci    /**
143361847f8eSopenharmony_ci     * Registers an observer for progress of receiving HTTP Response data events.
143461847f8eSopenharmony_ci     * @param { 'dataReceiveProgress' } type - Indicates Event name.
143561847f8eSopenharmony_ci     * @param { Callback<DataReceiveProgressInfo> } callback - the callback used to return the result.
143661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
143761847f8eSopenharmony_ci     * @since 11
143861847f8eSopenharmony_ci     */
143961847f8eSopenharmony_ci    /**
144061847f8eSopenharmony_ci     * Registers an observer for progress of receiving HTTP Response data events.
144161847f8eSopenharmony_ci     * @param { 'dataReceiveProgress' } type - Indicates Event name.
144261847f8eSopenharmony_ci     * @param { Callback<DataReceiveProgressInfo> } callback - the callback used to return the result.
144361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
144461847f8eSopenharmony_ci     * @crossplatform
144561847f8eSopenharmony_ci     * @since 12
144661847f8eSopenharmony_ci     */
144761847f8eSopenharmony_ci    on(type: 'dataReceiveProgress', callback: Callback<DataReceiveProgressInfo>): void;
144861847f8eSopenharmony_ci
144961847f8eSopenharmony_ci    /**
145061847f8eSopenharmony_ci     * Unregisters an observer for progress of receiving HTTP Response data events.
145161847f8eSopenharmony_ci     * @param { 'dataReceiveProgress' } type - Indicates Event name.
145261847f8eSopenharmony_ci     * @param { Callback<{ receiveSize: number, totalSize: number }> } [callback] - the callback used to return the result.
145361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
145461847f8eSopenharmony_ci     * @since 10
145561847f8eSopenharmony_ci     */
145661847f8eSopenharmony_ci    /**
145761847f8eSopenharmony_ci     * Unregisters an observer for progress of receiving HTTP Response data events.
145861847f8eSopenharmony_ci     * @param { 'dataReceiveProgress' } type - Indicates Event name.
145961847f8eSopenharmony_ci     * @param { Callback<DataReceiveProgressInfo> } callback - the callback used to return the result.
146061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
146161847f8eSopenharmony_ci     * @since 11
146261847f8eSopenharmony_ci     */
146361847f8eSopenharmony_ci    /**
146461847f8eSopenharmony_ci     * Unregisters an observer for progress of receiving HTTP Response data events.
146561847f8eSopenharmony_ci     * @param { 'dataReceiveProgress' } type - Indicates Event name.
146661847f8eSopenharmony_ci     * @param { Callback<DataReceiveProgressInfo> } callback - the callback used to return the result.
146761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
146861847f8eSopenharmony_ci     * @crossplatform
146961847f8eSopenharmony_ci     * @since 12
147061847f8eSopenharmony_ci     */
147161847f8eSopenharmony_ci    off(type: 'dataReceiveProgress', callback?: Callback<DataReceiveProgressInfo>): void;
147261847f8eSopenharmony_ci
147361847f8eSopenharmony_ci    /**
147461847f8eSopenharmony_ci     * Registers an observer for progress of sendSize HTTP Response data events.
147561847f8eSopenharmony_ci     * @param { 'dataSendProgress' } type - Indicates Event name.
147661847f8eSopenharmony_ci     * @param { Callback<DataSendProgressInfo> } callback - the callback of on.
147761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
147861847f8eSopenharmony_ci     * @since 11
147961847f8eSopenharmony_ci     */
148061847f8eSopenharmony_ci    /**
148161847f8eSopenharmony_ci     * Registers an observer for progress of sendSize HTTP Response data events.
148261847f8eSopenharmony_ci     * @param { 'dataSendProgress' } type - Indicates Event name.
148361847f8eSopenharmony_ci     * @param { Callback<DataSendProgressInfo> } callback - the callback of on.
148461847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
148561847f8eSopenharmony_ci     * @crossplatform
148661847f8eSopenharmony_ci     * @since 12
148761847f8eSopenharmony_ci     */
148861847f8eSopenharmony_ci    on(type: 'dataSendProgress', callback: Callback<DataSendProgressInfo>): void
148961847f8eSopenharmony_ci
149061847f8eSopenharmony_ci    /**
149161847f8eSopenharmony_ci     * Unregisters an observer for progress of sendSize HTTP Response data events.
149261847f8eSopenharmony_ci     * @param { 'dataSendProgress' } type - Indicates Event name.
149361847f8eSopenharmony_ci     * @param { Callback<DataSendProgressInfo> } [callback] - the callback of off.
149461847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
149561847f8eSopenharmony_ci     * @since 11
149661847f8eSopenharmony_ci     */
149761847f8eSopenharmony_ci    /**
149861847f8eSopenharmony_ci     * Unregisters an observer for progress of sendSize HTTP Response data events.
149961847f8eSopenharmony_ci     * @param { 'dataSendProgress' } type - Indicates Event name.
150061847f8eSopenharmony_ci     * @param { Callback<DataSendProgressInfo> } [callback] - the callback of off.
150161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
150261847f8eSopenharmony_ci     * @crossplatform
150361847f8eSopenharmony_ci     * @since 12
150461847f8eSopenharmony_ci     */
150561847f8eSopenharmony_ci    off(type: 'dataSendProgress', callback?: Callback<DataSendProgressInfo>): void
150661847f8eSopenharmony_ci  }
150761847f8eSopenharmony_ci
150861847f8eSopenharmony_ci  /**
150961847f8eSopenharmony_ci   * Defines an HTTP request method.
151061847f8eSopenharmony_ci   * @enum {string}
151161847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
151261847f8eSopenharmony_ci   * @since 6
151361847f8eSopenharmony_ci   */
151461847f8eSopenharmony_ci  /**
151561847f8eSopenharmony_ci   * Defines an HTTP request method.
151661847f8eSopenharmony_ci   * @enum {string}
151761847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
151861847f8eSopenharmony_ci   * @crossplatform
151961847f8eSopenharmony_ci   * @since 10
152061847f8eSopenharmony_ci   */
152161847f8eSopenharmony_ci  /**
152261847f8eSopenharmony_ci   * Defines an HTTP request method.
152361847f8eSopenharmony_ci   * @enum {string}
152461847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
152561847f8eSopenharmony_ci   * @crossplatform
152661847f8eSopenharmony_ci   * @atomicservice
152761847f8eSopenharmony_ci   * @since 11
152861847f8eSopenharmony_ci   */
152961847f8eSopenharmony_ci  export enum RequestMethod {
153061847f8eSopenharmony_ci    /**
153161847f8eSopenharmony_ci     * OPTIONS method.
153261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
153361847f8eSopenharmony_ci     * @since 6
153461847f8eSopenharmony_ci     */
153561847f8eSopenharmony_ci    /**
153661847f8eSopenharmony_ci     * OPTIONS method.
153761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
153861847f8eSopenharmony_ci     * @crossplatform
153961847f8eSopenharmony_ci     * @since 10
154061847f8eSopenharmony_ci     */
154161847f8eSopenharmony_ci    /**
154261847f8eSopenharmony_ci     * OPTIONS method.
154361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
154461847f8eSopenharmony_ci     * @crossplatform
154561847f8eSopenharmony_ci     * @atomicservice
154661847f8eSopenharmony_ci     * @since 11
154761847f8eSopenharmony_ci     */
154861847f8eSopenharmony_ci    OPTIONS = "OPTIONS",
154961847f8eSopenharmony_ci
155061847f8eSopenharmony_ci    /**
155161847f8eSopenharmony_ci     * GET method.
155261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
155361847f8eSopenharmony_ci     * @since 6
155461847f8eSopenharmony_ci     */
155561847f8eSopenharmony_ci    /**
155661847f8eSopenharmony_ci     * GET method.
155761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
155861847f8eSopenharmony_ci     * @crossplatform
155961847f8eSopenharmony_ci     * @since 10
156061847f8eSopenharmony_ci     */
156161847f8eSopenharmony_ci    /**
156261847f8eSopenharmony_ci     * GET method.
156361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
156461847f8eSopenharmony_ci     * @crossplatform
156561847f8eSopenharmony_ci     * @atomicservice
156661847f8eSopenharmony_ci     * @since 11
156761847f8eSopenharmony_ci     */
156861847f8eSopenharmony_ci    GET = "GET",
156961847f8eSopenharmony_ci
157061847f8eSopenharmony_ci    /**
157161847f8eSopenharmony_ci     * HEAD method.
157261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
157361847f8eSopenharmony_ci     * @since 6
157461847f8eSopenharmony_ci     */
157561847f8eSopenharmony_ci    /**
157661847f8eSopenharmony_ci     * HEAD method.
157761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
157861847f8eSopenharmony_ci     * @crossplatform
157961847f8eSopenharmony_ci     * @since 10
158061847f8eSopenharmony_ci     */
158161847f8eSopenharmony_ci    /**
158261847f8eSopenharmony_ci     * HEAD method.
158361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
158461847f8eSopenharmony_ci     * @crossplatform
158561847f8eSopenharmony_ci     * @atomicservice
158661847f8eSopenharmony_ci     * @since 11
158761847f8eSopenharmony_ci     */
158861847f8eSopenharmony_ci    HEAD = "HEAD",
158961847f8eSopenharmony_ci
159061847f8eSopenharmony_ci    /**
159161847f8eSopenharmony_ci     * POST method.
159261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
159361847f8eSopenharmony_ci     * @since 6
159461847f8eSopenharmony_ci     */
159561847f8eSopenharmony_ci    /**
159661847f8eSopenharmony_ci     * POST method.
159761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
159861847f8eSopenharmony_ci     * @crossplatform
159961847f8eSopenharmony_ci     * @since 10
160061847f8eSopenharmony_ci     */
160161847f8eSopenharmony_ci    /**
160261847f8eSopenharmony_ci     * POST method.
160361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
160461847f8eSopenharmony_ci     * @crossplatform
160561847f8eSopenharmony_ci     * @atomicservice
160661847f8eSopenharmony_ci     * @since 11
160761847f8eSopenharmony_ci     */
160861847f8eSopenharmony_ci    POST = "POST",
160961847f8eSopenharmony_ci
161061847f8eSopenharmony_ci    /**
161161847f8eSopenharmony_ci     * PUT method.
161261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
161361847f8eSopenharmony_ci     * @since 6
161461847f8eSopenharmony_ci     */
161561847f8eSopenharmony_ci    /**
161661847f8eSopenharmony_ci     * PUT method.
161761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
161861847f8eSopenharmony_ci     * @crossplatform
161961847f8eSopenharmony_ci     * @since 10
162061847f8eSopenharmony_ci     */
162161847f8eSopenharmony_ci    /**
162261847f8eSopenharmony_ci     * PUT method.
162361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
162461847f8eSopenharmony_ci     * @crossplatform
162561847f8eSopenharmony_ci     * @atomicservice
162661847f8eSopenharmony_ci     * @since 11
162761847f8eSopenharmony_ci     */
162861847f8eSopenharmony_ci    PUT = "PUT",
162961847f8eSopenharmony_ci
163061847f8eSopenharmony_ci    /**
163161847f8eSopenharmony_ci     * DELETE method.
163261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
163361847f8eSopenharmony_ci     * @since 6
163461847f8eSopenharmony_ci     */
163561847f8eSopenharmony_ci    /**
163661847f8eSopenharmony_ci     * DELETE method.
163761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
163861847f8eSopenharmony_ci     * @crossplatform
163961847f8eSopenharmony_ci     * @since 10
164061847f8eSopenharmony_ci     */
164161847f8eSopenharmony_ci    /**
164261847f8eSopenharmony_ci     * DELETE method.
164361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
164461847f8eSopenharmony_ci     * @crossplatform
164561847f8eSopenharmony_ci     * @atomicservice
164661847f8eSopenharmony_ci     * @since 11
164761847f8eSopenharmony_ci     */
164861847f8eSopenharmony_ci    DELETE = "DELETE",
164961847f8eSopenharmony_ci
165061847f8eSopenharmony_ci    /**
165161847f8eSopenharmony_ci     * TRACE method.
165261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
165361847f8eSopenharmony_ci     * @since 6
165461847f8eSopenharmony_ci     */
165561847f8eSopenharmony_ci    /**
165661847f8eSopenharmony_ci     * TRACE method.
165761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
165861847f8eSopenharmony_ci     * @crossplatform
165961847f8eSopenharmony_ci     * @since 10
166061847f8eSopenharmony_ci     */
166161847f8eSopenharmony_ci    /**
166261847f8eSopenharmony_ci     * TRACE method.
166361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
166461847f8eSopenharmony_ci     * @crossplatform
166561847f8eSopenharmony_ci     * @atomicservice
166661847f8eSopenharmony_ci     * @since 11
166761847f8eSopenharmony_ci     */
166861847f8eSopenharmony_ci    TRACE = "TRACE",
166961847f8eSopenharmony_ci
167061847f8eSopenharmony_ci    /**
167161847f8eSopenharmony_ci     * CONNECT method.
167261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
167361847f8eSopenharmony_ci     * @since 6
167461847f8eSopenharmony_ci     */
167561847f8eSopenharmony_ci    /**
167661847f8eSopenharmony_ci     * CONNECT method.
167761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
167861847f8eSopenharmony_ci     * @crossplatform
167961847f8eSopenharmony_ci     * @since 10
168061847f8eSopenharmony_ci     */
168161847f8eSopenharmony_ci    /**
168261847f8eSopenharmony_ci     * CONNECT method.
168361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
168461847f8eSopenharmony_ci     * @crossplatform
168561847f8eSopenharmony_ci     * @atomicservice
168661847f8eSopenharmony_ci     * @since 11
168761847f8eSopenharmony_ci     */
168861847f8eSopenharmony_ci    CONNECT = "CONNECT"
168961847f8eSopenharmony_ci  }
169061847f8eSopenharmony_ci
169161847f8eSopenharmony_ci  /**
169261847f8eSopenharmony_ci   * Enumerates the response codes for an HTTP request.
169361847f8eSopenharmony_ci   * @enum {number}
169461847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
169561847f8eSopenharmony_ci   * @since 6
169661847f8eSopenharmony_ci   */
169761847f8eSopenharmony_ci  /**
169861847f8eSopenharmony_ci   * Enumerates the response codes for an HTTP request.
169961847f8eSopenharmony_ci   * @enum {number}
170061847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
170161847f8eSopenharmony_ci   * @crossplatform
170261847f8eSopenharmony_ci   * @since 10
170361847f8eSopenharmony_ci   */
170461847f8eSopenharmony_ci  /**
170561847f8eSopenharmony_ci   * Enumerates the response codes for an HTTP request.
170661847f8eSopenharmony_ci   * @enum {number}
170761847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
170861847f8eSopenharmony_ci   * @crossplatform
170961847f8eSopenharmony_ci   * @atomicservice
171061847f8eSopenharmony_ci   * @since 11
171161847f8eSopenharmony_ci   */
171261847f8eSopenharmony_ci  export enum ResponseCode {
171361847f8eSopenharmony_ci    /**
171461847f8eSopenharmony_ci     * The request was successful. Typically used for GET and POST requests.
171561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
171661847f8eSopenharmony_ci     * @since 6
171761847f8eSopenharmony_ci     */
171861847f8eSopenharmony_ci    /**
171961847f8eSopenharmony_ci     * The request was successful. Typically used for GET and POST requests.
172061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
172161847f8eSopenharmony_ci     * @crossplatform
172261847f8eSopenharmony_ci     * @since 10
172361847f8eSopenharmony_ci     */
172461847f8eSopenharmony_ci    /**
172561847f8eSopenharmony_ci     * The request was successful. Typically used for GET and POST requests.
172661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
172761847f8eSopenharmony_ci     * @crossplatform
172861847f8eSopenharmony_ci     * @atomicservice
172961847f8eSopenharmony_ci     * @since 11
173061847f8eSopenharmony_ci     */
173161847f8eSopenharmony_ci    OK = 200,
173261847f8eSopenharmony_ci
173361847f8eSopenharmony_ci    /**
173461847f8eSopenharmony_ci     * Successfully requested and created a new resource.
173561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
173661847f8eSopenharmony_ci     * @since 6
173761847f8eSopenharmony_ci     */
173861847f8eSopenharmony_ci    /**
173961847f8eSopenharmony_ci     * Successfully requested and created a new resource.
174061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
174161847f8eSopenharmony_ci     * @crossplatform
174261847f8eSopenharmony_ci     * @since 10
174361847f8eSopenharmony_ci     */
174461847f8eSopenharmony_ci    /**
174561847f8eSopenharmony_ci     * Successfully requested and created a new resource.
174661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
174761847f8eSopenharmony_ci     * @crossplatform
174861847f8eSopenharmony_ci     * @atomicservice
174961847f8eSopenharmony_ci     * @since 11
175061847f8eSopenharmony_ci     */
175161847f8eSopenharmony_ci    CREATED,
175261847f8eSopenharmony_ci
175361847f8eSopenharmony_ci    /**
175461847f8eSopenharmony_ci     * The request has been accepted but has not been processed completely.
175561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
175661847f8eSopenharmony_ci     * @since 6
175761847f8eSopenharmony_ci     */
175861847f8eSopenharmony_ci    /**
175961847f8eSopenharmony_ci     * The request has been accepted but has not been processed completely.
176061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
176161847f8eSopenharmony_ci     * @crossplatform
176261847f8eSopenharmony_ci     * @since 10
176361847f8eSopenharmony_ci     */
176461847f8eSopenharmony_ci    /**
176561847f8eSopenharmony_ci     * The request has been accepted but has not been processed completely.
176661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
176761847f8eSopenharmony_ci     * @crossplatform
176861847f8eSopenharmony_ci     * @atomicservice
176961847f8eSopenharmony_ci     * @since 11
177061847f8eSopenharmony_ci     */
177161847f8eSopenharmony_ci    ACCEPTED,
177261847f8eSopenharmony_ci
177361847f8eSopenharmony_ci    /**
177461847f8eSopenharmony_ci     * Unauthorized information. The request was successful.
177561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
177661847f8eSopenharmony_ci     * @since 6
177761847f8eSopenharmony_ci     */
177861847f8eSopenharmony_ci    /**
177961847f8eSopenharmony_ci     * Unauthorized information. The request was successful.
178061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
178161847f8eSopenharmony_ci     * @crossplatform
178261847f8eSopenharmony_ci     * @since 10
178361847f8eSopenharmony_ci     */
178461847f8eSopenharmony_ci    /**
178561847f8eSopenharmony_ci     * Unauthorized information. The request was successful.
178661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
178761847f8eSopenharmony_ci     * @crossplatform
178861847f8eSopenharmony_ci     * @atomicservice
178961847f8eSopenharmony_ci     * @since 11
179061847f8eSopenharmony_ci     */
179161847f8eSopenharmony_ci    NOT_AUTHORITATIVE,
179261847f8eSopenharmony_ci
179361847f8eSopenharmony_ci    /**
179461847f8eSopenharmony_ci     * No content. The server successfully processed, but did not return content.
179561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
179661847f8eSopenharmony_ci     * @since 6
179761847f8eSopenharmony_ci     */
179861847f8eSopenharmony_ci    /**
179961847f8eSopenharmony_ci     * No content. The server successfully processed, but did not return content.
180061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
180161847f8eSopenharmony_ci     * @crossplatform
180261847f8eSopenharmony_ci     * @since 10
180361847f8eSopenharmony_ci     */
180461847f8eSopenharmony_ci    /**
180561847f8eSopenharmony_ci     * No content. The server successfully processed, but did not return content.
180661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
180761847f8eSopenharmony_ci     * @crossplatform
180861847f8eSopenharmony_ci     * @atomicservice
180961847f8eSopenharmony_ci     * @since 11
181061847f8eSopenharmony_ci     */
181161847f8eSopenharmony_ci    NO_CONTENT,
181261847f8eSopenharmony_ci
181361847f8eSopenharmony_ci    /**
181461847f8eSopenharmony_ci     * Reset the content.
181561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
181661847f8eSopenharmony_ci     * @since 6
181761847f8eSopenharmony_ci     */
181861847f8eSopenharmony_ci    /**
181961847f8eSopenharmony_ci     * Reset the content.
182061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
182161847f8eSopenharmony_ci     * @crossplatform
182261847f8eSopenharmony_ci     * @since 10
182361847f8eSopenharmony_ci     */
182461847f8eSopenharmony_ci    /**
182561847f8eSopenharmony_ci     * Reset the content.
182661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
182761847f8eSopenharmony_ci     * @crossplatform
182861847f8eSopenharmony_ci     * @atomicservice
182961847f8eSopenharmony_ci     * @since 11
183061847f8eSopenharmony_ci     */
183161847f8eSopenharmony_ci    RESET,
183261847f8eSopenharmony_ci
183361847f8eSopenharmony_ci    /**
183461847f8eSopenharmony_ci     * Partial content. The server successfully processed some GET requests.
183561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
183661847f8eSopenharmony_ci     * @since 6
183761847f8eSopenharmony_ci     */
183861847f8eSopenharmony_ci    /**
183961847f8eSopenharmony_ci     * Partial content. The server successfully processed some GET requests.
184061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
184161847f8eSopenharmony_ci     * @crossplatform
184261847f8eSopenharmony_ci     * @since 10
184361847f8eSopenharmony_ci     */
184461847f8eSopenharmony_ci    /**
184561847f8eSopenharmony_ci     * Partial content. The server successfully processed some GET requests.
184661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
184761847f8eSopenharmony_ci     * @crossplatform
184861847f8eSopenharmony_ci     * @atomicservice
184961847f8eSopenharmony_ci     * @since 11
185061847f8eSopenharmony_ci     */
185161847f8eSopenharmony_ci    PARTIAL,
185261847f8eSopenharmony_ci
185361847f8eSopenharmony_ci    /**
185461847f8eSopenharmony_ci     * Multiple options.
185561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
185661847f8eSopenharmony_ci     * @since 6
185761847f8eSopenharmony_ci     */
185861847f8eSopenharmony_ci    /**
185961847f8eSopenharmony_ci     * Multiple options.
186061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
186161847f8eSopenharmony_ci     * @crossplatform
186261847f8eSopenharmony_ci     * @since 10
186361847f8eSopenharmony_ci     */
186461847f8eSopenharmony_ci    /**
186561847f8eSopenharmony_ci     * Multiple options.
186661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
186761847f8eSopenharmony_ci     * @crossplatform
186861847f8eSopenharmony_ci     * @atomicservice
186961847f8eSopenharmony_ci     * @since 11
187061847f8eSopenharmony_ci     */
187161847f8eSopenharmony_ci    MULT_CHOICE = 300,
187261847f8eSopenharmony_ci
187361847f8eSopenharmony_ci    /**
187461847f8eSopenharmony_ci     * <p>Permanently move. The requested resource has been permanently moved to a new URI,
187561847f8eSopenharmony_ci     * and the returned information will include the new URI. The browser will automatically redirect to the new URI.</p>
187661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
187761847f8eSopenharmony_ci     * @since 6
187861847f8eSopenharmony_ci     */
187961847f8eSopenharmony_ci    /**
188061847f8eSopenharmony_ci     * <p>Permanently move. The requested resource has been permanently moved to a new URI,
188161847f8eSopenharmony_ci     * and the returned information will include the new URI. The browser will automatically redirect to the new URI.</p>
188261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
188361847f8eSopenharmony_ci     * @crossplatform
188461847f8eSopenharmony_ci     * @since 10
188561847f8eSopenharmony_ci     */
188661847f8eSopenharmony_ci    /**
188761847f8eSopenharmony_ci     * <p>Permanently move. The requested resource has been permanently moved to a new URI,
188861847f8eSopenharmony_ci     * and the returned information will include the new URI. The browser will automatically redirect to the new URI.</p>
188961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
189061847f8eSopenharmony_ci     * @crossplatform
189161847f8eSopenharmony_ci     * @atomicservice
189261847f8eSopenharmony_ci     * @since 11
189361847f8eSopenharmony_ci     */
189461847f8eSopenharmony_ci    MOVED_PERM,
189561847f8eSopenharmony_ci
189661847f8eSopenharmony_ci    /**
189761847f8eSopenharmony_ci     * Temporary movement.
189861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
189961847f8eSopenharmony_ci     * @since 6
190061847f8eSopenharmony_ci     */
190161847f8eSopenharmony_ci    /**
190261847f8eSopenharmony_ci     * Temporary movement.
190361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
190461847f8eSopenharmony_ci     * @crossplatform
190561847f8eSopenharmony_ci     * @since 10
190661847f8eSopenharmony_ci     */
190761847f8eSopenharmony_ci    /**
190861847f8eSopenharmony_ci     * Temporary movement.
190961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
191061847f8eSopenharmony_ci     * @crossplatform
191161847f8eSopenharmony_ci     * @atomicservice
191261847f8eSopenharmony_ci     * @since 11
191361847f8eSopenharmony_ci     */
191461847f8eSopenharmony_ci    MOVED_TEMP,
191561847f8eSopenharmony_ci
191661847f8eSopenharmony_ci    /**
191761847f8eSopenharmony_ci     * View other addresses.
191861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
191961847f8eSopenharmony_ci     * @since 6
192061847f8eSopenharmony_ci     */
192161847f8eSopenharmony_ci    /**
192261847f8eSopenharmony_ci     * View other addresses.
192361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
192461847f8eSopenharmony_ci     * @crossplatform
192561847f8eSopenharmony_ci     * @since 10
192661847f8eSopenharmony_ci     */
192761847f8eSopenharmony_ci    /**
192861847f8eSopenharmony_ci     * View other addresses.
192961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
193061847f8eSopenharmony_ci     * @crossplatform
193161847f8eSopenharmony_ci     * @atomicservice
193261847f8eSopenharmony_ci     * @since 11
193361847f8eSopenharmony_ci     */
193461847f8eSopenharmony_ci    SEE_OTHER,
193561847f8eSopenharmony_ci
193661847f8eSopenharmony_ci    /**
193761847f8eSopenharmony_ci     * Not modified.
193861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
193961847f8eSopenharmony_ci     * @since 6
194061847f8eSopenharmony_ci     */
194161847f8eSopenharmony_ci    /**
194261847f8eSopenharmony_ci     * Not modified.
194361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
194461847f8eSopenharmony_ci     * @crossplatform
194561847f8eSopenharmony_ci     * @since 10
194661847f8eSopenharmony_ci     */
194761847f8eSopenharmony_ci    /**
194861847f8eSopenharmony_ci     * Not modified.
194961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
195061847f8eSopenharmony_ci     * @crossplatform
195161847f8eSopenharmony_ci     * @atomicservice
195261847f8eSopenharmony_ci     * @since 11
195361847f8eSopenharmony_ci     */
195461847f8eSopenharmony_ci    NOT_MODIFIED,
195561847f8eSopenharmony_ci
195661847f8eSopenharmony_ci    /**
195761847f8eSopenharmony_ci     * Using proxies.
195861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
195961847f8eSopenharmony_ci     * @since 6
196061847f8eSopenharmony_ci     */
196161847f8eSopenharmony_ci    /**
196261847f8eSopenharmony_ci     * Using proxies.
196361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
196461847f8eSopenharmony_ci     * @crossplatform
196561847f8eSopenharmony_ci     * @since 10
196661847f8eSopenharmony_ci     */
196761847f8eSopenharmony_ci    /**
196861847f8eSopenharmony_ci     * Using proxies.
196961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
197061847f8eSopenharmony_ci     * @crossplatform
197161847f8eSopenharmony_ci     * @atomicservice
197261847f8eSopenharmony_ci     * @since 11
197361847f8eSopenharmony_ci     */
197461847f8eSopenharmony_ci    USE_PROXY,
197561847f8eSopenharmony_ci
197661847f8eSopenharmony_ci    /**
197761847f8eSopenharmony_ci     * The server cannot understand the syntax error error requested by the client.
197861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
197961847f8eSopenharmony_ci     * @since 6
198061847f8eSopenharmony_ci     */
198161847f8eSopenharmony_ci    /**
198261847f8eSopenharmony_ci     * The server cannot understand the syntax error error requested by the client.
198361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
198461847f8eSopenharmony_ci     * @crossplatform
198561847f8eSopenharmony_ci     * @since 10
198661847f8eSopenharmony_ci     */
198761847f8eSopenharmony_ci    /**
198861847f8eSopenharmony_ci     * The server cannot understand the syntax error error requested by the client.
198961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
199061847f8eSopenharmony_ci     * @crossplatform
199161847f8eSopenharmony_ci     * @atomicservice
199261847f8eSopenharmony_ci     * @since 11
199361847f8eSopenharmony_ci     */
199461847f8eSopenharmony_ci    BAD_REQUEST = 400,
199561847f8eSopenharmony_ci
199661847f8eSopenharmony_ci    /**
199761847f8eSopenharmony_ci     * Request for user authentication.
199861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
199961847f8eSopenharmony_ci     * @since 6
200061847f8eSopenharmony_ci     */
200161847f8eSopenharmony_ci    /**
200261847f8eSopenharmony_ci     * Request for user authentication.
200361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
200461847f8eSopenharmony_ci     * @crossplatform
200561847f8eSopenharmony_ci     * @since 10
200661847f8eSopenharmony_ci     */
200761847f8eSopenharmony_ci    /**
200861847f8eSopenharmony_ci     * Request for user authentication.
200961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
201061847f8eSopenharmony_ci     * @crossplatform
201161847f8eSopenharmony_ci     * @atomicservice
201261847f8eSopenharmony_ci     * @since 11
201361847f8eSopenharmony_ci     */
201461847f8eSopenharmony_ci    UNAUTHORIZED,
201561847f8eSopenharmony_ci
201661847f8eSopenharmony_ci    /**
201761847f8eSopenharmony_ci     * Reserved for future use.
201861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
201961847f8eSopenharmony_ci     * @since 6
202061847f8eSopenharmony_ci     */
202161847f8eSopenharmony_ci    /**
202261847f8eSopenharmony_ci     * Reserved for future use.
202361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
202461847f8eSopenharmony_ci     * @crossplatform
202561847f8eSopenharmony_ci     * @since 10
202661847f8eSopenharmony_ci     */
202761847f8eSopenharmony_ci    /**
202861847f8eSopenharmony_ci     * Reserved for future use.
202961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
203061847f8eSopenharmony_ci     * @crossplatform
203161847f8eSopenharmony_ci     * @atomicservice
203261847f8eSopenharmony_ci     * @since 11
203361847f8eSopenharmony_ci     */
203461847f8eSopenharmony_ci    PAYMENT_REQUIRED,
203561847f8eSopenharmony_ci
203661847f8eSopenharmony_ci    /**
203761847f8eSopenharmony_ci     * The server understands the request from the requesting client, but refuses to execute it.
203861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
203961847f8eSopenharmony_ci     * @since 6
204061847f8eSopenharmony_ci     */
204161847f8eSopenharmony_ci    /**
204261847f8eSopenharmony_ci     * The server understands the request from the requesting client, but refuses to execute it.
204361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
204461847f8eSopenharmony_ci     * @crossplatform
204561847f8eSopenharmony_ci     * @since 10
204661847f8eSopenharmony_ci     */
204761847f8eSopenharmony_ci    /**
204861847f8eSopenharmony_ci     * The server understands the request from the requesting client, but refuses to execute it.
204961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
205061847f8eSopenharmony_ci     * @crossplatform
205161847f8eSopenharmony_ci     * @atomicservice
205261847f8eSopenharmony_ci     * @since 11
205361847f8eSopenharmony_ci     */
205461847f8eSopenharmony_ci    FORBIDDEN,
205561847f8eSopenharmony_ci
205661847f8eSopenharmony_ci    /**
205761847f8eSopenharmony_ci     * The server was unable to find resources (web pages) based on the client's request.
205861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
205961847f8eSopenharmony_ci     * @since 6
206061847f8eSopenharmony_ci     */
206161847f8eSopenharmony_ci    /**
206261847f8eSopenharmony_ci     * The server was unable to find resources (web pages) based on the client's request.
206361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
206461847f8eSopenharmony_ci     * @crossplatform
206561847f8eSopenharmony_ci     * @since 10
206661847f8eSopenharmony_ci     */
206761847f8eSopenharmony_ci    /**
206861847f8eSopenharmony_ci     * The server was unable to find resources (web pages) based on the client's request.
206961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
207061847f8eSopenharmony_ci     * @crossplatform
207161847f8eSopenharmony_ci     * @atomicservice
207261847f8eSopenharmony_ci     * @since 11
207361847f8eSopenharmony_ci     */
207461847f8eSopenharmony_ci    NOT_FOUND,
207561847f8eSopenharmony_ci
207661847f8eSopenharmony_ci    /**
207761847f8eSopenharmony_ci     * The method in the client request is prohibited.
207861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
207961847f8eSopenharmony_ci     * @since 6
208061847f8eSopenharmony_ci     */
208161847f8eSopenharmony_ci    /**
208261847f8eSopenharmony_ci     * The method in the client request is prohibited.
208361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
208461847f8eSopenharmony_ci     * @crossplatform
208561847f8eSopenharmony_ci     * @since 10
208661847f8eSopenharmony_ci     */
208761847f8eSopenharmony_ci    /**
208861847f8eSopenharmony_ci     * The method in the client request is prohibited.
208961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
209061847f8eSopenharmony_ci     * @crossplatform
209161847f8eSopenharmony_ci     * @atomicservice
209261847f8eSopenharmony_ci     * @since 11
209361847f8eSopenharmony_ci     */
209461847f8eSopenharmony_ci    BAD_METHOD,
209561847f8eSopenharmony_ci
209661847f8eSopenharmony_ci    /**
209761847f8eSopenharmony_ci     * The server is unable to complete the request based on the content characteristics requested by the client.
209861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
209961847f8eSopenharmony_ci     * @since 6
210061847f8eSopenharmony_ci     */
210161847f8eSopenharmony_ci    /**
210261847f8eSopenharmony_ci     * The server is unable to complete the request based on the content characteristics requested by the client.
210361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
210461847f8eSopenharmony_ci     * @crossplatform
210561847f8eSopenharmony_ci     * @since 10
210661847f8eSopenharmony_ci     */
210761847f8eSopenharmony_ci    /**
210861847f8eSopenharmony_ci     * The server is unable to complete the request based on the content characteristics requested by the client.
210961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
211061847f8eSopenharmony_ci     * @crossplatform
211161847f8eSopenharmony_ci     * @atomicservice
211261847f8eSopenharmony_ci     * @since 11
211361847f8eSopenharmony_ci     */
211461847f8eSopenharmony_ci    NOT_ACCEPTABLE,
211561847f8eSopenharmony_ci
211661847f8eSopenharmony_ci    /**
211761847f8eSopenharmony_ci     * Request authentication of the proxy's identity.
211861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
211961847f8eSopenharmony_ci     * @since 6
212061847f8eSopenharmony_ci     */
212161847f8eSopenharmony_ci    /**
212261847f8eSopenharmony_ci     * Request authentication of the proxy's identity.
212361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
212461847f8eSopenharmony_ci     * @crossplatform
212561847f8eSopenharmony_ci     * @since 10
212661847f8eSopenharmony_ci     */
212761847f8eSopenharmony_ci    /**
212861847f8eSopenharmony_ci     * Request authentication of the proxy's identity.
212961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
213061847f8eSopenharmony_ci     * @crossplatform
213161847f8eSopenharmony_ci     * @atomicservice
213261847f8eSopenharmony_ci     * @since 11
213361847f8eSopenharmony_ci     */
213461847f8eSopenharmony_ci    PROXY_AUTH,
213561847f8eSopenharmony_ci
213661847f8eSopenharmony_ci    /**
213761847f8eSopenharmony_ci     * The request took too long and timed out.
213861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
213961847f8eSopenharmony_ci     * @since 6
214061847f8eSopenharmony_ci     */
214161847f8eSopenharmony_ci    /**
214261847f8eSopenharmony_ci     * The request took too long and timed out.
214361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
214461847f8eSopenharmony_ci     * @crossplatform
214561847f8eSopenharmony_ci     * @since 10
214661847f8eSopenharmony_ci     */
214761847f8eSopenharmony_ci    /**
214861847f8eSopenharmony_ci     * The request took too long and timed out.
214961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
215061847f8eSopenharmony_ci     * @crossplatform
215161847f8eSopenharmony_ci     * @atomicservice
215261847f8eSopenharmony_ci     * @since 11
215361847f8eSopenharmony_ci     */
215461847f8eSopenharmony_ci    CLIENT_TIMEOUT,
215561847f8eSopenharmony_ci
215661847f8eSopenharmony_ci    /**
215761847f8eSopenharmony_ci     * <p>The server may have returned this code when completing the client's PUT request,
215861847f8eSopenharmony_ci     * as there was a conflict when the server was processing the request.</p>
215961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
216061847f8eSopenharmony_ci     * @since 6
216161847f8eSopenharmony_ci     */
216261847f8eSopenharmony_ci    /**
216361847f8eSopenharmony_ci     * <p>The server may have returned this code when completing the client's PUT request,
216461847f8eSopenharmony_ci     * as there was a conflict when the server was processing the request.</p>
216561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
216661847f8eSopenharmony_ci     * @crossplatform
216761847f8eSopenharmony_ci     * @since 10
216861847f8eSopenharmony_ci     */
216961847f8eSopenharmony_ci    /**
217061847f8eSopenharmony_ci     * <p>The server may have returned this code when completing the client's PUT request,
217161847f8eSopenharmony_ci     * as there was a conflict when the server was processing the request.</p>
217261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
217361847f8eSopenharmony_ci     * @crossplatform
217461847f8eSopenharmony_ci     * @atomicservice
217561847f8eSopenharmony_ci     * @since 11
217661847f8eSopenharmony_ci     */
217761847f8eSopenharmony_ci    CONFLICT,
217861847f8eSopenharmony_ci
217961847f8eSopenharmony_ci    /**
218061847f8eSopenharmony_ci     * The resource requested by the client no longer exists.
218161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
218261847f8eSopenharmony_ci     * @since 6
218361847f8eSopenharmony_ci     */
218461847f8eSopenharmony_ci    /**
218561847f8eSopenharmony_ci     * The resource requested by the client no longer exists.
218661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
218761847f8eSopenharmony_ci     * @crossplatform
218861847f8eSopenharmony_ci     * @since 10
218961847f8eSopenharmony_ci     */
219061847f8eSopenharmony_ci    /**
219161847f8eSopenharmony_ci     * The resource requested by the client no longer exists.
219261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
219361847f8eSopenharmony_ci     * @crossplatform
219461847f8eSopenharmony_ci     * @atomicservice
219561847f8eSopenharmony_ci     * @since 11
219661847f8eSopenharmony_ci     */
219761847f8eSopenharmony_ci    GONE,
219861847f8eSopenharmony_ci
219961847f8eSopenharmony_ci    /**
220061847f8eSopenharmony_ci     * The server is unable to process request information sent by the client without Content Length.
220161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
220261847f8eSopenharmony_ci     * @since 6
220361847f8eSopenharmony_ci     */
220461847f8eSopenharmony_ci    /**
220561847f8eSopenharmony_ci     * The server is unable to process request information sent by the client without Content Length.
220661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
220761847f8eSopenharmony_ci     * @crossplatform
220861847f8eSopenharmony_ci     * @since 10
220961847f8eSopenharmony_ci     */
221061847f8eSopenharmony_ci    /**
221161847f8eSopenharmony_ci     * The server is unable to process request information sent by the client without Content Length.
221261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
221361847f8eSopenharmony_ci     * @crossplatform
221461847f8eSopenharmony_ci     * @atomicservice
221561847f8eSopenharmony_ci     * @since 11
221661847f8eSopenharmony_ci     */
221761847f8eSopenharmony_ci    LENGTH_REQUIRED,
221861847f8eSopenharmony_ci
221961847f8eSopenharmony_ci    /**
222061847f8eSopenharmony_ci     * The prerequisite for requesting information from the client is incorrect.
222161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
222261847f8eSopenharmony_ci     * @since 6
222361847f8eSopenharmony_ci     */
222461847f8eSopenharmony_ci    /**
222561847f8eSopenharmony_ci     * The prerequisite for requesting information from the client is incorrect.
222661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
222761847f8eSopenharmony_ci     * @crossplatform
222861847f8eSopenharmony_ci     * @since 10
222961847f8eSopenharmony_ci     */
223061847f8eSopenharmony_ci    /**
223161847f8eSopenharmony_ci     * The prerequisite for requesting information from the client is incorrect.
223261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
223361847f8eSopenharmony_ci     * @crossplatform
223461847f8eSopenharmony_ci     * @atomicservice
223561847f8eSopenharmony_ci     * @since 11
223661847f8eSopenharmony_ci     */
223761847f8eSopenharmony_ci    PRECON_FAILED,
223861847f8eSopenharmony_ci
223961847f8eSopenharmony_ci    /**
224061847f8eSopenharmony_ci     * The request was rejected because the requested entity was too large for the server to process.
224161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
224261847f8eSopenharmony_ci     * @since 6
224361847f8eSopenharmony_ci     */
224461847f8eSopenharmony_ci    /**
224561847f8eSopenharmony_ci     * The request was rejected because the requested entity was too large for the server to process.
224661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
224761847f8eSopenharmony_ci     * @crossplatform
224861847f8eSopenharmony_ci     * @since 10
224961847f8eSopenharmony_ci     */
225061847f8eSopenharmony_ci    /**
225161847f8eSopenharmony_ci     * The request was rejected because the requested entity was too large for the server to process.
225261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
225361847f8eSopenharmony_ci     * @crossplatform
225461847f8eSopenharmony_ci     * @atomicservice
225561847f8eSopenharmony_ci     * @since 11
225661847f8eSopenharmony_ci     */
225761847f8eSopenharmony_ci    ENTITY_TOO_LARGE,
225861847f8eSopenharmony_ci
225961847f8eSopenharmony_ci    /**
226061847f8eSopenharmony_ci     * The requested URI is too long (usually a URL) and the server cannot process it.
226161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
226261847f8eSopenharmony_ci     * @since 6
226361847f8eSopenharmony_ci     */
226461847f8eSopenharmony_ci    /**
226561847f8eSopenharmony_ci     * The requested URI is too long (usually a URL) and the server cannot process it.
226661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
226761847f8eSopenharmony_ci     * @crossplatform
226861847f8eSopenharmony_ci     * @since 10
226961847f8eSopenharmony_ci     */
227061847f8eSopenharmony_ci    /**
227161847f8eSopenharmony_ci     * The requested URI is too long (usually a URL) and the server cannot process it.
227261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
227361847f8eSopenharmony_ci     * @crossplatform
227461847f8eSopenharmony_ci     * @atomicservice
227561847f8eSopenharmony_ci     * @since 11
227661847f8eSopenharmony_ci     */
227761847f8eSopenharmony_ci    REQ_TOO_LONG,
227861847f8eSopenharmony_ci
227961847f8eSopenharmony_ci    /**
228061847f8eSopenharmony_ci     * The server is unable to process the requested format.
228161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
228261847f8eSopenharmony_ci     * @since 6
228361847f8eSopenharmony_ci     */
228461847f8eSopenharmony_ci    /**
228561847f8eSopenharmony_ci     * The server is unable to process the requested format.
228661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
228761847f8eSopenharmony_ci     * @crossplatform
228861847f8eSopenharmony_ci     * @since 10
228961847f8eSopenharmony_ci     */
229061847f8eSopenharmony_ci    /**
229161847f8eSopenharmony_ci     * The server is unable to process the requested format.
229261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
229361847f8eSopenharmony_ci     * @crossplatform
229461847f8eSopenharmony_ci     * @atomicservice
229561847f8eSopenharmony_ci     * @since 11
229661847f8eSopenharmony_ci     */
229761847f8eSopenharmony_ci    UNSUPPORTED_TYPE,
229861847f8eSopenharmony_ci
229961847f8eSopenharmony_ci    /**
230061847f8eSopenharmony_ci     * The server cannot process the requested data range.
230161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
230261847f8eSopenharmony_ci     * @crossplatform
230361847f8eSopenharmony_ci     * @atomicservice
230461847f8eSopenharmony_ci     * @since 12
230561847f8eSopenharmony_ci     */
230661847f8eSopenharmony_ci    RANGE_NOT_SATISFIABLE,
230761847f8eSopenharmony_ci
230861847f8eSopenharmony_ci    /**
230961847f8eSopenharmony_ci     * Internal server error, unable to complete the request.
231061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
231161847f8eSopenharmony_ci     * @since 6
231261847f8eSopenharmony_ci     */
231361847f8eSopenharmony_ci    /**
231461847f8eSopenharmony_ci     * Internal server error, unable to complete the request.
231561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
231661847f8eSopenharmony_ci     * @crossplatform
231761847f8eSopenharmony_ci     * @since 10
231861847f8eSopenharmony_ci     */
231961847f8eSopenharmony_ci    /**
232061847f8eSopenharmony_ci     * Internal server error, unable to complete the request.
232161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
232261847f8eSopenharmony_ci     * @crossplatform
232361847f8eSopenharmony_ci     * @atomicservice
232461847f8eSopenharmony_ci     * @since 11
232561847f8eSopenharmony_ci     */
232661847f8eSopenharmony_ci    INTERNAL_ERROR = 500,
232761847f8eSopenharmony_ci
232861847f8eSopenharmony_ci    /**
232961847f8eSopenharmony_ci     * The server does not support the requested functionality and cannot complete the request.
233061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
233161847f8eSopenharmony_ci     * @since 6
233261847f8eSopenharmony_ci     */
233361847f8eSopenharmony_ci    /**
233461847f8eSopenharmony_ci     * The server does not support the requested functionality and cannot complete the request.
233561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
233661847f8eSopenharmony_ci     * @crossplatform
233761847f8eSopenharmony_ci     * @since 10
233861847f8eSopenharmony_ci     */
233961847f8eSopenharmony_ci    /**
234061847f8eSopenharmony_ci     * The server does not support the requested functionality and cannot complete the request.
234161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
234261847f8eSopenharmony_ci     * @crossplatform
234361847f8eSopenharmony_ci     * @atomicservice
234461847f8eSopenharmony_ci     * @since 11
234561847f8eSopenharmony_ci     */
234661847f8eSopenharmony_ci    NOT_IMPLEMENTED,
234761847f8eSopenharmony_ci
234861847f8eSopenharmony_ci    /**
234961847f8eSopenharmony_ci     * The server acting as a gateway or proxy received an invalid request from the remote server.
235061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
235161847f8eSopenharmony_ci     * @since 6
235261847f8eSopenharmony_ci     */
235361847f8eSopenharmony_ci    /**
235461847f8eSopenharmony_ci     * The server acting as a gateway or proxy received an invalid request from the remote server.
235561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
235661847f8eSopenharmony_ci     * @crossplatform
235761847f8eSopenharmony_ci     * @since 10
235861847f8eSopenharmony_ci     */
235961847f8eSopenharmony_ci    /**
236061847f8eSopenharmony_ci     * The server acting as a gateway or proxy received an invalid request from the remote server.
236161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
236261847f8eSopenharmony_ci     * @crossplatform
236361847f8eSopenharmony_ci     * @atomicservice
236461847f8eSopenharmony_ci     * @since 11
236561847f8eSopenharmony_ci     */
236661847f8eSopenharmony_ci    BAD_GATEWAY,
236761847f8eSopenharmony_ci
236861847f8eSopenharmony_ci    /**
236961847f8eSopenharmony_ci     * Due to overload or system maintenance, the server is temporarily unable to process client requests.
237061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
237161847f8eSopenharmony_ci     * @since 6
237261847f8eSopenharmony_ci     */
237361847f8eSopenharmony_ci    /**
237461847f8eSopenharmony_ci     * Due to overload or system maintenance, the server is temporarily unable to process client requests.
237561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
237661847f8eSopenharmony_ci     * @crossplatform
237761847f8eSopenharmony_ci     * @since 10
237861847f8eSopenharmony_ci     */
237961847f8eSopenharmony_ci    /**
238061847f8eSopenharmony_ci     * Due to overload or system maintenance, the server is temporarily unable to process client requests.
238161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
238261847f8eSopenharmony_ci     * @crossplatform
238361847f8eSopenharmony_ci     * @atomicservice
238461847f8eSopenharmony_ci     * @since 11
238561847f8eSopenharmony_ci     */
238661847f8eSopenharmony_ci    UNAVAILABLE,
238761847f8eSopenharmony_ci
238861847f8eSopenharmony_ci    /**
238961847f8eSopenharmony_ci     * The server acting as a gateway or proxy did not obtain requests from the remote server in a timely manner.
239061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
239161847f8eSopenharmony_ci     * @since 6
239261847f8eSopenharmony_ci     */
239361847f8eSopenharmony_ci    /**
239461847f8eSopenharmony_ci     * The server acting as a gateway or proxy did not obtain requests from the remote server in a timely manner.
239561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
239661847f8eSopenharmony_ci     * @crossplatform
239761847f8eSopenharmony_ci     * @since 10
239861847f8eSopenharmony_ci     */
239961847f8eSopenharmony_ci    /**
240061847f8eSopenharmony_ci     * The server acting as a gateway or proxy did not obtain requests from the remote server in a timely manner.
240161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
240261847f8eSopenharmony_ci     * @crossplatform
240361847f8eSopenharmony_ci     * @atomicservice
240461847f8eSopenharmony_ci     * @since 11
240561847f8eSopenharmony_ci     */
240661847f8eSopenharmony_ci    GATEWAY_TIMEOUT,
240761847f8eSopenharmony_ci
240861847f8eSopenharmony_ci    /**
240961847f8eSopenharmony_ci     * The version of the HTTP protocol requested by the server.
241061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
241161847f8eSopenharmony_ci     * @since 6
241261847f8eSopenharmony_ci     */
241361847f8eSopenharmony_ci    /**
241461847f8eSopenharmony_ci     * The version of the HTTP protocol requested by the server.
241561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
241661847f8eSopenharmony_ci     * @crossplatform
241761847f8eSopenharmony_ci     * @since 10
241861847f8eSopenharmony_ci     */
241961847f8eSopenharmony_ci    /**
242061847f8eSopenharmony_ci     * The version of the HTTP protocol requested by the server.
242161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
242261847f8eSopenharmony_ci     * @crossplatform
242361847f8eSopenharmony_ci     * @atomicservice
242461847f8eSopenharmony_ci     * @since 11
242561847f8eSopenharmony_ci     */
242661847f8eSopenharmony_ci    VERSION
242761847f8eSopenharmony_ci  }
242861847f8eSopenharmony_ci
242961847f8eSopenharmony_ci  /**
243061847f8eSopenharmony_ci   * Supported protocols.
243161847f8eSopenharmony_ci   * @enum {string}
243261847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
243361847f8eSopenharmony_ci   * @since 9
243461847f8eSopenharmony_ci   */
243561847f8eSopenharmony_ci  /**
243661847f8eSopenharmony_ci   * Supported protocols.
243761847f8eSopenharmony_ci   * @enum {string}
243861847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
243961847f8eSopenharmony_ci   * @crossplatform
244061847f8eSopenharmony_ci   * @since 10
244161847f8eSopenharmony_ci   */
244261847f8eSopenharmony_ci  /**
244361847f8eSopenharmony_ci   * Supported protocols.
244461847f8eSopenharmony_ci   * @enum {string}
244561847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
244661847f8eSopenharmony_ci   * @crossplatform
244761847f8eSopenharmony_ci   * @atomicservice
244861847f8eSopenharmony_ci   * @since 11
244961847f8eSopenharmony_ci   */
245061847f8eSopenharmony_ci
245161847f8eSopenharmony_ci  export enum HttpProtocol {
245261847f8eSopenharmony_ci    /**
245361847f8eSopenharmony_ci     * Protocol http1.1
245461847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
245561847f8eSopenharmony_ci     * @since 9
245661847f8eSopenharmony_ci     */
245761847f8eSopenharmony_ci    /**
245861847f8eSopenharmony_ci     * Protocol http1.1
245961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
246061847f8eSopenharmony_ci     * @crossplatform
246161847f8eSopenharmony_ci     * @since 10
246261847f8eSopenharmony_ci     */
246361847f8eSopenharmony_ci    /**
246461847f8eSopenharmony_ci     * Protocol http1.1
246561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
246661847f8eSopenharmony_ci     * @crossplatform
246761847f8eSopenharmony_ci     * @atomicservice
246861847f8eSopenharmony_ci     * @since 11
246961847f8eSopenharmony_ci     */
247061847f8eSopenharmony_ci    HTTP1_1,
247161847f8eSopenharmony_ci
247261847f8eSopenharmony_ci    /**
247361847f8eSopenharmony_ci     * Protocol http2
247461847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
247561847f8eSopenharmony_ci     * @since 9
247661847f8eSopenharmony_ci     */
247761847f8eSopenharmony_ci    /**
247861847f8eSopenharmony_ci     * Protocol http2
247961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
248061847f8eSopenharmony_ci     * @crossplatform
248161847f8eSopenharmony_ci     * @since 10
248261847f8eSopenharmony_ci     */
248361847f8eSopenharmony_ci    /**
248461847f8eSopenharmony_ci     * Protocol http2
248561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
248661847f8eSopenharmony_ci     * @crossplatform
248761847f8eSopenharmony_ci     * @atomicservice
248861847f8eSopenharmony_ci     * @since 11
248961847f8eSopenharmony_ci     */
249061847f8eSopenharmony_ci    HTTP2,
249161847f8eSopenharmony_ci
249261847f8eSopenharmony_ci    /**
249361847f8eSopenharmony_ci     * Protocol http3 for https only.
249461847f8eSopenharmony_ci     * Cause error if using http only or not supporting http3 on this device.
249561847f8eSopenharmony_ci     * Fallback to http2 or http1.1 if needed.
249661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
249761847f8eSopenharmony_ci     * @since 11
249861847f8eSopenharmony_ci     */
249961847f8eSopenharmony_ci    /**
250061847f8eSopenharmony_ci     * Protocol http3 for https only.
250161847f8eSopenharmony_ci     * Cause error if using http only or not supporting http3 on this device.
250261847f8eSopenharmony_ci     * Fallback to http2 or http1.1 if needed.
250361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
250461847f8eSopenharmony_ci     * @crossplatform
250561847f8eSopenharmony_ci     * @since 12
250661847f8eSopenharmony_ci     */
250761847f8eSopenharmony_ci    HTTP3
250861847f8eSopenharmony_ci  }
250961847f8eSopenharmony_ci
251061847f8eSopenharmony_ci  /**
251161847f8eSopenharmony_ci   * Indicates the type of the returned data.
251261847f8eSopenharmony_ci   * @enum {number}
251361847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
251461847f8eSopenharmony_ci   * @since 9
251561847f8eSopenharmony_ci   */
251661847f8eSopenharmony_ci  /**
251761847f8eSopenharmony_ci   * Indicates the type of the returned data.
251861847f8eSopenharmony_ci   * @enum {number}
251961847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
252061847f8eSopenharmony_ci   * @crossplatform
252161847f8eSopenharmony_ci   * @since 10
252261847f8eSopenharmony_ci   */
252361847f8eSopenharmony_ci  /**
252461847f8eSopenharmony_ci   * Indicates the type of the returned data.
252561847f8eSopenharmony_ci   * @enum {number}
252661847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
252761847f8eSopenharmony_ci   * @crossplatform
252861847f8eSopenharmony_ci   * @atomicservice
252961847f8eSopenharmony_ci   * @since 11
253061847f8eSopenharmony_ci   */
253161847f8eSopenharmony_ci  export enum HttpDataType {
253261847f8eSopenharmony_ci    /**
253361847f8eSopenharmony_ci     * The returned type is string.
253461847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
253561847f8eSopenharmony_ci     * @since 9
253661847f8eSopenharmony_ci     */
253761847f8eSopenharmony_ci    /**
253861847f8eSopenharmony_ci     * The returned type is string.
253961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
254061847f8eSopenharmony_ci     * @crossplatform
254161847f8eSopenharmony_ci     * @since 10
254261847f8eSopenharmony_ci     */
254361847f8eSopenharmony_ci    /**
254461847f8eSopenharmony_ci     * The returned type is string.
254561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
254661847f8eSopenharmony_ci     * @crossplatform
254761847f8eSopenharmony_ci     * @atomicservice
254861847f8eSopenharmony_ci     * @since 11
254961847f8eSopenharmony_ci     */
255061847f8eSopenharmony_ci    STRING,
255161847f8eSopenharmony_ci
255261847f8eSopenharmony_ci    /**
255361847f8eSopenharmony_ci     * The returned type is Object.
255461847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
255561847f8eSopenharmony_ci     * @since 9
255661847f8eSopenharmony_ci     */
255761847f8eSopenharmony_ci    /**
255861847f8eSopenharmony_ci     * The returned type is Object.
255961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
256061847f8eSopenharmony_ci     * @crossplatform
256161847f8eSopenharmony_ci     * @since 10
256261847f8eSopenharmony_ci     */
256361847f8eSopenharmony_ci    /**
256461847f8eSopenharmony_ci     * The returned type is Object.
256561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
256661847f8eSopenharmony_ci     * @crossplatform
256761847f8eSopenharmony_ci     * @atomicservice
256861847f8eSopenharmony_ci     * @since 11
256961847f8eSopenharmony_ci     */
257061847f8eSopenharmony_ci    OBJECT = 1,
257161847f8eSopenharmony_ci
257261847f8eSopenharmony_ci    /**
257361847f8eSopenharmony_ci     * The returned type is ArrayBuffer.
257461847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
257561847f8eSopenharmony_ci     * @since 9
257661847f8eSopenharmony_ci     */
257761847f8eSopenharmony_ci    /**
257861847f8eSopenharmony_ci     * The returned type is ArrayBuffer.
257961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
258061847f8eSopenharmony_ci     * @crossplatform
258161847f8eSopenharmony_ci     * @since 10
258261847f8eSopenharmony_ci     */
258361847f8eSopenharmony_ci    /**
258461847f8eSopenharmony_ci     * The returned type is ArrayBuffer.
258561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
258661847f8eSopenharmony_ci     * @crossplatform
258761847f8eSopenharmony_ci     * @atomicservice
258861847f8eSopenharmony_ci     * @since 11
258961847f8eSopenharmony_ci     */
259061847f8eSopenharmony_ci    ARRAY_BUFFER = 2
259161847f8eSopenharmony_ci  }
259261847f8eSopenharmony_ci
259361847f8eSopenharmony_ci  /**
259461847f8eSopenharmony_ci   * Defines the response to an HTTP request.
259561847f8eSopenharmony_ci   * @interface HttpResponse
259661847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
259761847f8eSopenharmony_ci   * @since 6
259861847f8eSopenharmony_ci   */
259961847f8eSopenharmony_ci  /**
260061847f8eSopenharmony_ci   * Defines the response to an HTTP request.
260161847f8eSopenharmony_ci   * @interface HttpResponse
260261847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
260361847f8eSopenharmony_ci   * @crossplatform
260461847f8eSopenharmony_ci   * @since 10
260561847f8eSopenharmony_ci   */
260661847f8eSopenharmony_ci  /**
260761847f8eSopenharmony_ci   * Defines the response to an HTTP request.
260861847f8eSopenharmony_ci   * @interface HttpResponse
260961847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
261061847f8eSopenharmony_ci   * @crossplatform
261161847f8eSopenharmony_ci   * @atomicservice
261261847f8eSopenharmony_ci   * @since 11
261361847f8eSopenharmony_ci   */
261461847f8eSopenharmony_ci  export interface HttpResponse {
261561847f8eSopenharmony_ci    /**
261661847f8eSopenharmony_ci     * result can be a string (API 6) or an ArrayBuffer(API 8). Object is deprecated from API 8.
261761847f8eSopenharmony_ci     * If {@link HttpRequestOptions#expectDataType} is set, the system preferentially returns this parameter.
261861847f8eSopenharmony_ci     * @type {string | Object | ArrayBuffer}
261961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
262061847f8eSopenharmony_ci     * @since 6
262161847f8eSopenharmony_ci     */
262261847f8eSopenharmony_ci    /**
262361847f8eSopenharmony_ci     * result can be a string (API 6) or an ArrayBuffer(API 8). Object is deprecated from API 8.
262461847f8eSopenharmony_ci     * If {@link HttpRequestOptions#expectDataType} is set, the system preferentially returns this parameter.
262561847f8eSopenharmony_ci     * @type {string | Object | ArrayBuffer}
262661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
262761847f8eSopenharmony_ci     * @crossplatform
262861847f8eSopenharmony_ci     * @since 10
262961847f8eSopenharmony_ci     */
263061847f8eSopenharmony_ci    /**
263161847f8eSopenharmony_ci     * result can be a string (API 6) or an ArrayBuffer(API 8). Object is deprecated from API 8.
263261847f8eSopenharmony_ci     * If {@link HttpRequestOptions#expectDataType} is set, the system preferentially returns this parameter.
263361847f8eSopenharmony_ci     * @type {string | Object | ArrayBuffer}
263461847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
263561847f8eSopenharmony_ci     * @crossplatform
263661847f8eSopenharmony_ci     * @atomicservice
263761847f8eSopenharmony_ci     * @since 11
263861847f8eSopenharmony_ci     */
263961847f8eSopenharmony_ci    result: string | Object | ArrayBuffer;
264061847f8eSopenharmony_ci
264161847f8eSopenharmony_ci    /**
264261847f8eSopenharmony_ci     * If the resultType is string, you can get result directly.
264361847f8eSopenharmony_ci     * If the resultType is Object, you can get result such as this: result['key'].
264461847f8eSopenharmony_ci     * If the resultType is ArrayBuffer, you can use ArrayBuffer to create the binary objects.
264561847f8eSopenharmony_ci     * @type {HttpDataType}
264661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
264761847f8eSopenharmony_ci     * @since 9
264861847f8eSopenharmony_ci     */
264961847f8eSopenharmony_ci    /**
265061847f8eSopenharmony_ci     * If the resultType is string, you can get result directly.
265161847f8eSopenharmony_ci     * If the resultType is Object, you can get result such as this: result['key'].
265261847f8eSopenharmony_ci     * If the resultType is ArrayBuffer, you can use ArrayBuffer to create the binary objects.
265361847f8eSopenharmony_ci     * @type {HttpDataType}
265461847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
265561847f8eSopenharmony_ci     * @crossplatform
265661847f8eSopenharmony_ci     * @since 10
265761847f8eSopenharmony_ci     */
265861847f8eSopenharmony_ci    /**
265961847f8eSopenharmony_ci     * If the resultType is string, you can get result directly.
266061847f8eSopenharmony_ci     * If the resultType is Object, you can get result such as this: result['key'].
266161847f8eSopenharmony_ci     * If the resultType is ArrayBuffer, you can use ArrayBuffer to create the binary objects.
266261847f8eSopenharmony_ci     * @type {HttpDataType}
266361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
266461847f8eSopenharmony_ci     * @crossplatform
266561847f8eSopenharmony_ci     * @atomicservice
266661847f8eSopenharmony_ci     * @since 11
266761847f8eSopenharmony_ci     */
266861847f8eSopenharmony_ci    resultType: HttpDataType;
266961847f8eSopenharmony_ci
267061847f8eSopenharmony_ci    /**
267161847f8eSopenharmony_ci     * Server status code.
267261847f8eSopenharmony_ci     * @type {ResponseCode | number}
267361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
267461847f8eSopenharmony_ci     * @since 6
267561847f8eSopenharmony_ci     */
267661847f8eSopenharmony_ci    /**
267761847f8eSopenharmony_ci     * Server status code.
267861847f8eSopenharmony_ci     * @type {ResponseCode | number}
267961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
268061847f8eSopenharmony_ci     * @crossplatform
268161847f8eSopenharmony_ci     * @since 10
268261847f8eSopenharmony_ci     */
268361847f8eSopenharmony_ci    /**
268461847f8eSopenharmony_ci     * Server status code.
268561847f8eSopenharmony_ci     * @type {ResponseCode | number}
268661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
268761847f8eSopenharmony_ci     * @crossplatform
268861847f8eSopenharmony_ci     * @atomicservice
268961847f8eSopenharmony_ci     * @since 11
269061847f8eSopenharmony_ci     */
269161847f8eSopenharmony_ci    responseCode: ResponseCode | number;
269261847f8eSopenharmony_ci
269361847f8eSopenharmony_ci    /**
269461847f8eSopenharmony_ci     * All headers in the response from the server.
269561847f8eSopenharmony_ci     * @type {Object}
269661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
269761847f8eSopenharmony_ci     * @since 6
269861847f8eSopenharmony_ci     */
269961847f8eSopenharmony_ci    /**
270061847f8eSopenharmony_ci     * All headers in the response from the server.
270161847f8eSopenharmony_ci     * @type {Object}
270261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
270361847f8eSopenharmony_ci     * @crossplatform
270461847f8eSopenharmony_ci     * @since 10
270561847f8eSopenharmony_ci     */
270661847f8eSopenharmony_ci    /**
270761847f8eSopenharmony_ci     * All headers in the response from the server.
270861847f8eSopenharmony_ci     * @type {Object}
270961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
271061847f8eSopenharmony_ci     * @crossplatform
271161847f8eSopenharmony_ci     * @atomicservice
271261847f8eSopenharmony_ci     * @since 11
271361847f8eSopenharmony_ci     */
271461847f8eSopenharmony_ci    header: Object;
271561847f8eSopenharmony_ci
271661847f8eSopenharmony_ci    /**
271761847f8eSopenharmony_ci     * Cookies returned by the server.
271861847f8eSopenharmony_ci     * @type {string}
271961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
272061847f8eSopenharmony_ci     * @since 8
272161847f8eSopenharmony_ci     */
272261847f8eSopenharmony_ci    /**
272361847f8eSopenharmony_ci     * Cookies returned by the server.
272461847f8eSopenharmony_ci     * @type {string}
272561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
272661847f8eSopenharmony_ci     * @crossplatform
272761847f8eSopenharmony_ci     * @since 10
272861847f8eSopenharmony_ci     */
272961847f8eSopenharmony_ci    /**
273061847f8eSopenharmony_ci     * Cookies returned by the server.
273161847f8eSopenharmony_ci     * @type {string}
273261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
273361847f8eSopenharmony_ci     * @crossplatform
273461847f8eSopenharmony_ci     * @atomicservice
273561847f8eSopenharmony_ci     * @since 11
273661847f8eSopenharmony_ci     */
273761847f8eSopenharmony_ci    cookies: string;
273861847f8eSopenharmony_ci
273961847f8eSopenharmony_ci    /**
274061847f8eSopenharmony_ci     * The time taken of various stages of HTTP request.
274161847f8eSopenharmony_ci     * @type {PerformanceTiming}
274261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
274361847f8eSopenharmony_ci     * @since 11
274461847f8eSopenharmony_ci     */
274561847f8eSopenharmony_ci    /**
274661847f8eSopenharmony_ci     * The time taken of various stages of HTTP request.
274761847f8eSopenharmony_ci     * @type {PerformanceTiming}
274861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
274961847f8eSopenharmony_ci     * @crossplatform
275061847f8eSopenharmony_ci     * @since 12
275161847f8eSopenharmony_ci     */
275261847f8eSopenharmony_ci    performanceTiming: PerformanceTiming;
275361847f8eSopenharmony_ci  }
275461847f8eSopenharmony_ci
275561847f8eSopenharmony_ci  /**
275661847f8eSopenharmony_ci   * Counting the time taken of various stages of HTTP request.
275761847f8eSopenharmony_ci   * @interface PerformanceTiming
275861847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
275961847f8eSopenharmony_ci   * @since 11
276061847f8eSopenharmony_ci   */
276161847f8eSopenharmony_ci  /**
276261847f8eSopenharmony_ci   * Counting the time taken of various stages of HTTP request.
276361847f8eSopenharmony_ci   * @interface PerformanceTiming
276461847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
276561847f8eSopenharmony_ci   * @crossplatform
276661847f8eSopenharmony_ci   * @since 12
276761847f8eSopenharmony_ci   */
276861847f8eSopenharmony_ci  export interface PerformanceTiming {
276961847f8eSopenharmony_ci    /**
277061847f8eSopenharmony_ci     * Time taken from startup to DNS resolution completion, in milliseconds.
277161847f8eSopenharmony_ci     * @type {number}
277261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
277361847f8eSopenharmony_ci     * @since 11
277461847f8eSopenharmony_ci     */
277561847f8eSopenharmony_ci    /**
277661847f8eSopenharmony_ci     * Time taken from startup to DNS resolution completion, in milliseconds.
277761847f8eSopenharmony_ci     * @type {number}
277861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
277961847f8eSopenharmony_ci     * @crossplatform
278061847f8eSopenharmony_ci     * @since 12
278161847f8eSopenharmony_ci     */
278261847f8eSopenharmony_ci    dnsTiming: number;
278361847f8eSopenharmony_ci
278461847f8eSopenharmony_ci    /**
278561847f8eSopenharmony_ci     * Time taken from startup to TCP connection completion, in milliseconds.
278661847f8eSopenharmony_ci     * @type {number}
278761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
278861847f8eSopenharmony_ci     * @since 11
278961847f8eSopenharmony_ci     */
279061847f8eSopenharmony_ci    /**
279161847f8eSopenharmony_ci     * Time taken from startup to TCP connection completion, in milliseconds.
279261847f8eSopenharmony_ci     * @type {number}
279361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
279461847f8eSopenharmony_ci     * @crossplatform
279561847f8eSopenharmony_ci     * @since 12
279661847f8eSopenharmony_ci     */
279761847f8eSopenharmony_ci    tcpTiming: number;
279861847f8eSopenharmony_ci
279961847f8eSopenharmony_ci    /**
280061847f8eSopenharmony_ci     * Time taken from startup to TLS connection completion, in milliseconds.
280161847f8eSopenharmony_ci     * @type {number}
280261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
280361847f8eSopenharmony_ci     * @since 11
280461847f8eSopenharmony_ci     */
280561847f8eSopenharmony_ci    /**
280661847f8eSopenharmony_ci     * Time taken from startup to TLS connection completion, in milliseconds.
280761847f8eSopenharmony_ci     * @type {number}
280861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
280961847f8eSopenharmony_ci     * @crossplatform
281061847f8eSopenharmony_ci     * @since 12
281161847f8eSopenharmony_ci     */
281261847f8eSopenharmony_ci    tlsTiming: number;
281361847f8eSopenharmony_ci
281461847f8eSopenharmony_ci    /**
281561847f8eSopenharmony_ci     * Time taken from startup to start sending the first byte, in milliseconds.
281661847f8eSopenharmony_ci     * @type {number}
281761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
281861847f8eSopenharmony_ci     * @since 11
281961847f8eSopenharmony_ci     */
282061847f8eSopenharmony_ci    /**
282161847f8eSopenharmony_ci     * Time taken from startup to start sending the first byte, in milliseconds.
282261847f8eSopenharmony_ci     * @type {number}
282361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
282461847f8eSopenharmony_ci     * @crossplatform
282561847f8eSopenharmony_ci     * @since 12
282661847f8eSopenharmony_ci     */
282761847f8eSopenharmony_ci    firstSendTiming: number;
282861847f8eSopenharmony_ci
282961847f8eSopenharmony_ci    /**
283061847f8eSopenharmony_ci     * Time taken from startup to receiving the first byte, in milliseconds.
283161847f8eSopenharmony_ci     * @type {number}
283261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
283361847f8eSopenharmony_ci     * @since 11
283461847f8eSopenharmony_ci     */
283561847f8eSopenharmony_ci    /**
283661847f8eSopenharmony_ci     * Time taken from startup to receiving the first byte, in milliseconds.
283761847f8eSopenharmony_ci     * @type {number}
283861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
283961847f8eSopenharmony_ci     * @crossplatform
284061847f8eSopenharmony_ci     * @since 12
284161847f8eSopenharmony_ci     */
284261847f8eSopenharmony_ci    firstReceiveTiming: number;
284361847f8eSopenharmony_ci
284461847f8eSopenharmony_ci    /**
284561847f8eSopenharmony_ci     * Time taken from startup to the completion of the request, in milliseconds.
284661847f8eSopenharmony_ci     * @type {number}
284761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
284861847f8eSopenharmony_ci     * @since 11
284961847f8eSopenharmony_ci     */
285061847f8eSopenharmony_ci    /**
285161847f8eSopenharmony_ci     * Time taken from startup to the completion of the request, in milliseconds.
285261847f8eSopenharmony_ci     * @type {number}
285361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
285461847f8eSopenharmony_ci     * @crossplatform
285561847f8eSopenharmony_ci     * @since 12
285661847f8eSopenharmony_ci     */
285761847f8eSopenharmony_ci    totalFinishTiming: number;
285861847f8eSopenharmony_ci
285961847f8eSopenharmony_ci    /**
286061847f8eSopenharmony_ci     * Time taken from startup to completion of all redirection steps, in milliseconds.
286161847f8eSopenharmony_ci     * @type {number}
286261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
286361847f8eSopenharmony_ci     * @since 11
286461847f8eSopenharmony_ci     */
286561847f8eSopenharmony_ci    /**
286661847f8eSopenharmony_ci     * Time taken from startup to completion of all redirection steps, in milliseconds.
286761847f8eSopenharmony_ci     * @type {number}
286861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
286961847f8eSopenharmony_ci     * @crossplatform
287061847f8eSopenharmony_ci     * @since 12
287161847f8eSopenharmony_ci     */
287261847f8eSopenharmony_ci    redirectTiming: number;
287361847f8eSopenharmony_ci
287461847f8eSopenharmony_ci    /**
287561847f8eSopenharmony_ci     * Time taken from HTTP request to header completion, in milliseconds.
287661847f8eSopenharmony_ci     * @type {number}
287761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
287861847f8eSopenharmony_ci     * @since 11
287961847f8eSopenharmony_ci     */
288061847f8eSopenharmony_ci    /**
288161847f8eSopenharmony_ci     * Time taken from HTTP request to header completion, in milliseconds.
288261847f8eSopenharmony_ci     * @type {number}
288361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
288461847f8eSopenharmony_ci     * @crossplatform
288561847f8eSopenharmony_ci     * @since 12
288661847f8eSopenharmony_ci     */
288761847f8eSopenharmony_ci    responseHeaderTiming: number;
288861847f8eSopenharmony_ci
288961847f8eSopenharmony_ci    /**
289061847f8eSopenharmony_ci     * Time taken from HTTP Request to body completion, in milliseconds.
289161847f8eSopenharmony_ci     * @type {number}
289261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
289361847f8eSopenharmony_ci     * @since 11
289461847f8eSopenharmony_ci     */
289561847f8eSopenharmony_ci    /**
289661847f8eSopenharmony_ci     * Time taken from HTTP Request to body completion, in milliseconds.
289761847f8eSopenharmony_ci     * @type {number}
289861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
289961847f8eSopenharmony_ci     * @crossplatform
290061847f8eSopenharmony_ci     * @since 12
290161847f8eSopenharmony_ci     */
290261847f8eSopenharmony_ci    responseBodyTiming: number;
290361847f8eSopenharmony_ci
290461847f8eSopenharmony_ci    /**
290561847f8eSopenharmony_ci     * Time taken from HTTP Request to callback to the application, in milliseconds.
290661847f8eSopenharmony_ci     * @type {number}
290761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
290861847f8eSopenharmony_ci     * @since 11
290961847f8eSopenharmony_ci     */
291061847f8eSopenharmony_ci    /**
291161847f8eSopenharmony_ci     * Time taken from HTTP Request to callback to the application, in milliseconds.
291261847f8eSopenharmony_ci     * @type {number}
291361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
291461847f8eSopenharmony_ci     * @crossplatform
291561847f8eSopenharmony_ci     * @since 12
291661847f8eSopenharmony_ci     */
291761847f8eSopenharmony_ci    totalTiming: number;
291861847f8eSopenharmony_ci  }
291961847f8eSopenharmony_ci
292061847f8eSopenharmony_ci  /**
292161847f8eSopenharmony_ci   * This interface is used to obtain the progress information of file upload or download.
292261847f8eSopenharmony_ci   * @interface DataReceiveProgressInfo
292361847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
292461847f8eSopenharmony_ci   * @since 11
292561847f8eSopenharmony_ci   */
292661847f8eSopenharmony_ci  /**
292761847f8eSopenharmony_ci   * This interface is used to obtain the progress information of file upload or download.
292861847f8eSopenharmony_ci   * @interface DataReceiveProgressInfo
292961847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
293061847f8eSopenharmony_ci   * @crossplatform
293161847f8eSopenharmony_ci   * @since 12
293261847f8eSopenharmony_ci   */
293361847f8eSopenharmony_ci  export interface DataReceiveProgressInfo {
293461847f8eSopenharmony_ci    /**
293561847f8eSopenharmony_ci     * Number of data bytes received.
293661847f8eSopenharmony_ci     * @type { number }
293761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
293861847f8eSopenharmony_ci     * @since 11
293961847f8eSopenharmony_ci     */
294061847f8eSopenharmony_ci    /**
294161847f8eSopenharmony_ci     * Number of data bytes received.
294261847f8eSopenharmony_ci     * @type { number }
294361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
294461847f8eSopenharmony_ci     * @crossplatform
294561847f8eSopenharmony_ci     * @since 12
294661847f8eSopenharmony_ci     */
294761847f8eSopenharmony_ci    receiveSize: number;
294861847f8eSopenharmony_ci    /**
294961847f8eSopenharmony_ci     * Total number of bytes to receive.
295061847f8eSopenharmony_ci     * @type { number }
295161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
295261847f8eSopenharmony_ci     * @since 11
295361847f8eSopenharmony_ci     */
295461847f8eSopenharmony_ci    /**
295561847f8eSopenharmony_ci     * Total number of bytes to receive.
295661847f8eSopenharmony_ci     * @type { number }
295761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
295861847f8eSopenharmony_ci     * @crossplatform
295961847f8eSopenharmony_ci     * @since 12
296061847f8eSopenharmony_ci     */
296161847f8eSopenharmony_ci    totalSize: number;
296261847f8eSopenharmony_ci  }
296361847f8eSopenharmony_ci
296461847f8eSopenharmony_ci  /**
296561847f8eSopenharmony_ci   * This interface is used to monitor the progress of sending data.
296661847f8eSopenharmony_ci   * @interface DataSendProgressInfo
296761847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
296861847f8eSopenharmony_ci   * @since 11
296961847f8eSopenharmony_ci   */
297061847f8eSopenharmony_ci  /**
297161847f8eSopenharmony_ci   * This interface is used to monitor the progress of sending data.
297261847f8eSopenharmony_ci   * @interface DataSendProgressInfo
297361847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
297461847f8eSopenharmony_ci   * @crossplatform
297561847f8eSopenharmony_ci   * @since 12
297661847f8eSopenharmony_ci   */
297761847f8eSopenharmony_ci  export interface DataSendProgressInfo {
297861847f8eSopenharmony_ci    /**
297961847f8eSopenharmony_ci     * Used to specify the data size to be sent.
298061847f8eSopenharmony_ci     * @type { number }
298161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
298261847f8eSopenharmony_ci     * @since 11
298361847f8eSopenharmony_ci     */
298461847f8eSopenharmony_ci    /**
298561847f8eSopenharmony_ci     * Used to specify the data size to be sent.
298661847f8eSopenharmony_ci     * @type { number }
298761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
298861847f8eSopenharmony_ci     * @crossplatform
298961847f8eSopenharmony_ci     * @since 12
299061847f8eSopenharmony_ci     */
299161847f8eSopenharmony_ci    sendSize: number;
299261847f8eSopenharmony_ci    /**
299361847f8eSopenharmony_ci     * Total number of bytes to receive.
299461847f8eSopenharmony_ci     * @type { number }
299561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
299661847f8eSopenharmony_ci     * @since 11
299761847f8eSopenharmony_ci     */
299861847f8eSopenharmony_ci    /**
299961847f8eSopenharmony_ci     * Total number of bytes to receive.
300061847f8eSopenharmony_ci     * @type { number }
300161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
300261847f8eSopenharmony_ci     * @crossplatform
300361847f8eSopenharmony_ci     * @since 12
300461847f8eSopenharmony_ci     */
300561847f8eSopenharmony_ci    totalSize: number;
300661847f8eSopenharmony_ci  }
300761847f8eSopenharmony_ci
300861847f8eSopenharmony_ci  /**
300961847f8eSopenharmony_ci   * Creates a default {@code HttpResponseCache} object to store the responses of HTTP access requests.
301061847f8eSopenharmony_ci   * @param { number } cacheSize - the size of cache(max value is 10MB), default is 10*1024*1024(10MB).
301161847f8eSopenharmony_ci   * @returns { HttpResponseCache } the HttpResponseCache of the createHttpResponseCache.
301261847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
301361847f8eSopenharmony_ci   * @since 9
301461847f8eSopenharmony_ci   */
301561847f8eSopenharmony_ci  /**
301661847f8eSopenharmony_ci   * Creates a default {@code HttpResponseCache} object to store the responses of HTTP access requests.
301761847f8eSopenharmony_ci   * @param { number } cacheSize - the size of cache(max value is 10MB), default is 10*1024*1024(10MB).
301861847f8eSopenharmony_ci   * @returns { HttpResponseCache } the HttpResponseCache of the createHttpResponseCache.
301961847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
302061847f8eSopenharmony_ci   * @crossplatform
302161847f8eSopenharmony_ci   * @since 10
302261847f8eSopenharmony_ci   */
302361847f8eSopenharmony_ci  /**
302461847f8eSopenharmony_ci   * Creates a default {@code HttpResponseCache} object to store the responses of HTTP access requests.
302561847f8eSopenharmony_ci   * @param { number } cacheSize - the size of cache(max value is 10MB), default is 10*1024*1024(10MB).
302661847f8eSopenharmony_ci   * @returns { HttpResponseCache } the HttpResponseCache of the createHttpResponseCache.
302761847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
302861847f8eSopenharmony_ci   * @crossplatform
302961847f8eSopenharmony_ci   * @atomicservice
303061847f8eSopenharmony_ci   * @since 11
303161847f8eSopenharmony_ci   */
303261847f8eSopenharmony_ci  function createHttpResponseCache(cacheSize?: number): HttpResponseCache;
303361847f8eSopenharmony_ci
303461847f8eSopenharmony_ci  /**
303561847f8eSopenharmony_ci   * Defines an object that stores the response to an HTTP request.
303661847f8eSopenharmony_ci   * @interface HttpResponseCache
303761847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
303861847f8eSopenharmony_ci   * @since 9
303961847f8eSopenharmony_ci   */
304061847f8eSopenharmony_ci  /**
304161847f8eSopenharmony_ci   * Defines an object that stores the response to an HTTP request.
304261847f8eSopenharmony_ci   * @interface HttpResponseCache
304361847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
304461847f8eSopenharmony_ci   * @crossplatform
304561847f8eSopenharmony_ci   * @since 10
304661847f8eSopenharmony_ci   */
304761847f8eSopenharmony_ci  /**
304861847f8eSopenharmony_ci   * Defines an object that stores the response to an HTTP request.
304961847f8eSopenharmony_ci   * @interface HttpResponseCache
305061847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
305161847f8eSopenharmony_ci   * @crossplatform
305261847f8eSopenharmony_ci   * @atomicservice
305361847f8eSopenharmony_ci   * @since 11
305461847f8eSopenharmony_ci   */
305561847f8eSopenharmony_ci  export interface HttpResponseCache {
305661847f8eSopenharmony_ci    /**
305761847f8eSopenharmony_ci     * Writes data in the cache to the file system so that all the cached data can be accessed in the next HTTP request.
305861847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of flush.
305961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
306061847f8eSopenharmony_ci     * @since 9
306161847f8eSopenharmony_ci     */
306261847f8eSopenharmony_ci    /**
306361847f8eSopenharmony_ci     * Writes data in the cache to the file system so that all the cached data can be accessed in the next HTTP request.
306461847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of flush.
306561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
306661847f8eSopenharmony_ci     * @crossplatform
306761847f8eSopenharmony_ci     * @since 10
306861847f8eSopenharmony_ci     */
306961847f8eSopenharmony_ci    /**
307061847f8eSopenharmony_ci     * Writes data in the cache to the file system so that all the cached data can be accessed in the next HTTP request.
307161847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of flush.
307261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
307361847f8eSopenharmony_ci     * @crossplatform
307461847f8eSopenharmony_ci     * @atomicservice
307561847f8eSopenharmony_ci     * @since 11
307661847f8eSopenharmony_ci     */
307761847f8eSopenharmony_ci    flush(callback: AsyncCallback<void>): void;
307861847f8eSopenharmony_ci
307961847f8eSopenharmony_ci    /**
308061847f8eSopenharmony_ci     * Writes data in the cache to the file system so that all the cached data can be accessed in the next HTTP request.
308161847f8eSopenharmony_ci     * @returns { Promise<void> } The promise returned by the flush.
308261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
308361847f8eSopenharmony_ci     * @since 9
308461847f8eSopenharmony_ci     */
308561847f8eSopenharmony_ci    /**
308661847f8eSopenharmony_ci     * Writes data in the cache to the file system so that all the cached data can be accessed in the next HTTP request.
308761847f8eSopenharmony_ci     * @returns { Promise<void> } The promise returned by the flush.
308861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
308961847f8eSopenharmony_ci     * @crossplatform
309061847f8eSopenharmony_ci     * @since 10
309161847f8eSopenharmony_ci     */
309261847f8eSopenharmony_ci    /**
309361847f8eSopenharmony_ci     * Writes data in the cache to the file system so that all the cached data can be accessed in the next HTTP request.
309461847f8eSopenharmony_ci     * @returns { Promise<void> } The promise returned by the flush.
309561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
309661847f8eSopenharmony_ci     * @crossplatform
309761847f8eSopenharmony_ci     * @atomicservice
309861847f8eSopenharmony_ci     * @since 11
309961847f8eSopenharmony_ci     */
310061847f8eSopenharmony_ci    flush(): Promise<void>;
310161847f8eSopenharmony_ci
310261847f8eSopenharmony_ci    /**
310361847f8eSopenharmony_ci     * Disables a cache and deletes the data in it.
310461847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of delete.
310561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
310661847f8eSopenharmony_ci     * @since 9
310761847f8eSopenharmony_ci     */
310861847f8eSopenharmony_ci    /**
310961847f8eSopenharmony_ci     * Disables a cache and deletes the data in it.
311061847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of delete.
311161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
311261847f8eSopenharmony_ci     * @crossplatform
311361847f8eSopenharmony_ci     * @since 10
311461847f8eSopenharmony_ci     */
311561847f8eSopenharmony_ci    /**
311661847f8eSopenharmony_ci     * Disables a cache and deletes the data in it.
311761847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of delete.
311861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
311961847f8eSopenharmony_ci     * @crossplatform
312061847f8eSopenharmony_ci     * @atomicservice
312161847f8eSopenharmony_ci     * @since 11
312261847f8eSopenharmony_ci     */
312361847f8eSopenharmony_ci    delete(callback: AsyncCallback<void>): void;
312461847f8eSopenharmony_ci
312561847f8eSopenharmony_ci    /**
312661847f8eSopenharmony_ci     * Disables a cache and deletes the data in it.
312761847f8eSopenharmony_ci     * @returns { Promise<void> } The promise returned by the delete.
312861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
312961847f8eSopenharmony_ci     * @since 9
313061847f8eSopenharmony_ci     */
313161847f8eSopenharmony_ci    /**
313261847f8eSopenharmony_ci     * Disables a cache and deletes the data in it.
313361847f8eSopenharmony_ci     * @returns { Promise<void> } The promise returned by the delete.
313461847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
313561847f8eSopenharmony_ci     * @crossplatform
313661847f8eSopenharmony_ci     * @since 10
313761847f8eSopenharmony_ci     */
313861847f8eSopenharmony_ci    /**
313961847f8eSopenharmony_ci     * Disables a cache and deletes the data in it.
314061847f8eSopenharmony_ci     * @returns { Promise<void> } The promise returned by the delete.
314161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
314261847f8eSopenharmony_ci     * @crossplatform
314361847f8eSopenharmony_ci     * @atomicservice
314461847f8eSopenharmony_ci     * @since 11
314561847f8eSopenharmony_ci     */
314661847f8eSopenharmony_ci    delete(): Promise<void>;
314761847f8eSopenharmony_ci  }
314861847f8eSopenharmony_ci}
314961847f8eSopenharmony_ci
315061847f8eSopenharmony_ciexport default http;
3151