11e934351Sopenharmony_ci/*
21e934351Sopenharmony_ci * Copyright (c) 2021-2023 Huawei Device Co., Ltd.
31e934351Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
41e934351Sopenharmony_ci * you may not use this file except in compliance with the License.
51e934351Sopenharmony_ci * You may obtain a copy of the License at
61e934351Sopenharmony_ci *
71e934351Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
81e934351Sopenharmony_ci *
91e934351Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
101e934351Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
111e934351Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
121e934351Sopenharmony_ci * See the License for the specific language governing permissions and
131e934351Sopenharmony_ci * limitations under the License.
141e934351Sopenharmony_ci */
151e934351Sopenharmony_ci
161e934351Sopenharmony_ci/**
171e934351Sopenharmony_ci * @file
181e934351Sopenharmony_ci * @kit NetworkKit
191e934351Sopenharmony_ci */
201e934351Sopenharmony_ci
211e934351Sopenharmony_ciimport type { AsyncCallback, Callback } from './@ohos.base';
221e934351Sopenharmony_ciimport type connection from './@ohos.net.connection';
231e934351Sopenharmony_ci
241e934351Sopenharmony_ci/**
251e934351Sopenharmony_ci * Provides http related APIs.
261e934351Sopenharmony_ci * @namespace http
271e934351Sopenharmony_ci * @syscap SystemCapability.Communication.NetStack
281e934351Sopenharmony_ci * @since 6
291e934351Sopenharmony_ci */
301e934351Sopenharmony_ci/**
311e934351Sopenharmony_ci * Provides http related APIs.
321e934351Sopenharmony_ci * @namespace http
331e934351Sopenharmony_ci * @syscap SystemCapability.Communication.NetStack
341e934351Sopenharmony_ci * @crossplatform
351e934351Sopenharmony_ci * @since 10
361e934351Sopenharmony_ci */
371e934351Sopenharmony_ci/**
381e934351Sopenharmony_ci * Provides http related APIs.
391e934351Sopenharmony_ci * @namespace http
401e934351Sopenharmony_ci * @syscap SystemCapability.Communication.NetStack
411e934351Sopenharmony_ci * @crossplatform
421e934351Sopenharmony_ci * @atomicservice
431e934351Sopenharmony_ci * @since 11
441e934351Sopenharmony_ci */
451e934351Sopenharmony_cideclare namespace http {
461e934351Sopenharmony_ci  /**
471e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
481e934351Sopenharmony_ci   * @since 10
491e934351Sopenharmony_ci   */
501e934351Sopenharmony_ci  /**
511e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
521e934351Sopenharmony_ci   * @atomicservice
531e934351Sopenharmony_ci   * @since 11
541e934351Sopenharmony_ci   */
551e934351Sopenharmony_ci  /**
561e934351Sopenharmony_ci   * @typedef { connection.HttpProxy }
571e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
581e934351Sopenharmony_ci   * @crossplatform
591e934351Sopenharmony_ci   * @atomicservice
601e934351Sopenharmony_ci   * @since 12
611e934351Sopenharmony_ci   */
621e934351Sopenharmony_ci  type HttpProxy = connection.HttpProxy;
631e934351Sopenharmony_ci
641e934351Sopenharmony_ci  /**
651e934351Sopenharmony_ci   * Creates an HTTP request task.
661e934351Sopenharmony_ci   * @returns { HttpRequest } the HttpRequest of the createHttp.
671e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
681e934351Sopenharmony_ci   * @since 6
691e934351Sopenharmony_ci   */
701e934351Sopenharmony_ci  /**
711e934351Sopenharmony_ci   * Creates an HTTP request task.
721e934351Sopenharmony_ci   * @returns { HttpRequest } the HttpRequest of the createHttp.
731e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
741e934351Sopenharmony_ci   * @crossplatform
751e934351Sopenharmony_ci   * @since 10
761e934351Sopenharmony_ci   */
771e934351Sopenharmony_ci  /**
781e934351Sopenharmony_ci   * Creates an HTTP request task.
791e934351Sopenharmony_ci   * @returns { HttpRequest } the HttpRequest of the createHttp.
801e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
811e934351Sopenharmony_ci   * @crossplatform
821e934351Sopenharmony_ci   * @atomicservice
831e934351Sopenharmony_ci   * @since 11
841e934351Sopenharmony_ci   */
851e934351Sopenharmony_ci  function createHttp(): HttpRequest;
861e934351Sopenharmony_ci
871e934351Sopenharmony_ci  /**
881e934351Sopenharmony_ci   * Specifies the type and value range of the optional parameters in the HTTP request.
891e934351Sopenharmony_ci   * @interface HttpRequestOptions
901e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
911e934351Sopenharmony_ci   * @since 6
921e934351Sopenharmony_ci   */
931e934351Sopenharmony_ci  /**
941e934351Sopenharmony_ci   * Specifies the type and value range of the optional parameters in the HTTP request.
951e934351Sopenharmony_ci   * @interface HttpRequestOptions
961e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
971e934351Sopenharmony_ci   * @crossplatform
981e934351Sopenharmony_ci   * @since 10
991e934351Sopenharmony_ci   */
1001e934351Sopenharmony_ci  /**
1011e934351Sopenharmony_ci   * Specifies the type and value range of the optional parameters in the HTTP request.
1021e934351Sopenharmony_ci   * @interface HttpRequestOptions
1031e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
1041e934351Sopenharmony_ci   * @crossplatform
1051e934351Sopenharmony_ci   * @atomicservice
1061e934351Sopenharmony_ci   * @since 11
1071e934351Sopenharmony_ci   */
1081e934351Sopenharmony_ci  export interface HttpRequestOptions {
1091e934351Sopenharmony_ci    /**
1101e934351Sopenharmony_ci     * Request method,default is GET.
1111e934351Sopenharmony_ci     * @type {?RequestMethod}
1121e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
1131e934351Sopenharmony_ci     * @since 6
1141e934351Sopenharmony_ci     */
1151e934351Sopenharmony_ci    /**
1161e934351Sopenharmony_ci     * Request method,default is GET.
1171e934351Sopenharmony_ci     * @type {?RequestMethod}
1181e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
1191e934351Sopenharmony_ci     * @crossplatform
1201e934351Sopenharmony_ci     * @since 10
1211e934351Sopenharmony_ci     */
1221e934351Sopenharmony_ci    /**
1231e934351Sopenharmony_ci     * Request method,default is GET.
1241e934351Sopenharmony_ci     * @type {?RequestMethod}
1251e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
1261e934351Sopenharmony_ci     * @crossplatform
1271e934351Sopenharmony_ci     * @atomicservice
1281e934351Sopenharmony_ci     * @since 11
1291e934351Sopenharmony_ci     */
1301e934351Sopenharmony_ci    method?: RequestMethod;
1311e934351Sopenharmony_ci
1321e934351Sopenharmony_ci    /**
1331e934351Sopenharmony_ci     * Additional data of the request.
1341e934351Sopenharmony_ci     * extraData can be a string or an Object (API 6) or an ArrayBuffer(API 8).
1351e934351Sopenharmony_ci     * @type {?string | Object | ArrayBuffer}
1361e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
1371e934351Sopenharmony_ci     * @since 6
1381e934351Sopenharmony_ci     */
1391e934351Sopenharmony_ci    /**
1401e934351Sopenharmony_ci     * Additional data of the request.
1411e934351Sopenharmony_ci     * extraData can be a string or an Object (API 6) or an ArrayBuffer(API 8).
1421e934351Sopenharmony_ci     * @type {?string | Object | ArrayBuffer}
1431e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
1441e934351Sopenharmony_ci     * @crossplatform
1451e934351Sopenharmony_ci     * @since 10
1461e934351Sopenharmony_ci     */
1471e934351Sopenharmony_ci    /**
1481e934351Sopenharmony_ci     * Additional data of the request.
1491e934351Sopenharmony_ci     * extraData can be a string or an Object (API 6) or an ArrayBuffer(API 8).
1501e934351Sopenharmony_ci     * @type { ?(string | Object | ArrayBuffer) }
1511e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
1521e934351Sopenharmony_ci     * @crossplatform
1531e934351Sopenharmony_ci     * @atomicservice
1541e934351Sopenharmony_ci     * @since 11
1551e934351Sopenharmony_ci     */
1561e934351Sopenharmony_ci    extraData?: string | Object | ArrayBuffer;
1571e934351Sopenharmony_ci
1581e934351Sopenharmony_ci    /**
1591e934351Sopenharmony_ci     * Data type to be returned. If this parameter is set, the system preferentially returns the specified type.
1601e934351Sopenharmony_ci     * @type {?HttpDataType}
1611e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
1621e934351Sopenharmony_ci     * @since 9
1631e934351Sopenharmony_ci     */
1641e934351Sopenharmony_ci    /**
1651e934351Sopenharmony_ci     * Data type to be returned. If this parameter is set, the system preferentially returns the specified type.
1661e934351Sopenharmony_ci     * @type {?HttpDataType}
1671e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
1681e934351Sopenharmony_ci     * @crossplatform
1691e934351Sopenharmony_ci     * @since 10
1701e934351Sopenharmony_ci     */
1711e934351Sopenharmony_ci    /**
1721e934351Sopenharmony_ci     * Data type to be returned. If this parameter is set, the system preferentially returns the specified type.
1731e934351Sopenharmony_ci     * @type {?HttpDataType}
1741e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
1751e934351Sopenharmony_ci     * @crossplatform
1761e934351Sopenharmony_ci     * @atomicservice
1771e934351Sopenharmony_ci     * @since 11
1781e934351Sopenharmony_ci     */
1791e934351Sopenharmony_ci    expectDataType?: HttpDataType;
1801e934351Sopenharmony_ci
1811e934351Sopenharmony_ci    /**
1821e934351Sopenharmony_ci     * default is true
1831e934351Sopenharmony_ci     * @type {?boolean}
1841e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
1851e934351Sopenharmony_ci     * @since 9
1861e934351Sopenharmony_ci     */
1871e934351Sopenharmony_ci    /**
1881e934351Sopenharmony_ci     * default is true
1891e934351Sopenharmony_ci     * @type {?boolean}
1901e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
1911e934351Sopenharmony_ci     * @crossplatform
1921e934351Sopenharmony_ci     * @since 10
1931e934351Sopenharmony_ci     */
1941e934351Sopenharmony_ci    /**
1951e934351Sopenharmony_ci     * default is true
1961e934351Sopenharmony_ci     * @type {?boolean}
1971e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
1981e934351Sopenharmony_ci     * @crossplatform
1991e934351Sopenharmony_ci     * @atomicservice
2001e934351Sopenharmony_ci     * @since 11
2011e934351Sopenharmony_ci     */
2021e934351Sopenharmony_ci    usingCache?: boolean;
2031e934351Sopenharmony_ci
2041e934351Sopenharmony_ci    /**
2051e934351Sopenharmony_ci     * [1, 1000], default is 1.
2061e934351Sopenharmony_ci     * @type {?number}
2071e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
2081e934351Sopenharmony_ci     * @since 9
2091e934351Sopenharmony_ci     */
2101e934351Sopenharmony_ci    /**
2111e934351Sopenharmony_ci     * [1, 1000], default is 1.
2121e934351Sopenharmony_ci     * @type {?number}
2131e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
2141e934351Sopenharmony_ci     * @crossplatform
2151e934351Sopenharmony_ci     * @since 10
2161e934351Sopenharmony_ci     */
2171e934351Sopenharmony_ci    /**
2181e934351Sopenharmony_ci     * [1, 1000], default is 1.
2191e934351Sopenharmony_ci     * @type {?number}
2201e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
2211e934351Sopenharmony_ci     * @crossplatform
2221e934351Sopenharmony_ci     * @atomicservice
2231e934351Sopenharmony_ci     * @since 11
2241e934351Sopenharmony_ci     */
2251e934351Sopenharmony_ci    priority?: number;
2261e934351Sopenharmony_ci
2271e934351Sopenharmony_ci    /**
2281e934351Sopenharmony_ci     * HTTP request header. default is 'content-type': 'application/json'
2291e934351Sopenharmony_ci     * @type {?Object}
2301e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
2311e934351Sopenharmony_ci     * @since 6
2321e934351Sopenharmony_ci     */
2331e934351Sopenharmony_ci    /**
2341e934351Sopenharmony_ci     * HTTP request header. default is 'content-type': 'application/json'
2351e934351Sopenharmony_ci     * @type {?Object}
2361e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
2371e934351Sopenharmony_ci     * @crossplatform
2381e934351Sopenharmony_ci     * @since 10
2391e934351Sopenharmony_ci     */
2401e934351Sopenharmony_ci    /**
2411e934351Sopenharmony_ci     * HTTP request header. default is 'content-type': 'application/json'
2421e934351Sopenharmony_ci     * @type {?Object}
2431e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
2441e934351Sopenharmony_ci     * @crossplatform
2451e934351Sopenharmony_ci     * @atomicservice
2461e934351Sopenharmony_ci     * @since 11
2471e934351Sopenharmony_ci     */
2481e934351Sopenharmony_ci    header?: Object;
2491e934351Sopenharmony_ci
2501e934351Sopenharmony_ci    /**
2511e934351Sopenharmony_ci     * Read timeout period. The default value is 60,000, in ms.
2521e934351Sopenharmony_ci     * @type {?number}
2531e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
2541e934351Sopenharmony_ci     * @since 6
2551e934351Sopenharmony_ci     */
2561e934351Sopenharmony_ci    /**
2571e934351Sopenharmony_ci     * Read timeout period. The default value is 60,000, in ms.
2581e934351Sopenharmony_ci     * @type {?number}
2591e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
2601e934351Sopenharmony_ci     * @crossplatform
2611e934351Sopenharmony_ci     * @since 10
2621e934351Sopenharmony_ci     */
2631e934351Sopenharmony_ci    /**
2641e934351Sopenharmony_ci     * Read timeout period. The default value is 60,000, in ms.
2651e934351Sopenharmony_ci     * @type {?number}
2661e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
2671e934351Sopenharmony_ci     * @crossplatform
2681e934351Sopenharmony_ci     * @atomicservice
2691e934351Sopenharmony_ci     * @since 11
2701e934351Sopenharmony_ci     */
2711e934351Sopenharmony_ci    readTimeout?: number;
2721e934351Sopenharmony_ci
2731e934351Sopenharmony_ci    /**
2741e934351Sopenharmony_ci     * Connection timeout interval. The default value is 60,000, in ms.
2751e934351Sopenharmony_ci     * @type {?number}
2761e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
2771e934351Sopenharmony_ci     * @since 6
2781e934351Sopenharmony_ci     */
2791e934351Sopenharmony_ci    /**
2801e934351Sopenharmony_ci     * Connection timeout interval. The default value is 60,000, in ms.
2811e934351Sopenharmony_ci     * @type {?number}
2821e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
2831e934351Sopenharmony_ci     * @crossplatform
2841e934351Sopenharmony_ci     * @since 10
2851e934351Sopenharmony_ci     */
2861e934351Sopenharmony_ci    /**
2871e934351Sopenharmony_ci     * Connection timeout interval. The default value is 60,000, in ms.
2881e934351Sopenharmony_ci     * @type {?number}
2891e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
2901e934351Sopenharmony_ci     * @crossplatform
2911e934351Sopenharmony_ci     * @atomicservice
2921e934351Sopenharmony_ci     * @since 11
2931e934351Sopenharmony_ci     */
2941e934351Sopenharmony_ci    connectTimeout?: number;
2951e934351Sopenharmony_ci
2961e934351Sopenharmony_ci    /**
2971e934351Sopenharmony_ci     * default is automatically specified by the system.
2981e934351Sopenharmony_ci     * @type {?HttpProtocol}
2991e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
3001e934351Sopenharmony_ci     * @since 9
3011e934351Sopenharmony_ci     */
3021e934351Sopenharmony_ci    /**
3031e934351Sopenharmony_ci     * default is automatically specified by the system.
3041e934351Sopenharmony_ci     * @type {?HttpProtocol}
3051e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
3061e934351Sopenharmony_ci     * @crossplatform
3071e934351Sopenharmony_ci     * @since 10
3081e934351Sopenharmony_ci     */
3091e934351Sopenharmony_ci    /**
3101e934351Sopenharmony_ci     * default is automatically specified by the system.
3111e934351Sopenharmony_ci     * @type {?HttpProtocol}
3121e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
3131e934351Sopenharmony_ci     * @crossplatform
3141e934351Sopenharmony_ci     * @atomicservice
3151e934351Sopenharmony_ci     * @since 11
3161e934351Sopenharmony_ci     */
3171e934351Sopenharmony_ci    usingProtocol?: HttpProtocol;
3181e934351Sopenharmony_ci
3191e934351Sopenharmony_ci    /**
3201e934351Sopenharmony_ci     * If this parameter is set as type of boolean, the system will use default proxy or not use proxy.
3211e934351Sopenharmony_ci     * If this parameter is set as type of HttpProxy, the system will use the specified HttpProxy.
3221e934351Sopenharmony_ci     * @type {?boolean | HttpProxy}
3231e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
3241e934351Sopenharmony_ci     * @since 10
3251e934351Sopenharmony_ci     */
3261e934351Sopenharmony_ci    /**
3271e934351Sopenharmony_ci     * If this parameter is set as type of boolean, the system will use default proxy or not use proxy.
3281e934351Sopenharmony_ci     * If this parameter is set as type of HttpProxy, the system will use the specified HttpProxy.
3291e934351Sopenharmony_ci     * @type { ?(boolean | HttpProxy) }
3301e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
3311e934351Sopenharmony_ci     * @atomicservice
3321e934351Sopenharmony_ci     * @since 11
3331e934351Sopenharmony_ci     */
3341e934351Sopenharmony_ci    /**
3351e934351Sopenharmony_ci     * If this parameter is set as type of boolean, the system will use default proxy or not use proxy.
3361e934351Sopenharmony_ci     * If this parameter is set as type of HttpProxy, the system will use the specified HttpProxy.
3371e934351Sopenharmony_ci     * @type { ?(boolean | HttpProxy) }
3381e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
3391e934351Sopenharmony_ci     * @crossplatform
3401e934351Sopenharmony_ci     * @atomicservice
3411e934351Sopenharmony_ci     * @since 12
3421e934351Sopenharmony_ci     */
3431e934351Sopenharmony_ci    usingProxy?: boolean | HttpProxy;
3441e934351Sopenharmony_ci
3451e934351Sopenharmony_ci    /**
3461e934351Sopenharmony_ci     * If this parameter is set, the system will use ca path specified by user, or else use preset ca by the system. 
3471e934351Sopenharmony_ci     * @type {?string}
3481e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
3491e934351Sopenharmony_ci     * @since 10
3501e934351Sopenharmony_ci     */
3511e934351Sopenharmony_ci    /**
3521e934351Sopenharmony_ci     * If this parameter is set, the system will use ca path specified by user, or else use preset ca by the system.
3531e934351Sopenharmony_ci     * @type {?string}
3541e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
3551e934351Sopenharmony_ci     * @atomicservice
3561e934351Sopenharmony_ci     * @since 11
3571e934351Sopenharmony_ci     */
3581e934351Sopenharmony_ci    /**
3591e934351Sopenharmony_ci     * If this parameter is set, the system will use ca path specified by user, or else use preset ca by the system.
3601e934351Sopenharmony_ci     * @type {?string}
3611e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
3621e934351Sopenharmony_ci     * @crossplatform
3631e934351Sopenharmony_ci     * @atomicservice
3641e934351Sopenharmony_ci     * @since 12
3651e934351Sopenharmony_ci     */
3661e934351Sopenharmony_ci    caPath?: string;
3671e934351Sopenharmony_ci
3681e934351Sopenharmony_ci    /**
3691e934351Sopenharmony_ci     * Used to set to uploading or downloading the start bytes. The default value is 0.
3701e934351Sopenharmony_ci     * HTTP standard (RFC 7233 section 3.1) allows servers to ignore range requests.
3711e934351Sopenharmony_ci     * For HTTP PUT uploads this option should not be used, since it may conflict with other options.
3721e934351Sopenharmony_ci     * @type {?number}
3731e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
3741e934351Sopenharmony_ci     * @since 11
3751e934351Sopenharmony_ci     */
3761e934351Sopenharmony_ci    /**
3771e934351Sopenharmony_ci     * Used to set to uploading or downloading the start bytes. The default value is 0.
3781e934351Sopenharmony_ci     * HTTP standard (RFC 7233 section 3.1) allows servers to ignore range requests.
3791e934351Sopenharmony_ci     * For HTTP PUT uploads this option should not be used, since it may conflict with other options.
3801e934351Sopenharmony_ci     * @type {?number}
3811e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
3821e934351Sopenharmony_ci     * @crossplatform
3831e934351Sopenharmony_ci     * @since 12
3841e934351Sopenharmony_ci     */
3851e934351Sopenharmony_ci    resumeFrom?: number;
3861e934351Sopenharmony_ci
3871e934351Sopenharmony_ci    /**
3881e934351Sopenharmony_ci     * Used to set to uploading or downloading the end bytes. Translate to the end if not set.
3891e934351Sopenharmony_ci     * HTTP standard (RFC 7233 section 3.1) allows servers to ignore range requests.
3901e934351Sopenharmony_ci     * For HTTP PUT uploads this option should not be used, since it may conflict with other options.
3911e934351Sopenharmony_ci     * @type {?number}
3921e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
3931e934351Sopenharmony_ci     * @since 11
3941e934351Sopenharmony_ci     */
3951e934351Sopenharmony_ci    /**
3961e934351Sopenharmony_ci     * Used to set to uploading or downloading the end bytes. Translate to the end if not set.
3971e934351Sopenharmony_ci     * HTTP standard (RFC 7233 section 3.1) allows servers to ignore range requests.
3981e934351Sopenharmony_ci     * For HTTP PUT uploads this option should not be used, since it may conflict with other options.
3991e934351Sopenharmony_ci     * @type {?number}
4001e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
4011e934351Sopenharmony_ci     * @crossplatform
4021e934351Sopenharmony_ci     * @since 12
4031e934351Sopenharmony_ci     */
4041e934351Sopenharmony_ci    resumeTo?: number;
4051e934351Sopenharmony_ci
4061e934351Sopenharmony_ci    /**
4071e934351Sopenharmony_ci     * Support the application to pass in client certificates, allowing the server to verify the client's identity.
4081e934351Sopenharmony_ci     * @type {?ClientCert}
4091e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
4101e934351Sopenharmony_ci     * @since 11
4111e934351Sopenharmony_ci     */
4121e934351Sopenharmony_ci    /**
4131e934351Sopenharmony_ci     * Support the application to pass in client certificates, allowing the server to verify the client's identity.
4141e934351Sopenharmony_ci     * @type {?ClientCert}
4151e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
4161e934351Sopenharmony_ci     * @crossplatform
4171e934351Sopenharmony_ci     * @since 12
4181e934351Sopenharmony_ci     */
4191e934351Sopenharmony_ci    clientCert?: ClientCert;
4201e934351Sopenharmony_ci
4211e934351Sopenharmony_ci    /**
4221e934351Sopenharmony_ci     * If this parameter is set, incoming DNS resolution server URL for the DoH server to use for name resolving.
4231e934351Sopenharmony_ci     * The parameter must be URL-encoded in the following format: "https://host:port/path".
4241e934351Sopenharmony_ci     * It MUST specify an HTTPS URL.
4251e934351Sopenharmony_ci     * @type {?string}
4261e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
4271e934351Sopenharmony_ci     * @since 11
4281e934351Sopenharmony_ci     */
4291e934351Sopenharmony_ci    /**
4301e934351Sopenharmony_ci     * If this parameter is set, incoming DNS resolution server URL for the DoH server to use for name resolving.
4311e934351Sopenharmony_ci     * The parameter must be URL-encoded in the following format: "https://host:port/path".
4321e934351Sopenharmony_ci     * It MUST specify an HTTPS URL.
4331e934351Sopenharmony_ci     * @type {?string}
4341e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
4351e934351Sopenharmony_ci     * @crossplatform
4361e934351Sopenharmony_ci     * @since 12
4371e934351Sopenharmony_ci     */
4381e934351Sopenharmony_ci    dnsOverHttps?: string;
4391e934351Sopenharmony_ci
4401e934351Sopenharmony_ci    /**
4411e934351Sopenharmony_ci     * If this parameter is set, use the specified DNS server for DNS resolution.
4421e934351Sopenharmony_ci     * Multiple DNS resolution servers can be set up, with a maximum of 3 servers.
4431e934351Sopenharmony_ci     * Only take the first three if there are more than three.
4441e934351Sopenharmony_ci     * @type {?Array<string>}
4451e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
4461e934351Sopenharmony_ci     * @since 11
4471e934351Sopenharmony_ci     */
4481e934351Sopenharmony_ci    /**
4491e934351Sopenharmony_ci     * If this parameter is set, use the specified DNS server for DNS resolution.
4501e934351Sopenharmony_ci     * Multiple DNS resolution servers can be set up, with a maximum of 3 servers.
4511e934351Sopenharmony_ci     * Only take the first three if there are more than three.
4521e934351Sopenharmony_ci     * @type {?Array<string>}
4531e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
4541e934351Sopenharmony_ci     * @crossplatform
4551e934351Sopenharmony_ci     * @since 12
4561e934351Sopenharmony_ci     */
4571e934351Sopenharmony_ci    dnsServers?: Array<string>;
4581e934351Sopenharmony_ci
4591e934351Sopenharmony_ci    /**
4601e934351Sopenharmony_ci     * The maximum limit of the response body. The default value is 5 * 1024 * 1024, in Byte.
4611e934351Sopenharmony_ci     * The maximum value is 100 * 1024 *1024, in Byte.
4621e934351Sopenharmony_ci     * @type {?number}
4631e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
4641e934351Sopenharmony_ci     * @since 11
4651e934351Sopenharmony_ci     */
4661e934351Sopenharmony_ci    /**
4671e934351Sopenharmony_ci     * The maximum limit of the response body. The default value is 5 * 1024 * 1024, in Byte.
4681e934351Sopenharmony_ci     * The maximum value is 100 * 1024 *1024, in Byte.
4691e934351Sopenharmony_ci     * @type {?number}
4701e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
4711e934351Sopenharmony_ci     * @crossplatform
4721e934351Sopenharmony_ci     * @since 12
4731e934351Sopenharmony_ci     */
4741e934351Sopenharmony_ci    maxLimit?: number;
4751e934351Sopenharmony_ci
4761e934351Sopenharmony_ci    /**
4771e934351Sopenharmony_ci     * The data fields which is supported by the HTTP protocol to post
4781e934351Sopenharmony_ci     * forms and by the SMTP and IMAP protocols to provide
4791e934351Sopenharmony_ci     * the email data to send/upload.
4801e934351Sopenharmony_ci     * @type {?Array<MultiFormData>}
4811e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
4821e934351Sopenharmony_ci     * @since 11
4831e934351Sopenharmony_ci     */
4841e934351Sopenharmony_ci    /**
4851e934351Sopenharmony_ci     * The data fields which is supported by the HTTP protocol to post
4861e934351Sopenharmony_ci     * forms and by the SMTP and IMAP protocols to provide
4871e934351Sopenharmony_ci     * the email data to send/upload.
4881e934351Sopenharmony_ci     * @type {?Array<MultiFormData>}
4891e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
4901e934351Sopenharmony_ci     * @crossplatform
4911e934351Sopenharmony_ci     * @since 12
4921e934351Sopenharmony_ci     */
4931e934351Sopenharmony_ci    multiFormDataList?: Array<MultiFormData>;
4941e934351Sopenharmony_ci
4951e934351Sopenharmony_ci    /**
4961e934351Sopenharmony_ci     * Certificate pinning option. If server certificate's digest does not match
4971e934351Sopenharmony_ci     * {@link CertificatePinning.publicKeyHash}, request will fail.
4981e934351Sopenharmony_ci     * @type {?(CertificatePinning | CertificatePinning[])}
4991e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
5001e934351Sopenharmony_ci     * @since 12
5011e934351Sopenharmony_ci     */
5021e934351Sopenharmony_ci    certificatePinning?: CertificatePinning | CertificatePinning[];
5031e934351Sopenharmony_ci  }
5041e934351Sopenharmony_ci
5051e934351Sopenharmony_ci  /**
5061e934351Sopenharmony_ci   * Represents the properties of a form object.
5071e934351Sopenharmony_ci   * @interface MultiFormData
5081e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
5091e934351Sopenharmony_ci   * @since 11
5101e934351Sopenharmony_ci   */
5111e934351Sopenharmony_ci  /**
5121e934351Sopenharmony_ci   * Represents the properties of a form object.
5131e934351Sopenharmony_ci   * @interface MultiFormData
5141e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
5151e934351Sopenharmony_ci   * @crossplatform
5161e934351Sopenharmony_ci   * @since 12
5171e934351Sopenharmony_ci   */
5181e934351Sopenharmony_ci  export interface MultiFormData {
5191e934351Sopenharmony_ci    /**
5201e934351Sopenharmony_ci     * MIME name for the data field.
5211e934351Sopenharmony_ci     * @type {string}
5221e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
5231e934351Sopenharmony_ci     * @since 11
5241e934351Sopenharmony_ci     */
5251e934351Sopenharmony_ci    /**
5261e934351Sopenharmony_ci     * MIME name for the data field.
5271e934351Sopenharmony_ci     * @type {string}
5281e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
5291e934351Sopenharmony_ci     * @crossplatform
5301e934351Sopenharmony_ci     * @since 12
5311e934351Sopenharmony_ci     */
5321e934351Sopenharmony_ci    name: string;
5331e934351Sopenharmony_ci
5341e934351Sopenharmony_ci    /**
5351e934351Sopenharmony_ci     * Content type of the data field.
5361e934351Sopenharmony_ci     * @type {string}
5371e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
5381e934351Sopenharmony_ci     * @since 11
5391e934351Sopenharmony_ci     */
5401e934351Sopenharmony_ci    /**
5411e934351Sopenharmony_ci     * Content type of the data field.
5421e934351Sopenharmony_ci     * @type {string}
5431e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
5441e934351Sopenharmony_ci     * @crossplatform
5451e934351Sopenharmony_ci     * @since 12
5461e934351Sopenharmony_ci     */
5471e934351Sopenharmony_ci    contentType: string;
5481e934351Sopenharmony_ci
5491e934351Sopenharmony_ci    /**
5501e934351Sopenharmony_ci     * Remote file name for the data field.
5511e934351Sopenharmony_ci     * @type {?string}
5521e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
5531e934351Sopenharmony_ci     * @since 11
5541e934351Sopenharmony_ci     */
5551e934351Sopenharmony_ci    /**
5561e934351Sopenharmony_ci     * Remote file name for the data field.
5571e934351Sopenharmony_ci     * @type {?string}
5581e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
5591e934351Sopenharmony_ci     * @crossplatform
5601e934351Sopenharmony_ci     * @since 12
5611e934351Sopenharmony_ci     */
5621e934351Sopenharmony_ci    remoteFileName?: string;
5631e934351Sopenharmony_ci
5641e934351Sopenharmony_ci    /**
5651e934351Sopenharmony_ci     * This parameter sets a mime part's body content from memory data.
5661e934351Sopenharmony_ci     * @type {?(string | Object | ArrayBuffer)}
5671e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
5681e934351Sopenharmony_ci     * @since 11
5691e934351Sopenharmony_ci     */
5701e934351Sopenharmony_ci    /**
5711e934351Sopenharmony_ci     * This parameter sets a mime part's body content from memory data.
5721e934351Sopenharmony_ci     * @type {?(string | Object | ArrayBuffer)}
5731e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
5741e934351Sopenharmony_ci     * @crossplatform
5751e934351Sopenharmony_ci     * @since 12
5761e934351Sopenharmony_ci     */
5771e934351Sopenharmony_ci    data?: string | Object | ArrayBuffer;
5781e934351Sopenharmony_ci
5791e934351Sopenharmony_ci    /**
5801e934351Sopenharmony_ci     * This parameter sets a mime part's body content from the file's contents.
5811e934351Sopenharmony_ci     * This is an alternative to curl_mime_data for setting data to a mime part.
5821e934351Sopenharmony_ci     * If data is empty, filePath must be set.
5831e934351Sopenharmony_ci     * If data has a value, filePath does not take effect.
5841e934351Sopenharmony_ci     * @type {?string}
5851e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
5861e934351Sopenharmony_ci     * @since 11
5871e934351Sopenharmony_ci     */
5881e934351Sopenharmony_ci    /**
5891e934351Sopenharmony_ci     * This parameter sets a mime part's body content from the file's contents.
5901e934351Sopenharmony_ci     * This is an alternative to curl_mime_data for setting data to a mime part.
5911e934351Sopenharmony_ci     * If data is empty, filePath must be set.
5921e934351Sopenharmony_ci     * If data has a value, filePath does not take effect.
5931e934351Sopenharmony_ci     * @type {?string}
5941e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
5951e934351Sopenharmony_ci     * @crossplatform
5961e934351Sopenharmony_ci     * @since 12
5971e934351Sopenharmony_ci     */
5981e934351Sopenharmony_ci    filePath?: string;
5991e934351Sopenharmony_ci  }
6001e934351Sopenharmony_ci
6011e934351Sopenharmony_ci  /**
6021e934351Sopenharmony_ci   * Enum for certificate types
6031e934351Sopenharmony_ci   * @enum {string}
6041e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
6051e934351Sopenharmony_ci   * @since 11
6061e934351Sopenharmony_ci   */
6071e934351Sopenharmony_ci  /**
6081e934351Sopenharmony_ci   * Enum for certificate types
6091e934351Sopenharmony_ci   * @enum {string}
6101e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
6111e934351Sopenharmony_ci   * @crossplatform
6121e934351Sopenharmony_ci   * @since 12
6131e934351Sopenharmony_ci   */
6141e934351Sopenharmony_ci  export enum CertType {
6151e934351Sopenharmony_ci    /**
6161e934351Sopenharmony_ci     * PEM format certificate
6171e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
6181e934351Sopenharmony_ci     * @since 11
6191e934351Sopenharmony_ci     */
6201e934351Sopenharmony_ci    /**
6211e934351Sopenharmony_ci     * PEM format certificate
6221e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
6231e934351Sopenharmony_ci     * @crossplatform
6241e934351Sopenharmony_ci     * @since 12
6251e934351Sopenharmony_ci     */
6261e934351Sopenharmony_ci    PEM = 'PEM',
6271e934351Sopenharmony_ci
6281e934351Sopenharmony_ci    /**
6291e934351Sopenharmony_ci     * DER format certificate
6301e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
6311e934351Sopenharmony_ci     * @since 11
6321e934351Sopenharmony_ci     */
6331e934351Sopenharmony_ci    /**
6341e934351Sopenharmony_ci     * DER format certificate
6351e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
6361e934351Sopenharmony_ci     * @crossplatform
6371e934351Sopenharmony_ci     * @since 12
6381e934351Sopenharmony_ci     */
6391e934351Sopenharmony_ci    DER = 'DER',
6401e934351Sopenharmony_ci
6411e934351Sopenharmony_ci    /**
6421e934351Sopenharmony_ci     * P12 format certificate
6431e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
6441e934351Sopenharmony_ci     * @since 11
6451e934351Sopenharmony_ci     */
6461e934351Sopenharmony_ci    /**
6471e934351Sopenharmony_ci     * P12 format certificate
6481e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
6491e934351Sopenharmony_ci     * @crossplatform
6501e934351Sopenharmony_ci     * @since 12
6511e934351Sopenharmony_ci     */
6521e934351Sopenharmony_ci    P12 = 'P12'
6531e934351Sopenharmony_ci  }
6541e934351Sopenharmony_ci
6551e934351Sopenharmony_ci  /**
6561e934351Sopenharmony_ci   * The clientCert field of the client certificate, which includes 4 attributes:
6571e934351Sopenharmony_ci   * client certificate (cert), client certificate type (certType), certificate private key (key), and passphrase (keyPassword).
6581e934351Sopenharmony_ci   * @interface ClientCert
6591e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
6601e934351Sopenharmony_ci   * @since 11
6611e934351Sopenharmony_ci   */
6621e934351Sopenharmony_ci  /**
6631e934351Sopenharmony_ci   * The clientCert field of the client certificate, which includes 4 attributes:
6641e934351Sopenharmony_ci   * client certificate (cert), client certificate type (certType), certificate private key (key), and passphrase (keyPassword).
6651e934351Sopenharmony_ci   * @interface ClientCert
6661e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
6671e934351Sopenharmony_ci   * @crossplatform
6681e934351Sopenharmony_ci   * @since 12
6691e934351Sopenharmony_ci   */
6701e934351Sopenharmony_ci  export interface ClientCert {
6711e934351Sopenharmony_ci    /**
6721e934351Sopenharmony_ci     * The path to the client certificate file.
6731e934351Sopenharmony_ci     * @type {string}
6741e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
6751e934351Sopenharmony_ci     * @since 11
6761e934351Sopenharmony_ci     */
6771e934351Sopenharmony_ci    /**
6781e934351Sopenharmony_ci     * The path to the client certificate file.
6791e934351Sopenharmony_ci     * @type {string}
6801e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
6811e934351Sopenharmony_ci     * @crossplatform
6821e934351Sopenharmony_ci     * @since 12
6831e934351Sopenharmony_ci     */
6841e934351Sopenharmony_ci    certPath: string;
6851e934351Sopenharmony_ci
6861e934351Sopenharmony_ci    /**
6871e934351Sopenharmony_ci     * The type of the client certificate.
6881e934351Sopenharmony_ci     * @type {?CertType}
6891e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
6901e934351Sopenharmony_ci     * @since 11
6911e934351Sopenharmony_ci     */
6921e934351Sopenharmony_ci    /**
6931e934351Sopenharmony_ci     * The type of the client certificate.
6941e934351Sopenharmony_ci     * @type {?CertType}
6951e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
6961e934351Sopenharmony_ci     * @crossplatform
6971e934351Sopenharmony_ci     * @since 12
6981e934351Sopenharmony_ci     */
6991e934351Sopenharmony_ci    certType?: CertType;
7001e934351Sopenharmony_ci
7011e934351Sopenharmony_ci    /**
7021e934351Sopenharmony_ci     * The path of the client certificate private key file.
7031e934351Sopenharmony_ci     * @type {string}
7041e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
7051e934351Sopenharmony_ci     * @since 11
7061e934351Sopenharmony_ci     */
7071e934351Sopenharmony_ci    /**
7081e934351Sopenharmony_ci     * The path of the client certificate private key file.
7091e934351Sopenharmony_ci     * @type {string}
7101e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
7111e934351Sopenharmony_ci     * @crossplatform
7121e934351Sopenharmony_ci     * @since 12
7131e934351Sopenharmony_ci     */
7141e934351Sopenharmony_ci    keyPath: string;
7151e934351Sopenharmony_ci
7161e934351Sopenharmony_ci    /**
7171e934351Sopenharmony_ci     * Password required to use the client certificate private key.
7181e934351Sopenharmony_ci     * @type {?string}
7191e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
7201e934351Sopenharmony_ci     * @since 11
7211e934351Sopenharmony_ci     */
7221e934351Sopenharmony_ci    /**
7231e934351Sopenharmony_ci     * Password required to use the client certificate private key.
7241e934351Sopenharmony_ci     * @type {?string}
7251e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
7261e934351Sopenharmony_ci     * @crossplatform
7271e934351Sopenharmony_ci     * @since 12
7281e934351Sopenharmony_ci     */
7291e934351Sopenharmony_ci    keyPassword?: string;
7301e934351Sopenharmony_ci  }
7311e934351Sopenharmony_ci
7321e934351Sopenharmony_ci  /**
7331e934351Sopenharmony_ci   * Certificate pinning option.
7341e934351Sopenharmony_ci   * @interface CertificatePinning
7351e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
7361e934351Sopenharmony_ci   * @since 12
7371e934351Sopenharmony_ci   */
7381e934351Sopenharmony_ci  interface CertificatePinning {
7391e934351Sopenharmony_ci    /**
7401e934351Sopenharmony_ci     * Public key hash.
7411e934351Sopenharmony_ci     * @type {string}
7421e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
7431e934351Sopenharmony_ci     * @since 12
7441e934351Sopenharmony_ci     */
7451e934351Sopenharmony_ci    publicKeyHash: string;
7461e934351Sopenharmony_ci    /**
7471e934351Sopenharmony_ci     * Certificate public key hash algorithm.
7481e934351Sopenharmony_ci     * @type {'SHA-256'}
7491e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
7501e934351Sopenharmony_ci     * @since 12
7511e934351Sopenharmony_ci     */
7521e934351Sopenharmony_ci    hashAlgorithm: 'SHA-256';
7531e934351Sopenharmony_ci  }
7541e934351Sopenharmony_ci
7551e934351Sopenharmony_ci  /**
7561e934351Sopenharmony_ci   * <p>Defines an HTTP request task. Before invoking APIs provided by HttpRequest,
7571e934351Sopenharmony_ci   * you must call createHttp() to create an HttpRequestTask object.</p>
7581e934351Sopenharmony_ci   * @interface HttpRequest
7591e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
7601e934351Sopenharmony_ci   * @since 6
7611e934351Sopenharmony_ci   */
7621e934351Sopenharmony_ci  /**
7631e934351Sopenharmony_ci   * <p>Defines an HTTP request task. Before invoking APIs provided by HttpRequest,
7641e934351Sopenharmony_ci   * you must call createHttp() to create an HttpRequestTask object.</p>
7651e934351Sopenharmony_ci   * @interface HttpRequest
7661e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
7671e934351Sopenharmony_ci   * @crossplatform
7681e934351Sopenharmony_ci   * @since 10
7691e934351Sopenharmony_ci   */
7701e934351Sopenharmony_ci  /**
7711e934351Sopenharmony_ci   * <p>Defines an HTTP request task. Before invoking APIs provided by HttpRequest,
7721e934351Sopenharmony_ci   * you must call createHttp() to create an HttpRequestTask object.</p>
7731e934351Sopenharmony_ci   * @interface HttpRequest
7741e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
7751e934351Sopenharmony_ci   * @crossplatform
7761e934351Sopenharmony_ci   * @atomicservice
7771e934351Sopenharmony_ci   * @since 11
7781e934351Sopenharmony_ci   */
7791e934351Sopenharmony_ci  export interface HttpRequest {
7801e934351Sopenharmony_ci    /**
7811e934351Sopenharmony_ci     * Initiates an HTTP request to a given URL.
7821e934351Sopenharmony_ci     * @permission ohos.permission.INTERNET
7831e934351Sopenharmony_ci     * @param { string } url - URL for initiating an HTTP request.
7841e934351Sopenharmony_ci     * @param { AsyncCallback<HttpResponse> } callback - the callback of request. 
7851e934351Sopenharmony_ci     * @throws { BusinessError } 401 - Parameter error.
7861e934351Sopenharmony_ci     * @throws { BusinessError } 201 - Permission denied.
7871e934351Sopenharmony_ci     * @throws { BusinessError } 2300001 - Unsupported protocol.
7881e934351Sopenharmony_ci     * @throws { BusinessError } 2300003 - Invalid URL format or missing URL.
7891e934351Sopenharmony_ci     * @throws { BusinessError } 2300005 - Failed to resolve the proxy name.
7901e934351Sopenharmony_ci     * @throws { BusinessError } 2300006 - Failed to resolve the host name.
7911e934351Sopenharmony_ci     * @throws { BusinessError } 2300007 - Failed to connect to the server.
7921e934351Sopenharmony_ci     * @throws { BusinessError } 2300008 - Invalid server response.
7931e934351Sopenharmony_ci     * @throws { BusinessError } 2300009 - Access to the remote resource denied.
7941e934351Sopenharmony_ci     * @throws { BusinessError } 2300016 - Error in the HTTP2 framing layer.
7951e934351Sopenharmony_ci     * @throws { BusinessError } 2300018 - Transferred a partial file.
7961e934351Sopenharmony_ci     * @throws { BusinessError } 2300023 - Failed to write the received data to the disk or application.
7971e934351Sopenharmony_ci     * @throws { BusinessError } 2300025 - Upload failed.
7981e934351Sopenharmony_ci     * @throws { BusinessError } 2300026 - Failed to open or read local data from the file or application.
7991e934351Sopenharmony_ci     * @throws { BusinessError } 2300027 - Out of memory.
8001e934351Sopenharmony_ci     * @throws { BusinessError } 2300028 - Operation timeout.
8011e934351Sopenharmony_ci     * @throws { BusinessError } 2300047 - The number of redirections reaches the maximum allowed.
8021e934351Sopenharmony_ci     * @throws { BusinessError } 2300052 - The server returned nothing (no header or data).
8031e934351Sopenharmony_ci     * @throws { BusinessError } 2300055 - Failed to send data to the peer.
8041e934351Sopenharmony_ci     * @throws { BusinessError } 2300056 - Failed to receive data from the peer.
8051e934351Sopenharmony_ci     * @throws { BusinessError } 2300058 - Local SSL certificate error.
8061e934351Sopenharmony_ci     * @throws { BusinessError } 2300059 - The specified SSL cipher cannot be used.
8071e934351Sopenharmony_ci     * @throws { BusinessError } 2300060 - Invalid SSL peer certificate or SSH remote key.
8081e934351Sopenharmony_ci     * @throws { BusinessError } 2300061 - Invalid HTTP encoding format.
8091e934351Sopenharmony_ci     * @throws { BusinessError } 2300063 - Maximum file size exceeded.
8101e934351Sopenharmony_ci     * @throws { BusinessError } 2300070 - Remote disk full.
8111e934351Sopenharmony_ci     * @throws { BusinessError } 2300073 - Remote file already exists.
8121e934351Sopenharmony_ci     * @throws { BusinessError } 2300077 - The SSL CA certificate does not exist or is inaccessible.
8131e934351Sopenharmony_ci     * @throws { BusinessError } 2300078 - Remote file not found.
8141e934351Sopenharmony_ci     * @throws { BusinessError } 2300094 - Authentication error.
8151e934351Sopenharmony_ci     * @throws { BusinessError } 2300999 - Unknown error.
8161e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
8171e934351Sopenharmony_ci     * @since 6
8181e934351Sopenharmony_ci     */
8191e934351Sopenharmony_ci    /**
8201e934351Sopenharmony_ci     * Initiates an HTTP request to a given URL.
8211e934351Sopenharmony_ci     * @permission ohos.permission.INTERNET
8221e934351Sopenharmony_ci     * @param { string } url - URL for initiating an HTTP request.
8231e934351Sopenharmony_ci     * @param { AsyncCallback<HttpResponse> } callback - the callback of request.
8241e934351Sopenharmony_ci     * @throws { BusinessError } 401 - Parameter error.
8251e934351Sopenharmony_ci     * @throws { BusinessError } 201 - Permission denied.
8261e934351Sopenharmony_ci     * @throws { BusinessError } 2300001 - Unsupported protocol.
8271e934351Sopenharmony_ci     * @throws { BusinessError } 2300003 - Invalid URL format or missing URL.
8281e934351Sopenharmony_ci     * @throws { BusinessError } 2300005 - Failed to resolve the proxy name.
8291e934351Sopenharmony_ci     * @throws { BusinessError } 2300006 - Failed to resolve the host name.
8301e934351Sopenharmony_ci     * @throws { BusinessError } 2300007 - Failed to connect to the server.
8311e934351Sopenharmony_ci     * @throws { BusinessError } 2300008 - Invalid server response.
8321e934351Sopenharmony_ci     * @throws { BusinessError } 2300009 - Access to the remote resource denied.
8331e934351Sopenharmony_ci     * @throws { BusinessError } 2300016 - Error in the HTTP2 framing layer.
8341e934351Sopenharmony_ci     * @throws { BusinessError } 2300018 - Transferred a partial file.
8351e934351Sopenharmony_ci     * @throws { BusinessError } 2300023 - Failed to write the received data to the disk or application.
8361e934351Sopenharmony_ci     * @throws { BusinessError } 2300025 - Upload failed.
8371e934351Sopenharmony_ci     * @throws { BusinessError } 2300026 - Failed to open or read local data from the file or application.
8381e934351Sopenharmony_ci     * @throws { BusinessError } 2300027 - Out of memory.
8391e934351Sopenharmony_ci     * @throws { BusinessError } 2300028 - Operation timeout.
8401e934351Sopenharmony_ci     * @throws { BusinessError } 2300047 - The number of redirections reaches the maximum allowed.
8411e934351Sopenharmony_ci     * @throws { BusinessError } 2300052 - The server returned nothing (no header or data).
8421e934351Sopenharmony_ci     * @throws { BusinessError } 2300055 - Failed to send data to the peer.
8431e934351Sopenharmony_ci     * @throws { BusinessError } 2300056 - Failed to receive data from the peer.
8441e934351Sopenharmony_ci     * @throws { BusinessError } 2300058 - Local SSL certificate error.
8451e934351Sopenharmony_ci     * @throws { BusinessError } 2300059 - The specified SSL cipher cannot be used.
8461e934351Sopenharmony_ci     * @throws { BusinessError } 2300060 - Invalid SSL peer certificate or SSH remote key.
8471e934351Sopenharmony_ci     * @throws { BusinessError } 2300061 - Invalid HTTP encoding format.
8481e934351Sopenharmony_ci     * @throws { BusinessError } 2300063 - Maximum file size exceeded.
8491e934351Sopenharmony_ci     * @throws { BusinessError } 2300070 - Remote disk full.
8501e934351Sopenharmony_ci     * @throws { BusinessError } 2300073 - Remote file already exists.
8511e934351Sopenharmony_ci     * @throws { BusinessError } 2300077 - The SSL CA certificate does not exist or is inaccessible.
8521e934351Sopenharmony_ci     * @throws { BusinessError } 2300078 - Remote file not found.
8531e934351Sopenharmony_ci     * @throws { BusinessError } 2300094 - Authentication error.
8541e934351Sopenharmony_ci     * @throws { BusinessError } 2300999 - Unknown error.
8551e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
8561e934351Sopenharmony_ci     * @crossplatform
8571e934351Sopenharmony_ci     * @since 10
8581e934351Sopenharmony_ci     */
8591e934351Sopenharmony_ci    /**
8601e934351Sopenharmony_ci     * Initiates an HTTP request to a given URL.
8611e934351Sopenharmony_ci     * @permission ohos.permission.INTERNET
8621e934351Sopenharmony_ci     * @param { string } url - URL for initiating an HTTP request.
8631e934351Sopenharmony_ci     * @param { AsyncCallback<HttpResponse> } callback - the callback of request.
8641e934351Sopenharmony_ci     * @throws { BusinessError } 401 - Parameter error.
8651e934351Sopenharmony_ci     * @throws { BusinessError } 201 - Permission denied.
8661e934351Sopenharmony_ci     * @throws { BusinessError } 2300001 - Unsupported protocol.
8671e934351Sopenharmony_ci     * @throws { BusinessError } 2300003 - Invalid URL format or missing URL.
8681e934351Sopenharmony_ci     * @throws { BusinessError } 2300005 - Failed to resolve the proxy name.
8691e934351Sopenharmony_ci     * @throws { BusinessError } 2300006 - Failed to resolve the host name.
8701e934351Sopenharmony_ci     * @throws { BusinessError } 2300007 - Failed to connect to the server.
8711e934351Sopenharmony_ci     * @throws { BusinessError } 2300008 - Invalid server response.
8721e934351Sopenharmony_ci     * @throws { BusinessError } 2300009 - Access to the remote resource denied.
8731e934351Sopenharmony_ci     * @throws { BusinessError } 2300016 - Error in the HTTP2 framing layer.
8741e934351Sopenharmony_ci     * @throws { BusinessError } 2300018 - Transferred a partial file.
8751e934351Sopenharmony_ci     * @throws { BusinessError } 2300023 - Failed to write the received data to the disk or application.
8761e934351Sopenharmony_ci     * @throws { BusinessError } 2300025 - Upload failed.
8771e934351Sopenharmony_ci     * @throws { BusinessError } 2300026 - Failed to open or read local data from the file or application.
8781e934351Sopenharmony_ci     * @throws { BusinessError } 2300027 - Out of memory.
8791e934351Sopenharmony_ci     * @throws { BusinessError } 2300028 - Operation timeout.
8801e934351Sopenharmony_ci     * @throws { BusinessError } 2300047 - The number of redirections reaches the maximum allowed.
8811e934351Sopenharmony_ci     * @throws { BusinessError } 2300052 - The server returned nothing (no header or data).
8821e934351Sopenharmony_ci     * @throws { BusinessError } 2300055 - Failed to send data to the peer.
8831e934351Sopenharmony_ci     * @throws { BusinessError } 2300056 - Failed to receive data from the peer.
8841e934351Sopenharmony_ci     * @throws { BusinessError } 2300058 - Local SSL certificate error.
8851e934351Sopenharmony_ci     * @throws { BusinessError } 2300059 - The specified SSL cipher cannot be used.
8861e934351Sopenharmony_ci     * @throws { BusinessError } 2300060 - Invalid SSL peer certificate or SSH remote key.
8871e934351Sopenharmony_ci     * @throws { BusinessError } 2300061 - Invalid HTTP encoding format.
8881e934351Sopenharmony_ci     * @throws { BusinessError } 2300063 - Maximum file size exceeded.
8891e934351Sopenharmony_ci     * @throws { BusinessError } 2300070 - Remote disk full.
8901e934351Sopenharmony_ci     * @throws { BusinessError } 2300073 - Remote file already exists.
8911e934351Sopenharmony_ci     * @throws { BusinessError } 2300077 - The SSL CA certificate does not exist or is inaccessible.
8921e934351Sopenharmony_ci     * @throws { BusinessError } 2300078 - Remote file not found.
8931e934351Sopenharmony_ci     * @throws { BusinessError } 2300094 - Authentication error.
8941e934351Sopenharmony_ci     * @throws { BusinessError } 2300999 - Unknown error.
8951e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
8961e934351Sopenharmony_ci     * @crossplatform
8971e934351Sopenharmony_ci     * @atomicservice
8981e934351Sopenharmony_ci     * @since 11
8991e934351Sopenharmony_ci     */
9001e934351Sopenharmony_ci    request(url: string, callback: AsyncCallback<HttpResponse>): void;
9011e934351Sopenharmony_ci
9021e934351Sopenharmony_ci    /**
9031e934351Sopenharmony_ci     * Initiates an HTTP request to a given URL.
9041e934351Sopenharmony_ci     * @permission ohos.permission.INTERNET
9051e934351Sopenharmony_ci     * @param { string } url - URL for initiating an HTTP request.
9061e934351Sopenharmony_ci     * @param { HttpRequestOptions } options - Optional parameters {@link HttpRequestOptions}.
9071e934351Sopenharmony_ci     * @param { AsyncCallback<HttpResponse> } callback - the callback of request..
9081e934351Sopenharmony_ci     * @throws { BusinessError } 401 - Parameter error.
9091e934351Sopenharmony_ci     * @throws { BusinessError } 201 - Permission denied.
9101e934351Sopenharmony_ci     * @throws { BusinessError } 2300001 - Unsupported protocol.
9111e934351Sopenharmony_ci     * @throws { BusinessError } 2300003 - Invalid URL format or missing URL.
9121e934351Sopenharmony_ci     * @throws { BusinessError } 2300005 - Failed to resolve the proxy name.
9131e934351Sopenharmony_ci     * @throws { BusinessError } 2300006 - Failed to resolve the host name.
9141e934351Sopenharmony_ci     * @throws { BusinessError } 2300007 - Failed to connect to the server.
9151e934351Sopenharmony_ci     * @throws { BusinessError } 2300008 - Invalid server response.
9161e934351Sopenharmony_ci     * @throws { BusinessError } 2300009 - Access to the remote resource denied.
9171e934351Sopenharmony_ci     * @throws { BusinessError } 2300016 - Error in the HTTP2 framing layer.
9181e934351Sopenharmony_ci     * @throws { BusinessError } 2300018 - Transferred a partial file.
9191e934351Sopenharmony_ci     * @throws { BusinessError } 2300023 - Failed to write the received data to the disk or application.
9201e934351Sopenharmony_ci     * @throws { BusinessError } 2300025 - Upload failed.
9211e934351Sopenharmony_ci     * @throws { BusinessError } 2300026 - Failed to open or read local data from the file or application.
9221e934351Sopenharmony_ci     * @throws { BusinessError } 2300027 - Out of memory.
9231e934351Sopenharmony_ci     * @throws { BusinessError } 2300028 - Operation timeout.
9241e934351Sopenharmony_ci     * @throws { BusinessError } 2300047 - The number of redirections reaches the maximum allowed.
9251e934351Sopenharmony_ci     * @throws { BusinessError } 2300052 - The server returned nothing (no header or data).
9261e934351Sopenharmony_ci     * @throws { BusinessError } 2300055 - Failed to send data to the peer.
9271e934351Sopenharmony_ci     * @throws { BusinessError } 2300056 - Failed to receive data from the peer.
9281e934351Sopenharmony_ci     * @throws { BusinessError } 2300058 - Local SSL certificate error.
9291e934351Sopenharmony_ci     * @throws { BusinessError } 2300059 - The specified SSL cipher cannot be used.
9301e934351Sopenharmony_ci     * @throws { BusinessError } 2300060 - Invalid SSL peer certificate or SSH remote key.
9311e934351Sopenharmony_ci     * @throws { BusinessError } 2300061 - Invalid HTTP encoding format.
9321e934351Sopenharmony_ci     * @throws { BusinessError } 2300063 - Maximum file size exceeded.
9331e934351Sopenharmony_ci     * @throws { BusinessError } 2300070 - Remote disk full.
9341e934351Sopenharmony_ci     * @throws { BusinessError } 2300073 - Remote file already exists.
9351e934351Sopenharmony_ci     * @throws { BusinessError } 2300077 - The SSL CA certificate does not exist or is inaccessible.
9361e934351Sopenharmony_ci     * @throws { BusinessError } 2300078 - Remote file not found.
9371e934351Sopenharmony_ci     * @throws { BusinessError } 2300094 - Authentication error.
9381e934351Sopenharmony_ci     * @throws { BusinessError } 2300999 - Unknown error.
9391e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
9401e934351Sopenharmony_ci     * @since 6
9411e934351Sopenharmony_ci     */
9421e934351Sopenharmony_ci    /**
9431e934351Sopenharmony_ci     * Initiates an HTTP request to a given URL.
9441e934351Sopenharmony_ci     * @permission ohos.permission.INTERNET
9451e934351Sopenharmony_ci     * @param { string } url - URL for initiating an HTTP request.
9461e934351Sopenharmony_ci     * @param { HttpRequestOptions } options - Optional parameters {@link HttpRequestOptions}.
9471e934351Sopenharmony_ci     * @param { AsyncCallback<HttpResponse> } callback - the callback of request.
9481e934351Sopenharmony_ci     * @throws { BusinessError } 401 - Parameter error.
9491e934351Sopenharmony_ci     * @throws { BusinessError } 201 - Permission denied.
9501e934351Sopenharmony_ci     * @throws { BusinessError } 2300001 - Unsupported protocol.
9511e934351Sopenharmony_ci     * @throws { BusinessError } 2300003 - Invalid URL format or missing URL.
9521e934351Sopenharmony_ci     * @throws { BusinessError } 2300005 - Failed to resolve the proxy name.
9531e934351Sopenharmony_ci     * @throws { BusinessError } 2300006 - Failed to resolve the host name.
9541e934351Sopenharmony_ci     * @throws { BusinessError } 2300007 - Failed to connect to the server.
9551e934351Sopenharmony_ci     * @throws { BusinessError } 2300008 - Invalid server response.
9561e934351Sopenharmony_ci     * @throws { BusinessError } 2300009 - Access to the remote resource denied.
9571e934351Sopenharmony_ci     * @throws { BusinessError } 2300016 - Error in the HTTP2 framing layer.
9581e934351Sopenharmony_ci     * @throws { BusinessError } 2300018 - Transferred a partial file.
9591e934351Sopenharmony_ci     * @throws { BusinessError } 2300023 - Failed to write the received data to the disk or application.
9601e934351Sopenharmony_ci     * @throws { BusinessError } 2300025 - Upload failed.
9611e934351Sopenharmony_ci     * @throws { BusinessError } 2300026 - Failed to open or read local data from the file or application.
9621e934351Sopenharmony_ci     * @throws { BusinessError } 2300027 - Out of memory.
9631e934351Sopenharmony_ci     * @throws { BusinessError } 2300028 - Operation timeout.
9641e934351Sopenharmony_ci     * @throws { BusinessError } 2300047 - The number of redirections reaches the maximum allowed.
9651e934351Sopenharmony_ci     * @throws { BusinessError } 2300052 - The server returned nothing (no header or data).
9661e934351Sopenharmony_ci     * @throws { BusinessError } 2300055 - Failed to send data to the peer.
9671e934351Sopenharmony_ci     * @throws { BusinessError } 2300056 - Failed to receive data from the peer.
9681e934351Sopenharmony_ci     * @throws { BusinessError } 2300058 - Local SSL certificate error.
9691e934351Sopenharmony_ci     * @throws { BusinessError } 2300059 - The specified SSL cipher cannot be used.
9701e934351Sopenharmony_ci     * @throws { BusinessError } 2300060 - Invalid SSL peer certificate or SSH remote key.
9711e934351Sopenharmony_ci     * @throws { BusinessError } 2300061 - Invalid HTTP encoding format.
9721e934351Sopenharmony_ci     * @throws { BusinessError } 2300063 - Maximum file size exceeded.
9731e934351Sopenharmony_ci     * @throws { BusinessError } 2300070 - Remote disk full.
9741e934351Sopenharmony_ci     * @throws { BusinessError } 2300073 - Remote file already exists.
9751e934351Sopenharmony_ci     * @throws { BusinessError } 2300077 - The SSL CA certificate does not exist or is inaccessible.
9761e934351Sopenharmony_ci     * @throws { BusinessError } 2300078 - Remote file not found.
9771e934351Sopenharmony_ci     * @throws { BusinessError } 2300094 - Authentication error.
9781e934351Sopenharmony_ci     * @throws { BusinessError } 2300999 - Unknown error.
9791e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
9801e934351Sopenharmony_ci     * @crossplatform
9811e934351Sopenharmony_ci     * @since 10
9821e934351Sopenharmony_ci     */
9831e934351Sopenharmony_ci    /**
9841e934351Sopenharmony_ci     * Initiates an HTTP request to a given URL.
9851e934351Sopenharmony_ci     * @permission ohos.permission.INTERNET
9861e934351Sopenharmony_ci     * @param { string } url - URL for initiating an HTTP request.
9871e934351Sopenharmony_ci     * @param { HttpRequestOptions } options - Optional parameters {@link HttpRequestOptions}.
9881e934351Sopenharmony_ci     * @param { AsyncCallback<HttpResponse> } callback - the callback of request.
9891e934351Sopenharmony_ci     * @throws { BusinessError } 401 - Parameter error.
9901e934351Sopenharmony_ci     * @throws { BusinessError } 201 - Permission denied.
9911e934351Sopenharmony_ci     * @throws { BusinessError } 2300001 - Unsupported protocol.
9921e934351Sopenharmony_ci     * @throws { BusinessError } 2300003 - Invalid URL format or missing URL.
9931e934351Sopenharmony_ci     * @throws { BusinessError } 2300005 - Failed to resolve the proxy name.
9941e934351Sopenharmony_ci     * @throws { BusinessError } 2300006 - Failed to resolve the host name.
9951e934351Sopenharmony_ci     * @throws { BusinessError } 2300007 - Failed to connect to the server.
9961e934351Sopenharmony_ci     * @throws { BusinessError } 2300008 - Invalid server response.
9971e934351Sopenharmony_ci     * @throws { BusinessError } 2300009 - Access to the remote resource denied.
9981e934351Sopenharmony_ci     * @throws { BusinessError } 2300016 - Error in the HTTP2 framing layer.
9991e934351Sopenharmony_ci     * @throws { BusinessError } 2300018 - Transferred a partial file.
10001e934351Sopenharmony_ci     * @throws { BusinessError } 2300023 - Failed to write the received data to the disk or application.
10011e934351Sopenharmony_ci     * @throws { BusinessError } 2300025 - Upload failed.
10021e934351Sopenharmony_ci     * @throws { BusinessError } 2300026 - Failed to open or read local data from the file or application.
10031e934351Sopenharmony_ci     * @throws { BusinessError } 2300027 - Out of memory.
10041e934351Sopenharmony_ci     * @throws { BusinessError } 2300028 - Operation timeout.
10051e934351Sopenharmony_ci     * @throws { BusinessError } 2300047 - The number of redirections reaches the maximum allowed.
10061e934351Sopenharmony_ci     * @throws { BusinessError } 2300052 - The server returned nothing (no header or data).
10071e934351Sopenharmony_ci     * @throws { BusinessError } 2300055 - Failed to send data to the peer.
10081e934351Sopenharmony_ci     * @throws { BusinessError } 2300056 - Failed to receive data from the peer.
10091e934351Sopenharmony_ci     * @throws { BusinessError } 2300058 - Local SSL certificate error.
10101e934351Sopenharmony_ci     * @throws { BusinessError } 2300059 - The specified SSL cipher cannot be used.
10111e934351Sopenharmony_ci     * @throws { BusinessError } 2300060 - Invalid SSL peer certificate or SSH remote key.
10121e934351Sopenharmony_ci     * @throws { BusinessError } 2300061 - Invalid HTTP encoding format.
10131e934351Sopenharmony_ci     * @throws { BusinessError } 2300063 - Maximum file size exceeded.
10141e934351Sopenharmony_ci     * @throws { BusinessError } 2300070 - Remote disk full.
10151e934351Sopenharmony_ci     * @throws { BusinessError } 2300073 - Remote file already exists.
10161e934351Sopenharmony_ci     * @throws { BusinessError } 2300077 - The SSL CA certificate does not exist or is inaccessible.
10171e934351Sopenharmony_ci     * @throws { BusinessError } 2300078 - Remote file not found.
10181e934351Sopenharmony_ci     * @throws { BusinessError } 2300094 - Authentication error.
10191e934351Sopenharmony_ci     * @throws { BusinessError } 2300999 - Unknown error.
10201e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
10211e934351Sopenharmony_ci     * @crossplatform
10221e934351Sopenharmony_ci     * @atomicservice
10231e934351Sopenharmony_ci     * @since 11
10241e934351Sopenharmony_ci     */
10251e934351Sopenharmony_ci    request(url: string, options: HttpRequestOptions, callback: AsyncCallback<HttpResponse>): void;
10261e934351Sopenharmony_ci
10271e934351Sopenharmony_ci    /**
10281e934351Sopenharmony_ci     * Initiates an HTTP request to a given URL.
10291e934351Sopenharmony_ci     * @permission ohos.permission.INTERNET
10301e934351Sopenharmony_ci     * @param { string } url - URL for initiating an HTTP request.
10311e934351Sopenharmony_ci     * @param { HttpRequestOptions } [options] - Optional parameters {@link HttpRequestOptions}.
10321e934351Sopenharmony_ci     * @returns { Promise<HttpResponse> } The promise returned by the function. 
10331e934351Sopenharmony_ci     * @throws { BusinessError } 401 - Parameter error.
10341e934351Sopenharmony_ci     * @throws { BusinessError } 201 - Permission denied.
10351e934351Sopenharmony_ci     * @throws { BusinessError } 2300001 - Unsupported protocol.
10361e934351Sopenharmony_ci     * @throws { BusinessError } 2300003 - Invalid URL format or missing URL.
10371e934351Sopenharmony_ci     * @throws { BusinessError } 2300005 - Failed to resolve the proxy name.
10381e934351Sopenharmony_ci     * @throws { BusinessError } 2300006 - Failed to resolve the host name.
10391e934351Sopenharmony_ci     * @throws { BusinessError } 2300007 - Failed to connect to the server.
10401e934351Sopenharmony_ci     * @throws { BusinessError } 2300008 - Invalid server response.
10411e934351Sopenharmony_ci     * @throws { BusinessError } 2300009 - Access to the remote resource denied.
10421e934351Sopenharmony_ci     * @throws { BusinessError } 2300016 - Error in the HTTP2 framing layer.
10431e934351Sopenharmony_ci     * @throws { BusinessError } 2300018 - Transferred a partial file.
10441e934351Sopenharmony_ci     * @throws { BusinessError } 2300023 - Failed to write the received data to the disk or application.
10451e934351Sopenharmony_ci     * @throws { BusinessError } 2300025 - Upload failed.
10461e934351Sopenharmony_ci     * @throws { BusinessError } 2300026 - Failed to open or read local data from the file or application.
10471e934351Sopenharmony_ci     * @throws { BusinessError } 2300027 - Out of memory.
10481e934351Sopenharmony_ci     * @throws { BusinessError } 2300028 - Operation timeout.
10491e934351Sopenharmony_ci     * @throws { BusinessError } 2300047 - The number of redirections reaches the maximum allowed.
10501e934351Sopenharmony_ci     * @throws { BusinessError } 2300052 - The server returned nothing (no header or data).
10511e934351Sopenharmony_ci     * @throws { BusinessError } 2300055 - Failed to send data to the peer.
10521e934351Sopenharmony_ci     * @throws { BusinessError } 2300056 - Failed to receive data from the peer.
10531e934351Sopenharmony_ci     * @throws { BusinessError } 2300058 - Local SSL certificate error.
10541e934351Sopenharmony_ci     * @throws { BusinessError } 2300059 - The specified SSL cipher cannot be used.
10551e934351Sopenharmony_ci     * @throws { BusinessError } 2300060 - Invalid SSL peer certificate or SSH remote key.
10561e934351Sopenharmony_ci     * @throws { BusinessError } 2300061 - Invalid HTTP encoding format.
10571e934351Sopenharmony_ci     * @throws { BusinessError } 2300063 - Maximum file size exceeded.
10581e934351Sopenharmony_ci     * @throws { BusinessError } 2300070 - Remote disk full.
10591e934351Sopenharmony_ci     * @throws { BusinessError } 2300073 - Remote file already exists.
10601e934351Sopenharmony_ci     * @throws { BusinessError } 2300077 - The SSL CA certificate does not exist or is inaccessible.
10611e934351Sopenharmony_ci     * @throws { BusinessError } 2300078 - Remote file not found.
10621e934351Sopenharmony_ci     * @throws { BusinessError } 2300094 - Authentication error.
10631e934351Sopenharmony_ci     * @throws { BusinessError } 2300999 - Unknown error.
10641e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
10651e934351Sopenharmony_ci     * @since 6
10661e934351Sopenharmony_ci     */
10671e934351Sopenharmony_ci    /**
10681e934351Sopenharmony_ci     * Initiates an HTTP request to a given URL.
10691e934351Sopenharmony_ci     * @permission ohos.permission.INTERNET
10701e934351Sopenharmony_ci     * @param { string } url - URL for initiating an HTTP request.
10711e934351Sopenharmony_ci     * @param { HttpRequestOptions } [options] - Optional parameters {@link HttpRequestOptions}.
10721e934351Sopenharmony_ci     * @returns { Promise<HttpResponse> } The promise returned by the function. 
10731e934351Sopenharmony_ci     * @throws { BusinessError } 401 - Parameter error.
10741e934351Sopenharmony_ci     * @throws { BusinessError } 201 - Permission denied.
10751e934351Sopenharmony_ci     * @throws { BusinessError } 2300001 - Unsupported protocol.
10761e934351Sopenharmony_ci     * @throws { BusinessError } 2300003 - Invalid URL format or missing URL.
10771e934351Sopenharmony_ci     * @throws { BusinessError } 2300005 - Failed to resolve the proxy name.
10781e934351Sopenharmony_ci     * @throws { BusinessError } 2300006 - Failed to resolve the host name.
10791e934351Sopenharmony_ci     * @throws { BusinessError } 2300007 - Failed to connect to the server.
10801e934351Sopenharmony_ci     * @throws { BusinessError } 2300008 - Invalid server response.
10811e934351Sopenharmony_ci     * @throws { BusinessError } 2300009 - Access to the remote resource denied.
10821e934351Sopenharmony_ci     * @throws { BusinessError } 2300016 - Error in the HTTP2 framing layer.
10831e934351Sopenharmony_ci     * @throws { BusinessError } 2300018 - Transferred a partial file.
10841e934351Sopenharmony_ci     * @throws { BusinessError } 2300023 - Failed to write the received data to the disk or application.
10851e934351Sopenharmony_ci     * @throws { BusinessError } 2300025 - Upload failed.
10861e934351Sopenharmony_ci     * @throws { BusinessError } 2300026 - Failed to open or read local data from the file or application.
10871e934351Sopenharmony_ci     * @throws { BusinessError } 2300027 - Out of memory.
10881e934351Sopenharmony_ci     * @throws { BusinessError } 2300028 - Operation timeout.
10891e934351Sopenharmony_ci     * @throws { BusinessError } 2300047 - The number of redirections reaches the maximum allowed.
10901e934351Sopenharmony_ci     * @throws { BusinessError } 2300052 - The server returned nothing (no header or data).
10911e934351Sopenharmony_ci     * @throws { BusinessError } 2300055 - Failed to send data to the peer.
10921e934351Sopenharmony_ci     * @throws { BusinessError } 2300056 - Failed to receive data from the peer.
10931e934351Sopenharmony_ci     * @throws { BusinessError } 2300058 - Local SSL certificate error.
10941e934351Sopenharmony_ci     * @throws { BusinessError } 2300059 - The specified SSL cipher cannot be used.
10951e934351Sopenharmony_ci     * @throws { BusinessError } 2300060 - Invalid SSL peer certificate or SSH remote key.
10961e934351Sopenharmony_ci     * @throws { BusinessError } 2300061 - Invalid HTTP encoding format.
10971e934351Sopenharmony_ci     * @throws { BusinessError } 2300063 - Maximum file size exceeded.
10981e934351Sopenharmony_ci     * @throws { BusinessError } 2300070 - Remote disk full.
10991e934351Sopenharmony_ci     * @throws { BusinessError } 2300073 - Remote file already exists.
11001e934351Sopenharmony_ci     * @throws { BusinessError } 2300077 - The SSL CA certificate does not exist or is inaccessible.
11011e934351Sopenharmony_ci     * @throws { BusinessError } 2300078 - Remote file not found.
11021e934351Sopenharmony_ci     * @throws { BusinessError } 2300094 - Authentication error.
11031e934351Sopenharmony_ci     * @throws { BusinessError } 2300999 - Unknown error.
11041e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
11051e934351Sopenharmony_ci     * @crossplatform
11061e934351Sopenharmony_ci     * @since 10
11071e934351Sopenharmony_ci     */
11081e934351Sopenharmony_ci    /**
11091e934351Sopenharmony_ci     * Initiates an HTTP request to a given URL.
11101e934351Sopenharmony_ci     * @permission ohos.permission.INTERNET
11111e934351Sopenharmony_ci     * @param { string } url - URL for initiating an HTTP request.
11121e934351Sopenharmony_ci     * @param { HttpRequestOptions } [options] - Optional parameters {@link HttpRequestOptions}.
11131e934351Sopenharmony_ci     * @returns { Promise<HttpResponse> } The promise returned by the function.
11141e934351Sopenharmony_ci     * @throws { BusinessError } 401 - Parameter error.
11151e934351Sopenharmony_ci     * @throws { BusinessError } 201 - Permission denied.
11161e934351Sopenharmony_ci     * @throws { BusinessError } 2300001 - Unsupported protocol.
11171e934351Sopenharmony_ci     * @throws { BusinessError } 2300003 - Invalid URL format or missing URL.
11181e934351Sopenharmony_ci     * @throws { BusinessError } 2300005 - Failed to resolve the proxy name.
11191e934351Sopenharmony_ci     * @throws { BusinessError } 2300006 - Failed to resolve the host name.
11201e934351Sopenharmony_ci     * @throws { BusinessError } 2300007 - Failed to connect to the server.
11211e934351Sopenharmony_ci     * @throws { BusinessError } 2300008 - Invalid server response.
11221e934351Sopenharmony_ci     * @throws { BusinessError } 2300009 - Access to the remote resource denied.
11231e934351Sopenharmony_ci     * @throws { BusinessError } 2300016 - Error in the HTTP2 framing layer.
11241e934351Sopenharmony_ci     * @throws { BusinessError } 2300018 - Transferred a partial file.
11251e934351Sopenharmony_ci     * @throws { BusinessError } 2300023 - Failed to write the received data to the disk or application.
11261e934351Sopenharmony_ci     * @throws { BusinessError } 2300025 - Upload failed.
11271e934351Sopenharmony_ci     * @throws { BusinessError } 2300026 - Failed to open or read local data from the file or application.
11281e934351Sopenharmony_ci     * @throws { BusinessError } 2300027 - Out of memory.
11291e934351Sopenharmony_ci     * @throws { BusinessError } 2300028 - Operation timeout.
11301e934351Sopenharmony_ci     * @throws { BusinessError } 2300047 - The number of redirections reaches the maximum allowed.
11311e934351Sopenharmony_ci     * @throws { BusinessError } 2300052 - The server returned nothing (no header or data).
11321e934351Sopenharmony_ci     * @throws { BusinessError } 2300055 - Failed to send data to the peer.
11331e934351Sopenharmony_ci     * @throws { BusinessError } 2300056 - Failed to receive data from the peer.
11341e934351Sopenharmony_ci     * @throws { BusinessError } 2300058 - Local SSL certificate error.
11351e934351Sopenharmony_ci     * @throws { BusinessError } 2300059 - The specified SSL cipher cannot be used.
11361e934351Sopenharmony_ci     * @throws { BusinessError } 2300060 - Invalid SSL peer certificate or SSH remote key.
11371e934351Sopenharmony_ci     * @throws { BusinessError } 2300061 - Invalid HTTP encoding format.
11381e934351Sopenharmony_ci     * @throws { BusinessError } 2300063 - Maximum file size exceeded.
11391e934351Sopenharmony_ci     * @throws { BusinessError } 2300070 - Remote disk full.
11401e934351Sopenharmony_ci     * @throws { BusinessError } 2300073 - Remote file already exists.
11411e934351Sopenharmony_ci     * @throws { BusinessError } 2300077 - The SSL CA certificate does not exist or is inaccessible.
11421e934351Sopenharmony_ci     * @throws { BusinessError } 2300078 - Remote file not found.
11431e934351Sopenharmony_ci     * @throws { BusinessError } 2300094 - Authentication error.
11441e934351Sopenharmony_ci     * @throws { BusinessError } 2300999 - Unknown error.
11451e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
11461e934351Sopenharmony_ci     * @crossplatform
11471e934351Sopenharmony_ci     * @atomicservice
11481e934351Sopenharmony_ci     * @since 11
11491e934351Sopenharmony_ci     */
11501e934351Sopenharmony_ci    request(url: string, options?: HttpRequestOptions): Promise<HttpResponse>;
11511e934351Sopenharmony_ci
11521e934351Sopenharmony_ci    /**
11531e934351Sopenharmony_ci     * Initiates an HTTP request to a given URL, applicable to scenarios where http response supports streaming.
11541e934351Sopenharmony_ci     * @permission ohos.permission.INTERNET
11551e934351Sopenharmony_ci     * @param { string } url - URL for initiating an HTTP request.
11561e934351Sopenharmony_ci     * @param { AsyncCallback<number> } callback - Returns the callback of requestInStream {@link ResponseCode},
11571e934351Sopenharmony_ci     * should use on_headersReceive and on_dataReceive to get http response.
11581e934351Sopenharmony_ci     * @throws { BusinessError } 401 - Parameter error.
11591e934351Sopenharmony_ci     * @throws { BusinessError } 201 - Permission denied.
11601e934351Sopenharmony_ci     * @throws { BusinessError } 2300001 - Unsupported protocol.
11611e934351Sopenharmony_ci     * @throws { BusinessError } 2300003 - Invalid URL format or missing URL.
11621e934351Sopenharmony_ci     * @throws { BusinessError } 2300005 - Failed to resolve the proxy name.
11631e934351Sopenharmony_ci     * @throws { BusinessError } 2300006 - Failed to resolve the host name.
11641e934351Sopenharmony_ci     * @throws { BusinessError } 2300007 - Failed to connect to the server.
11651e934351Sopenharmony_ci     * @throws { BusinessError } 2300008 - Invalid server response.
11661e934351Sopenharmony_ci     * @throws { BusinessError } 2300009 - Access to the remote resource denied.
11671e934351Sopenharmony_ci     * @throws { BusinessError } 2300016 - Error in the HTTP2 framing layer.
11681e934351Sopenharmony_ci     * @throws { BusinessError } 2300018 - Transferred a partial file.
11691e934351Sopenharmony_ci     * @throws { BusinessError } 2300023 - Failed to write the received data to the disk or application.
11701e934351Sopenharmony_ci     * @throws { BusinessError } 2300025 - Upload failed.
11711e934351Sopenharmony_ci     * @throws { BusinessError } 2300026 - Failed to open or read local data from the file or application.
11721e934351Sopenharmony_ci     * @throws { BusinessError } 2300027 - Out of memory.
11731e934351Sopenharmony_ci     * @throws { BusinessError } 2300028 - Operation timeout.
11741e934351Sopenharmony_ci     * @throws { BusinessError } 2300047 - The number of redirections reaches the maximum allowed.
11751e934351Sopenharmony_ci     * @throws { BusinessError } 2300052 - The server returned nothing (no header or data).
11761e934351Sopenharmony_ci     * @throws { BusinessError } 2300055 - Failed to send data to the peer.
11771e934351Sopenharmony_ci     * @throws { BusinessError } 2300056 - Failed to receive data from the peer.
11781e934351Sopenharmony_ci     * @throws { BusinessError } 2300058 - Local SSL certificate error.
11791e934351Sopenharmony_ci     * @throws { BusinessError } 2300059 - The specified SSL cipher cannot be used.
11801e934351Sopenharmony_ci     * @throws { BusinessError } 2300060 - Invalid SSL peer certificate or SSH remote key.
11811e934351Sopenharmony_ci     * @throws { BusinessError } 2300061 - Invalid HTTP encoding format.
11821e934351Sopenharmony_ci     * @throws { BusinessError } 2300063 - Maximum file size exceeded.
11831e934351Sopenharmony_ci     * @throws { BusinessError } 2300070 - Remote disk full.
11841e934351Sopenharmony_ci     * @throws { BusinessError } 2300073 - Remote file already exists.
11851e934351Sopenharmony_ci     * @throws { BusinessError } 2300077 - The SSL CA certificate does not exist or is inaccessible.
11861e934351Sopenharmony_ci     * @throws { BusinessError } 2300078 - Remote file not found.
11871e934351Sopenharmony_ci     * @throws { BusinessError } 2300094 - Authentication error.
11881e934351Sopenharmony_ci     * @throws { BusinessError } 2300999 - Unknown error.
11891e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
11901e934351Sopenharmony_ci     * @since 10
11911e934351Sopenharmony_ci     */
11921e934351Sopenharmony_ci    requestInStream(url: string, callback: AsyncCallback<number>): void;
11931e934351Sopenharmony_ci
11941e934351Sopenharmony_ci    /**
11951e934351Sopenharmony_ci     * Initiates an HTTP request to a given URL, applicable to scenarios where http response supports streaming.
11961e934351Sopenharmony_ci     * @permission ohos.permission.INTERNET
11971e934351Sopenharmony_ci     * @param { string } url - URL for initiating an HTTP request.
11981e934351Sopenharmony_ci     * @param { HttpRequestOptions } options - Optional parameters {@link HttpRequestOptions}.
11991e934351Sopenharmony_ci     * @param { AsyncCallback<number> } callback - the callback of requestInStream.
12001e934351Sopenharmony_ci     * @throws { BusinessError } 401 - Parameter error.
12011e934351Sopenharmony_ci     * @throws { BusinessError } 201 - Permission denied.
12021e934351Sopenharmony_ci     * @throws { BusinessError } 2300001 - Unsupported protocol.
12031e934351Sopenharmony_ci     * @throws { BusinessError } 2300003 - Invalid URL format or missing URL.
12041e934351Sopenharmony_ci     * @throws { BusinessError } 2300005 - Failed to resolve the proxy name.
12051e934351Sopenharmony_ci     * @throws { BusinessError } 2300006 - Failed to resolve the host name.
12061e934351Sopenharmony_ci     * @throws { BusinessError } 2300007 - Failed to connect to the server.
12071e934351Sopenharmony_ci     * @throws { BusinessError } 2300008 - Invalid server response.
12081e934351Sopenharmony_ci     * @throws { BusinessError } 2300009 - Access to the remote resource denied.
12091e934351Sopenharmony_ci     * @throws { BusinessError } 2300016 - Error in the HTTP2 framing layer.
12101e934351Sopenharmony_ci     * @throws { BusinessError } 2300018 - Transferred a partial file.
12111e934351Sopenharmony_ci     * @throws { BusinessError } 2300023 - Failed to write the received data to the disk or application.
12121e934351Sopenharmony_ci     * @throws { BusinessError } 2300025 - Upload failed.
12131e934351Sopenharmony_ci     * @throws { BusinessError } 2300026 - Failed to open or read local data from the file or application.
12141e934351Sopenharmony_ci     * @throws { BusinessError } 2300027 - Out of memory.
12151e934351Sopenharmony_ci     * @throws { BusinessError } 2300028 - Operation timeout.
12161e934351Sopenharmony_ci     * @throws { BusinessError } 2300047 - The number of redirections reaches the maximum allowed.
12171e934351Sopenharmony_ci     * @throws { BusinessError } 2300052 - The server returned nothing (no header or data).
12181e934351Sopenharmony_ci     * @throws { BusinessError } 2300055 - Failed to send data to the peer.
12191e934351Sopenharmony_ci     * @throws { BusinessError } 2300056 - Failed to receive data from the peer.
12201e934351Sopenharmony_ci     * @throws { BusinessError } 2300058 - Local SSL certificate error.
12211e934351Sopenharmony_ci     * @throws { BusinessError } 2300059 - The specified SSL cipher cannot be used.
12221e934351Sopenharmony_ci     * @throws { BusinessError } 2300060 - Invalid SSL peer certificate or SSH remote key.
12231e934351Sopenharmony_ci     * @throws { BusinessError } 2300061 - Invalid HTTP encoding format.
12241e934351Sopenharmony_ci     * @throws { BusinessError } 2300063 - Maximum file size exceeded.
12251e934351Sopenharmony_ci     * @throws { BusinessError } 2300070 - Remote disk full.
12261e934351Sopenharmony_ci     * @throws { BusinessError } 2300073 - Remote file already exists.
12271e934351Sopenharmony_ci     * @throws { BusinessError } 2300077 - The SSL CA certificate does not exist or is inaccessible.
12281e934351Sopenharmony_ci     * @throws { BusinessError } 2300078 - Remote file not found.
12291e934351Sopenharmony_ci     * @throws { BusinessError } 2300094 - Authentication error.
12301e934351Sopenharmony_ci     * @throws { BusinessError } 2300999 - Unknown error.
12311e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
12321e934351Sopenharmony_ci     * @since 10
12331e934351Sopenharmony_ci     */
12341e934351Sopenharmony_ci    requestInStream(url: string, options: HttpRequestOptions, callback: AsyncCallback<number>): void;
12351e934351Sopenharmony_ci
12361e934351Sopenharmony_ci    /**
12371e934351Sopenharmony_ci     * Initiates an HTTP request to a given URL, applicable to scenarios where http response supports streaming.
12381e934351Sopenharmony_ci     * @permission ohos.permission.INTERNET
12391e934351Sopenharmony_ci     * @param { string } url - URL for initiating an HTTP request.
12401e934351Sopenharmony_ci     * @param { HttpRequestOptions } [options] - Optional parameters {@link HttpRequestOptions}.
12411e934351Sopenharmony_ci     * @returns { Promise<number> } the promise returned by the function.
12421e934351Sopenharmony_ci     * @throws { BusinessError } 401 - Parameter error.
12431e934351Sopenharmony_ci     * @throws { BusinessError } 201 - Permission denied.
12441e934351Sopenharmony_ci     * @throws { BusinessError } 2300001 - Unsupported protocol.
12451e934351Sopenharmony_ci     * @throws { BusinessError } 2300003 - Invalid URL format or missing URL.
12461e934351Sopenharmony_ci     * @throws { BusinessError } 2300005 - Failed to resolve the proxy name.
12471e934351Sopenharmony_ci     * @throws { BusinessError } 2300006 - Failed to resolve the host name.
12481e934351Sopenharmony_ci     * @throws { BusinessError } 2300007 - Failed to connect to the server.
12491e934351Sopenharmony_ci     * @throws { BusinessError } 2300008 - Invalid server response.
12501e934351Sopenharmony_ci     * @throws { BusinessError } 2300009 - Access to the remote resource denied.
12511e934351Sopenharmony_ci     * @throws { BusinessError } 2300016 - Error in the HTTP2 framing layer.
12521e934351Sopenharmony_ci     * @throws { BusinessError } 2300018 - Transferred a partial file.
12531e934351Sopenharmony_ci     * @throws { BusinessError } 2300023 - Failed to write the received data to the disk or application.
12541e934351Sopenharmony_ci     * @throws { BusinessError } 2300025 - Upload failed.
12551e934351Sopenharmony_ci     * @throws { BusinessError } 2300026 - Failed to open or read local data from the file or application.
12561e934351Sopenharmony_ci     * @throws { BusinessError } 2300027 - Out of memory.
12571e934351Sopenharmony_ci     * @throws { BusinessError } 2300028 - Operation timeout.
12581e934351Sopenharmony_ci     * @throws { BusinessError } 2300047 - The number of redirections reaches the maximum allowed.
12591e934351Sopenharmony_ci     * @throws { BusinessError } 2300052 - The server returned nothing (no header or data).
12601e934351Sopenharmony_ci     * @throws { BusinessError } 2300055 - Failed to send data to the peer.
12611e934351Sopenharmony_ci     * @throws { BusinessError } 2300056 - Failed to receive data from the peer.
12621e934351Sopenharmony_ci     * @throws { BusinessError } 2300058 - Local SSL certificate error.
12631e934351Sopenharmony_ci     * @throws { BusinessError } 2300059 - The specified SSL cipher cannot be used.
12641e934351Sopenharmony_ci     * @throws { BusinessError } 2300060 - Invalid SSL peer certificate or SSH remote key.
12651e934351Sopenharmony_ci     * @throws { BusinessError } 2300061 - Invalid HTTP encoding format.
12661e934351Sopenharmony_ci     * @throws { BusinessError } 2300063 - Maximum file size exceeded.
12671e934351Sopenharmony_ci     * @throws { BusinessError } 2300070 - Remote disk full.
12681e934351Sopenharmony_ci     * @throws { BusinessError } 2300073 - Remote file already exists.
12691e934351Sopenharmony_ci     * @throws { BusinessError } 2300077 - The SSL CA certificate does not exist or is inaccessible.
12701e934351Sopenharmony_ci     * @throws { BusinessError } 2300078 - Remote file not found.
12711e934351Sopenharmony_ci     * @throws { BusinessError } 2300094 - Authentication error.
12721e934351Sopenharmony_ci     * @throws { BusinessError } 2300999 - Unknown error.
12731e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
12741e934351Sopenharmony_ci     * @since 10
12751e934351Sopenharmony_ci     */
12761e934351Sopenharmony_ci    requestInStream(url: string, options?: HttpRequestOptions): Promise<number>;
12771e934351Sopenharmony_ci
12781e934351Sopenharmony_ci    /**
12791e934351Sopenharmony_ci     * Destroys an HTTP request.
12801e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
12811e934351Sopenharmony_ci     * @since 6
12821e934351Sopenharmony_ci     */
12831e934351Sopenharmony_ci    /**
12841e934351Sopenharmony_ci     * Destroys an HTTP request.
12851e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
12861e934351Sopenharmony_ci     * @crossplatform
12871e934351Sopenharmony_ci     * @since 10
12881e934351Sopenharmony_ci     */
12891e934351Sopenharmony_ci    /**
12901e934351Sopenharmony_ci     * Destroys an HTTP request.
12911e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
12921e934351Sopenharmony_ci     * @crossplatform
12931e934351Sopenharmony_ci     * @atomicservice
12941e934351Sopenharmony_ci     * @since 11
12951e934351Sopenharmony_ci     */
12961e934351Sopenharmony_ci    destroy(): void;
12971e934351Sopenharmony_ci
12981e934351Sopenharmony_ci    /**
12991e934351Sopenharmony_ci     * Registers an observer for HTTP Response Header events.
13001e934351Sopenharmony_ci     * @param { "headerReceive" } type - Indicates Event name.
13011e934351Sopenharmony_ci     * @param { AsyncCallback<Object> } callback - the callback used to return the result.
13021e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
13031e934351Sopenharmony_ci     * @since 6
13041e934351Sopenharmony_ci     * @deprecated since 8
13051e934351Sopenharmony_ci     * @useinstead on_headersReceive
13061e934351Sopenharmony_ci     */
13071e934351Sopenharmony_ci    on(type: "headerReceive", callback: AsyncCallback<Object>): void;
13081e934351Sopenharmony_ci
13091e934351Sopenharmony_ci    /**
13101e934351Sopenharmony_ci     * Unregisters the observer for HTTP Response Header events.
13111e934351Sopenharmony_ci     * @param { "headerReceive" } type - Indicates Event name.
13121e934351Sopenharmony_ci     * @param { AsyncCallback<Object> } [callback] - the callback used to return the result.
13131e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
13141e934351Sopenharmony_ci     * @since 6
13151e934351Sopenharmony_ci     * @deprecated since 8
13161e934351Sopenharmony_ci     * @useinstead off_headersReceive
13171e934351Sopenharmony_ci     */
13181e934351Sopenharmony_ci    off(type: "headerReceive", callback?: AsyncCallback<Object>): void;
13191e934351Sopenharmony_ci
13201e934351Sopenharmony_ci    /**
13211e934351Sopenharmony_ci     * Registers an observer for HTTP Response Header events.
13221e934351Sopenharmony_ci     * @param { "headersReceive" } type - Indicates Event name.
13231e934351Sopenharmony_ci     * @param { Callback<Object> } callback - the callback used to return the result.
13241e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
13251e934351Sopenharmony_ci     * @since 8
13261e934351Sopenharmony_ci     */
13271e934351Sopenharmony_ci    /**
13281e934351Sopenharmony_ci     * Registers an observer for HTTP Response Header events.
13291e934351Sopenharmony_ci     * @param { "headersReceive" } type - Indicates Event name.
13301e934351Sopenharmony_ci     * @param { Callback<Object> } callback - the callback used to return the result.
13311e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
13321e934351Sopenharmony_ci     * @crossplatform
13331e934351Sopenharmony_ci     * @since 10
13341e934351Sopenharmony_ci     */
13351e934351Sopenharmony_ci    /**
13361e934351Sopenharmony_ci     * Registers an observer for HTTP Response Header events.
13371e934351Sopenharmony_ci     * @param { "headersReceive" } type - Indicates Event name.
13381e934351Sopenharmony_ci     * @param { Callback<Object> } callback - the callback used to return the result.
13391e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
13401e934351Sopenharmony_ci     * @crossplatform
13411e934351Sopenharmony_ci     * @atomicservice
13421e934351Sopenharmony_ci     * @since 11
13431e934351Sopenharmony_ci     */
13441e934351Sopenharmony_ci    on(type: "headersReceive", callback: Callback<Object>): void;
13451e934351Sopenharmony_ci
13461e934351Sopenharmony_ci    /**
13471e934351Sopenharmony_ci     * Unregisters the observer for HTTP Response Header events.
13481e934351Sopenharmony_ci     * @param { "headersReceive" } type - Indicates Event name.
13491e934351Sopenharmony_ci     * @param { Callback<Object> } callback - the callback used to return the result.
13501e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
13511e934351Sopenharmony_ci     * @since 8
13521e934351Sopenharmony_ci     */
13531e934351Sopenharmony_ci    /**
13541e934351Sopenharmony_ci     * Unregisters the observer for HTTP Response Header events.
13551e934351Sopenharmony_ci     * @param { "headersReceive" } type - Indicates Event name.
13561e934351Sopenharmony_ci     * @param { Callback<Object> } callback - the callback used to return the result.
13571e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
13581e934351Sopenharmony_ci     * @crossplatform
13591e934351Sopenharmony_ci     * @since 10
13601e934351Sopenharmony_ci     */
13611e934351Sopenharmony_ci    /**
13621e934351Sopenharmony_ci     * Unregisters the observer for HTTP Response Header events.
13631e934351Sopenharmony_ci     * @param { "headersReceive" } type - Indicates Event name.
13641e934351Sopenharmony_ci     * @param { Callback<Object> } [callback] - the callback used to return the result.
13651e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
13661e934351Sopenharmony_ci     * @crossplatform
13671e934351Sopenharmony_ci     * @atomicservice
13681e934351Sopenharmony_ci     * @since 11
13691e934351Sopenharmony_ci     */
13701e934351Sopenharmony_ci    off(type: "headersReceive", callback?: Callback<Object>): void;
13711e934351Sopenharmony_ci
13721e934351Sopenharmony_ci    /**
13731e934351Sopenharmony_ci     * Registers a one-time observer for HTTP Response Header events.
13741e934351Sopenharmony_ci     * @param { "headersReceive" } type - Indicates Event name.
13751e934351Sopenharmony_ci     * @param { Callback<Object> } callback - the callback used to return the result.
13761e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
13771e934351Sopenharmony_ci     * @since 8
13781e934351Sopenharmony_ci     */
13791e934351Sopenharmony_ci    /**
13801e934351Sopenharmony_ci     * Registers a one-time observer for HTTP Response Header events.
13811e934351Sopenharmony_ci     * @param { "headersReceive" } type - Indicates Event name.
13821e934351Sopenharmony_ci     * @param { Callback<Object> } callback - the callback used to return the result.
13831e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
13841e934351Sopenharmony_ci     * @crossplatform
13851e934351Sopenharmony_ci     * @since 10
13861e934351Sopenharmony_ci     */
13871e934351Sopenharmony_ci    once(type: "headersReceive", callback: Callback<Object>): void;
13881e934351Sopenharmony_ci
13891e934351Sopenharmony_ci    /**
13901e934351Sopenharmony_ci     * Registers an observer for receiving HTTP Response data events continuously.
13911e934351Sopenharmony_ci     * @param { "dataReceive" } type - Indicates Event name.
13921e934351Sopenharmony_ci     * @param { Callback<ArrayBuffer> } callback - the callback used to return the result.
13931e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
13941e934351Sopenharmony_ci     * @since 10
13951e934351Sopenharmony_ci     */
13961e934351Sopenharmony_ci    on(type: "dataReceive", callback: Callback<ArrayBuffer>): void;
13971e934351Sopenharmony_ci
13981e934351Sopenharmony_ci    /**
13991e934351Sopenharmony_ci     * Unregisters an observer for receiving HTTP Response data events continuously.
14001e934351Sopenharmony_ci     * @param { "dataReceive" } type - Indicates Event name.
14011e934351Sopenharmony_ci     * @param { Callback<ArrayBuffer> } [callback] - the callback used to return the result.
14021e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
14031e934351Sopenharmony_ci     * @since 10
14041e934351Sopenharmony_ci     */
14051e934351Sopenharmony_ci    off(type: "dataReceive", callback?: Callback<ArrayBuffer>): void;
14061e934351Sopenharmony_ci
14071e934351Sopenharmony_ci    /**
14081e934351Sopenharmony_ci     * Registers an observer for receiving HTTP Response data ends events.
14091e934351Sopenharmony_ci     * @param { "dataEnd" } type - Indicates Event name.
14101e934351Sopenharmony_ci     * @param { Callback<void> } callback - the callback used to return the result.
14111e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
14121e934351Sopenharmony_ci     * @since 10
14131e934351Sopenharmony_ci     */
14141e934351Sopenharmony_ci    on(type: "dataEnd", callback: Callback<void>): void;
14151e934351Sopenharmony_ci
14161e934351Sopenharmony_ci    /**
14171e934351Sopenharmony_ci     * Unregisters an observer for receiving HTTP Response data ends events.
14181e934351Sopenharmony_ci     * @param { "dataEnd" } type - Indicates Event name.
14191e934351Sopenharmony_ci     * @param { Callback<void> } [callback] - the callback used to return the result.
14201e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
14211e934351Sopenharmony_ci     * @since 10
14221e934351Sopenharmony_ci     */
14231e934351Sopenharmony_ci    off(type: "dataEnd", callback?: Callback<void>): void;
14241e934351Sopenharmony_ci
14251e934351Sopenharmony_ci    /**
14261e934351Sopenharmony_ci     * Registers an observer for progress of receiving HTTP Response data events.
14271e934351Sopenharmony_ci     * @param { 'dataReceiveProgress' } type - Indicates Event name.
14281e934351Sopenharmony_ci     * @param { Callback<{ receiveSize: number, totalSize: number }> } callback - the callback used to return the result.
14291e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
14301e934351Sopenharmony_ci     * @since 10
14311e934351Sopenharmony_ci     */
14321e934351Sopenharmony_ci    /**
14331e934351Sopenharmony_ci     * Registers an observer for progress of receiving HTTP Response data events.
14341e934351Sopenharmony_ci     * @param { 'dataReceiveProgress' } type - Indicates Event name.
14351e934351Sopenharmony_ci     * @param { Callback<DataReceiveProgressInfo> } callback - the callback used to return the result.
14361e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
14371e934351Sopenharmony_ci     * @since 11
14381e934351Sopenharmony_ci     */
14391e934351Sopenharmony_ci    /**
14401e934351Sopenharmony_ci     * Registers an observer for progress of receiving HTTP Response data events.
14411e934351Sopenharmony_ci     * @param { 'dataReceiveProgress' } type - Indicates Event name.
14421e934351Sopenharmony_ci     * @param { Callback<DataReceiveProgressInfo> } callback - the callback used to return the result.
14431e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
14441e934351Sopenharmony_ci     * @crossplatform
14451e934351Sopenharmony_ci     * @since 12
14461e934351Sopenharmony_ci     */
14471e934351Sopenharmony_ci    on(type: 'dataReceiveProgress', callback: Callback<DataReceiveProgressInfo>): void;
14481e934351Sopenharmony_ci
14491e934351Sopenharmony_ci    /**
14501e934351Sopenharmony_ci     * Unregisters an observer for progress of receiving HTTP Response data events.
14511e934351Sopenharmony_ci     * @param { 'dataReceiveProgress' } type - Indicates Event name.
14521e934351Sopenharmony_ci     * @param { Callback<{ receiveSize: number, totalSize: number }> } [callback] - the callback used to return the result.
14531e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
14541e934351Sopenharmony_ci     * @since 10
14551e934351Sopenharmony_ci     */
14561e934351Sopenharmony_ci    /**
14571e934351Sopenharmony_ci     * Unregisters an observer for progress of receiving HTTP Response data events.
14581e934351Sopenharmony_ci     * @param { 'dataReceiveProgress' } type - Indicates Event name.
14591e934351Sopenharmony_ci     * @param { Callback<DataReceiveProgressInfo> } callback - the callback used to return the result.
14601e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
14611e934351Sopenharmony_ci     * @since 11
14621e934351Sopenharmony_ci     */
14631e934351Sopenharmony_ci    /**
14641e934351Sopenharmony_ci     * Unregisters an observer for progress of receiving HTTP Response data events.
14651e934351Sopenharmony_ci     * @param { 'dataReceiveProgress' } type - Indicates Event name.
14661e934351Sopenharmony_ci     * @param { Callback<DataReceiveProgressInfo> } callback - the callback used to return the result.
14671e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
14681e934351Sopenharmony_ci     * @crossplatform
14691e934351Sopenharmony_ci     * @since 12
14701e934351Sopenharmony_ci     */
14711e934351Sopenharmony_ci    off(type: 'dataReceiveProgress', callback?: Callback<DataReceiveProgressInfo>): void;
14721e934351Sopenharmony_ci
14731e934351Sopenharmony_ci    /**
14741e934351Sopenharmony_ci     * Registers an observer for progress of sendSize HTTP Response data events.
14751e934351Sopenharmony_ci     * @param { 'dataSendProgress' } type - Indicates Event name.
14761e934351Sopenharmony_ci     * @param { Callback<DataSendProgressInfo> } callback - the callback of on.
14771e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
14781e934351Sopenharmony_ci     * @since 11
14791e934351Sopenharmony_ci     */
14801e934351Sopenharmony_ci    /**
14811e934351Sopenharmony_ci     * Registers an observer for progress of sendSize HTTP Response data events.
14821e934351Sopenharmony_ci     * @param { 'dataSendProgress' } type - Indicates Event name.
14831e934351Sopenharmony_ci     * @param { Callback<DataSendProgressInfo> } callback - the callback of on.
14841e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
14851e934351Sopenharmony_ci     * @crossplatform
14861e934351Sopenharmony_ci     * @since 12
14871e934351Sopenharmony_ci     */
14881e934351Sopenharmony_ci    on(type: 'dataSendProgress', callback: Callback<DataSendProgressInfo>): void
14891e934351Sopenharmony_ci
14901e934351Sopenharmony_ci    /**
14911e934351Sopenharmony_ci     * Unregisters an observer for progress of sendSize HTTP Response data events.
14921e934351Sopenharmony_ci     * @param { 'dataSendProgress' } type - Indicates Event name.
14931e934351Sopenharmony_ci     * @param { Callback<DataSendProgressInfo> } [callback] - the callback of off.
14941e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
14951e934351Sopenharmony_ci     * @since 11
14961e934351Sopenharmony_ci     */
14971e934351Sopenharmony_ci    /**
14981e934351Sopenharmony_ci     * Unregisters an observer for progress of sendSize HTTP Response data events.
14991e934351Sopenharmony_ci     * @param { 'dataSendProgress' } type - Indicates Event name.
15001e934351Sopenharmony_ci     * @param { Callback<DataSendProgressInfo> } [callback] - the callback of off.
15011e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
15021e934351Sopenharmony_ci     * @crossplatform
15031e934351Sopenharmony_ci     * @since 12
15041e934351Sopenharmony_ci     */
15051e934351Sopenharmony_ci    off(type: 'dataSendProgress', callback?: Callback<DataSendProgressInfo>): void
15061e934351Sopenharmony_ci  }
15071e934351Sopenharmony_ci
15081e934351Sopenharmony_ci  /**
15091e934351Sopenharmony_ci   * Defines an HTTP request method.
15101e934351Sopenharmony_ci   * @enum {string}
15111e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
15121e934351Sopenharmony_ci   * @since 6
15131e934351Sopenharmony_ci   */
15141e934351Sopenharmony_ci  /**
15151e934351Sopenharmony_ci   * Defines an HTTP request method.
15161e934351Sopenharmony_ci   * @enum {string}
15171e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
15181e934351Sopenharmony_ci   * @crossplatform
15191e934351Sopenharmony_ci   * @since 10
15201e934351Sopenharmony_ci   */
15211e934351Sopenharmony_ci  /**
15221e934351Sopenharmony_ci   * Defines an HTTP request method.
15231e934351Sopenharmony_ci   * @enum {string}
15241e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
15251e934351Sopenharmony_ci   * @crossplatform
15261e934351Sopenharmony_ci   * @atomicservice
15271e934351Sopenharmony_ci   * @since 11
15281e934351Sopenharmony_ci   */
15291e934351Sopenharmony_ci  export enum RequestMethod {
15301e934351Sopenharmony_ci    /**
15311e934351Sopenharmony_ci     * OPTIONS method.
15321e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
15331e934351Sopenharmony_ci     * @since 6
15341e934351Sopenharmony_ci     */
15351e934351Sopenharmony_ci    /**
15361e934351Sopenharmony_ci     * OPTIONS method.
15371e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
15381e934351Sopenharmony_ci     * @crossplatform
15391e934351Sopenharmony_ci     * @since 10
15401e934351Sopenharmony_ci     */
15411e934351Sopenharmony_ci    /**
15421e934351Sopenharmony_ci     * OPTIONS method.
15431e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
15441e934351Sopenharmony_ci     * @crossplatform
15451e934351Sopenharmony_ci     * @atomicservice
15461e934351Sopenharmony_ci     * @since 11
15471e934351Sopenharmony_ci     */
15481e934351Sopenharmony_ci    OPTIONS = "OPTIONS",
15491e934351Sopenharmony_ci
15501e934351Sopenharmony_ci    /**
15511e934351Sopenharmony_ci     * GET method.
15521e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
15531e934351Sopenharmony_ci     * @since 6
15541e934351Sopenharmony_ci     */
15551e934351Sopenharmony_ci    /**
15561e934351Sopenharmony_ci     * GET method.
15571e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
15581e934351Sopenharmony_ci     * @crossplatform
15591e934351Sopenharmony_ci     * @since 10
15601e934351Sopenharmony_ci     */
15611e934351Sopenharmony_ci    /**
15621e934351Sopenharmony_ci     * GET method.
15631e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
15641e934351Sopenharmony_ci     * @crossplatform
15651e934351Sopenharmony_ci     * @atomicservice
15661e934351Sopenharmony_ci     * @since 11
15671e934351Sopenharmony_ci     */
15681e934351Sopenharmony_ci    GET = "GET",
15691e934351Sopenharmony_ci
15701e934351Sopenharmony_ci    /**
15711e934351Sopenharmony_ci     * HEAD method.
15721e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
15731e934351Sopenharmony_ci     * @since 6
15741e934351Sopenharmony_ci     */
15751e934351Sopenharmony_ci    /**
15761e934351Sopenharmony_ci     * HEAD method.
15771e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
15781e934351Sopenharmony_ci     * @crossplatform
15791e934351Sopenharmony_ci     * @since 10
15801e934351Sopenharmony_ci     */
15811e934351Sopenharmony_ci    /**
15821e934351Sopenharmony_ci     * HEAD method.
15831e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
15841e934351Sopenharmony_ci     * @crossplatform
15851e934351Sopenharmony_ci     * @atomicservice
15861e934351Sopenharmony_ci     * @since 11
15871e934351Sopenharmony_ci     */
15881e934351Sopenharmony_ci    HEAD = "HEAD",
15891e934351Sopenharmony_ci
15901e934351Sopenharmony_ci    /**
15911e934351Sopenharmony_ci     * POST method.
15921e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
15931e934351Sopenharmony_ci     * @since 6
15941e934351Sopenharmony_ci     */
15951e934351Sopenharmony_ci    /**
15961e934351Sopenharmony_ci     * POST method.
15971e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
15981e934351Sopenharmony_ci     * @crossplatform
15991e934351Sopenharmony_ci     * @since 10
16001e934351Sopenharmony_ci     */
16011e934351Sopenharmony_ci    /**
16021e934351Sopenharmony_ci     * POST method.
16031e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
16041e934351Sopenharmony_ci     * @crossplatform
16051e934351Sopenharmony_ci     * @atomicservice
16061e934351Sopenharmony_ci     * @since 11
16071e934351Sopenharmony_ci     */
16081e934351Sopenharmony_ci    POST = "POST",
16091e934351Sopenharmony_ci
16101e934351Sopenharmony_ci    /**
16111e934351Sopenharmony_ci     * PUT method.
16121e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
16131e934351Sopenharmony_ci     * @since 6
16141e934351Sopenharmony_ci     */
16151e934351Sopenharmony_ci    /**
16161e934351Sopenharmony_ci     * PUT method.
16171e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
16181e934351Sopenharmony_ci     * @crossplatform
16191e934351Sopenharmony_ci     * @since 10
16201e934351Sopenharmony_ci     */
16211e934351Sopenharmony_ci    /**
16221e934351Sopenharmony_ci     * PUT method.
16231e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
16241e934351Sopenharmony_ci     * @crossplatform
16251e934351Sopenharmony_ci     * @atomicservice
16261e934351Sopenharmony_ci     * @since 11
16271e934351Sopenharmony_ci     */
16281e934351Sopenharmony_ci    PUT = "PUT",
16291e934351Sopenharmony_ci
16301e934351Sopenharmony_ci    /**
16311e934351Sopenharmony_ci     * DELETE method.
16321e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
16331e934351Sopenharmony_ci     * @since 6
16341e934351Sopenharmony_ci     */
16351e934351Sopenharmony_ci    /**
16361e934351Sopenharmony_ci     * DELETE method.
16371e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
16381e934351Sopenharmony_ci     * @crossplatform
16391e934351Sopenharmony_ci     * @since 10
16401e934351Sopenharmony_ci     */
16411e934351Sopenharmony_ci    /**
16421e934351Sopenharmony_ci     * DELETE method.
16431e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
16441e934351Sopenharmony_ci     * @crossplatform
16451e934351Sopenharmony_ci     * @atomicservice
16461e934351Sopenharmony_ci     * @since 11
16471e934351Sopenharmony_ci     */
16481e934351Sopenharmony_ci    DELETE = "DELETE",
16491e934351Sopenharmony_ci
16501e934351Sopenharmony_ci    /**
16511e934351Sopenharmony_ci     * TRACE method.
16521e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
16531e934351Sopenharmony_ci     * @since 6
16541e934351Sopenharmony_ci     */
16551e934351Sopenharmony_ci    /**
16561e934351Sopenharmony_ci     * TRACE method.
16571e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
16581e934351Sopenharmony_ci     * @crossplatform
16591e934351Sopenharmony_ci     * @since 10
16601e934351Sopenharmony_ci     */
16611e934351Sopenharmony_ci    /**
16621e934351Sopenharmony_ci     * TRACE method.
16631e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
16641e934351Sopenharmony_ci     * @crossplatform
16651e934351Sopenharmony_ci     * @atomicservice
16661e934351Sopenharmony_ci     * @since 11
16671e934351Sopenharmony_ci     */
16681e934351Sopenharmony_ci    TRACE = "TRACE",
16691e934351Sopenharmony_ci
16701e934351Sopenharmony_ci    /**
16711e934351Sopenharmony_ci     * CONNECT method.
16721e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
16731e934351Sopenharmony_ci     * @since 6
16741e934351Sopenharmony_ci     */
16751e934351Sopenharmony_ci    /**
16761e934351Sopenharmony_ci     * CONNECT method.
16771e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
16781e934351Sopenharmony_ci     * @crossplatform
16791e934351Sopenharmony_ci     * @since 10
16801e934351Sopenharmony_ci     */
16811e934351Sopenharmony_ci    /**
16821e934351Sopenharmony_ci     * CONNECT method.
16831e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
16841e934351Sopenharmony_ci     * @crossplatform
16851e934351Sopenharmony_ci     * @atomicservice
16861e934351Sopenharmony_ci     * @since 11
16871e934351Sopenharmony_ci     */
16881e934351Sopenharmony_ci    CONNECT = "CONNECT"
16891e934351Sopenharmony_ci  }
16901e934351Sopenharmony_ci
16911e934351Sopenharmony_ci  /**
16921e934351Sopenharmony_ci   * Enumerates the response codes for an HTTP request.
16931e934351Sopenharmony_ci   * @enum {number}
16941e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
16951e934351Sopenharmony_ci   * @since 6
16961e934351Sopenharmony_ci   */
16971e934351Sopenharmony_ci  /**
16981e934351Sopenharmony_ci   * Enumerates the response codes for an HTTP request.
16991e934351Sopenharmony_ci   * @enum {number}
17001e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
17011e934351Sopenharmony_ci   * @crossplatform
17021e934351Sopenharmony_ci   * @since 10
17031e934351Sopenharmony_ci   */
17041e934351Sopenharmony_ci  /**
17051e934351Sopenharmony_ci   * Enumerates the response codes for an HTTP request.
17061e934351Sopenharmony_ci   * @enum {number}
17071e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
17081e934351Sopenharmony_ci   * @crossplatform
17091e934351Sopenharmony_ci   * @atomicservice
17101e934351Sopenharmony_ci   * @since 11
17111e934351Sopenharmony_ci   */
17121e934351Sopenharmony_ci  export enum ResponseCode {
17131e934351Sopenharmony_ci    /**
17141e934351Sopenharmony_ci     * The request was successful. Typically used for GET and POST requests.
17151e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
17161e934351Sopenharmony_ci     * @since 6
17171e934351Sopenharmony_ci     */
17181e934351Sopenharmony_ci    /**
17191e934351Sopenharmony_ci     * The request was successful. Typically used for GET and POST requests.
17201e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
17211e934351Sopenharmony_ci     * @crossplatform
17221e934351Sopenharmony_ci     * @since 10
17231e934351Sopenharmony_ci     */
17241e934351Sopenharmony_ci    /**
17251e934351Sopenharmony_ci     * The request was successful. Typically used for GET and POST requests.
17261e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
17271e934351Sopenharmony_ci     * @crossplatform
17281e934351Sopenharmony_ci     * @atomicservice
17291e934351Sopenharmony_ci     * @since 11
17301e934351Sopenharmony_ci     */
17311e934351Sopenharmony_ci    OK = 200,
17321e934351Sopenharmony_ci
17331e934351Sopenharmony_ci    /**
17341e934351Sopenharmony_ci     * Successfully requested and created a new resource.
17351e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
17361e934351Sopenharmony_ci     * @since 6
17371e934351Sopenharmony_ci     */
17381e934351Sopenharmony_ci    /**
17391e934351Sopenharmony_ci     * Successfully requested and created a new resource.
17401e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
17411e934351Sopenharmony_ci     * @crossplatform
17421e934351Sopenharmony_ci     * @since 10
17431e934351Sopenharmony_ci     */
17441e934351Sopenharmony_ci    /**
17451e934351Sopenharmony_ci     * Successfully requested and created a new resource.
17461e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
17471e934351Sopenharmony_ci     * @crossplatform
17481e934351Sopenharmony_ci     * @atomicservice
17491e934351Sopenharmony_ci     * @since 11
17501e934351Sopenharmony_ci     */
17511e934351Sopenharmony_ci    CREATED,
17521e934351Sopenharmony_ci
17531e934351Sopenharmony_ci    /**
17541e934351Sopenharmony_ci     * The request has been accepted but has not been processed completely.
17551e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
17561e934351Sopenharmony_ci     * @since 6
17571e934351Sopenharmony_ci     */
17581e934351Sopenharmony_ci    /**
17591e934351Sopenharmony_ci     * The request has been accepted but has not been processed completely.
17601e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
17611e934351Sopenharmony_ci     * @crossplatform
17621e934351Sopenharmony_ci     * @since 10
17631e934351Sopenharmony_ci     */
17641e934351Sopenharmony_ci    /**
17651e934351Sopenharmony_ci     * The request has been accepted but has not been processed completely.
17661e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
17671e934351Sopenharmony_ci     * @crossplatform
17681e934351Sopenharmony_ci     * @atomicservice
17691e934351Sopenharmony_ci     * @since 11
17701e934351Sopenharmony_ci     */
17711e934351Sopenharmony_ci    ACCEPTED,
17721e934351Sopenharmony_ci
17731e934351Sopenharmony_ci    /**
17741e934351Sopenharmony_ci     * Unauthorized information. The request was successful.
17751e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
17761e934351Sopenharmony_ci     * @since 6
17771e934351Sopenharmony_ci     */
17781e934351Sopenharmony_ci    /**
17791e934351Sopenharmony_ci     * Unauthorized information. The request was successful.
17801e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
17811e934351Sopenharmony_ci     * @crossplatform
17821e934351Sopenharmony_ci     * @since 10
17831e934351Sopenharmony_ci     */
17841e934351Sopenharmony_ci    /**
17851e934351Sopenharmony_ci     * Unauthorized information. The request was successful.
17861e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
17871e934351Sopenharmony_ci     * @crossplatform
17881e934351Sopenharmony_ci     * @atomicservice
17891e934351Sopenharmony_ci     * @since 11
17901e934351Sopenharmony_ci     */
17911e934351Sopenharmony_ci    NOT_AUTHORITATIVE,
17921e934351Sopenharmony_ci
17931e934351Sopenharmony_ci    /**
17941e934351Sopenharmony_ci     * No content. The server successfully processed, but did not return content.
17951e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
17961e934351Sopenharmony_ci     * @since 6
17971e934351Sopenharmony_ci     */
17981e934351Sopenharmony_ci    /**
17991e934351Sopenharmony_ci     * No content. The server successfully processed, but did not return content.
18001e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
18011e934351Sopenharmony_ci     * @crossplatform
18021e934351Sopenharmony_ci     * @since 10
18031e934351Sopenharmony_ci     */
18041e934351Sopenharmony_ci    /**
18051e934351Sopenharmony_ci     * No content. The server successfully processed, but did not return content.
18061e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
18071e934351Sopenharmony_ci     * @crossplatform
18081e934351Sopenharmony_ci     * @atomicservice
18091e934351Sopenharmony_ci     * @since 11
18101e934351Sopenharmony_ci     */
18111e934351Sopenharmony_ci    NO_CONTENT,
18121e934351Sopenharmony_ci
18131e934351Sopenharmony_ci    /**
18141e934351Sopenharmony_ci     * Reset the content.
18151e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
18161e934351Sopenharmony_ci     * @since 6
18171e934351Sopenharmony_ci     */
18181e934351Sopenharmony_ci    /**
18191e934351Sopenharmony_ci     * Reset the content.
18201e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
18211e934351Sopenharmony_ci     * @crossplatform
18221e934351Sopenharmony_ci     * @since 10
18231e934351Sopenharmony_ci     */
18241e934351Sopenharmony_ci    /**
18251e934351Sopenharmony_ci     * Reset the content.
18261e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
18271e934351Sopenharmony_ci     * @crossplatform
18281e934351Sopenharmony_ci     * @atomicservice
18291e934351Sopenharmony_ci     * @since 11
18301e934351Sopenharmony_ci     */
18311e934351Sopenharmony_ci    RESET,
18321e934351Sopenharmony_ci
18331e934351Sopenharmony_ci    /**
18341e934351Sopenharmony_ci     * Partial content. The server successfully processed some GET requests.
18351e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
18361e934351Sopenharmony_ci     * @since 6
18371e934351Sopenharmony_ci     */
18381e934351Sopenharmony_ci    /**
18391e934351Sopenharmony_ci     * Partial content. The server successfully processed some GET requests.
18401e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
18411e934351Sopenharmony_ci     * @crossplatform
18421e934351Sopenharmony_ci     * @since 10
18431e934351Sopenharmony_ci     */
18441e934351Sopenharmony_ci    /**
18451e934351Sopenharmony_ci     * Partial content. The server successfully processed some GET requests.
18461e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
18471e934351Sopenharmony_ci     * @crossplatform
18481e934351Sopenharmony_ci     * @atomicservice
18491e934351Sopenharmony_ci     * @since 11
18501e934351Sopenharmony_ci     */
18511e934351Sopenharmony_ci    PARTIAL,
18521e934351Sopenharmony_ci
18531e934351Sopenharmony_ci    /**
18541e934351Sopenharmony_ci     * Multiple options.
18551e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
18561e934351Sopenharmony_ci     * @since 6
18571e934351Sopenharmony_ci     */
18581e934351Sopenharmony_ci    /**
18591e934351Sopenharmony_ci     * Multiple options.
18601e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
18611e934351Sopenharmony_ci     * @crossplatform
18621e934351Sopenharmony_ci     * @since 10
18631e934351Sopenharmony_ci     */
18641e934351Sopenharmony_ci    /**
18651e934351Sopenharmony_ci     * Multiple options.
18661e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
18671e934351Sopenharmony_ci     * @crossplatform
18681e934351Sopenharmony_ci     * @atomicservice
18691e934351Sopenharmony_ci     * @since 11
18701e934351Sopenharmony_ci     */
18711e934351Sopenharmony_ci    MULT_CHOICE = 300,
18721e934351Sopenharmony_ci
18731e934351Sopenharmony_ci    /**
18741e934351Sopenharmony_ci     * <p>Permanently move. The requested resource has been permanently moved to a new URI,
18751e934351Sopenharmony_ci     * and the returned information will include the new URI. The browser will automatically redirect to the new URI.</p>
18761e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
18771e934351Sopenharmony_ci     * @since 6
18781e934351Sopenharmony_ci     */
18791e934351Sopenharmony_ci    /**
18801e934351Sopenharmony_ci     * <p>Permanently move. The requested resource has been permanently moved to a new URI,
18811e934351Sopenharmony_ci     * and the returned information will include the new URI. The browser will automatically redirect to the new URI.</p>
18821e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
18831e934351Sopenharmony_ci     * @crossplatform
18841e934351Sopenharmony_ci     * @since 10
18851e934351Sopenharmony_ci     */
18861e934351Sopenharmony_ci    /**
18871e934351Sopenharmony_ci     * <p>Permanently move. The requested resource has been permanently moved to a new URI,
18881e934351Sopenharmony_ci     * and the returned information will include the new URI. The browser will automatically redirect to the new URI.</p>
18891e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
18901e934351Sopenharmony_ci     * @crossplatform
18911e934351Sopenharmony_ci     * @atomicservice
18921e934351Sopenharmony_ci     * @since 11
18931e934351Sopenharmony_ci     */
18941e934351Sopenharmony_ci    MOVED_PERM,
18951e934351Sopenharmony_ci
18961e934351Sopenharmony_ci    /**
18971e934351Sopenharmony_ci     * Temporary movement.
18981e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
18991e934351Sopenharmony_ci     * @since 6
19001e934351Sopenharmony_ci     */
19011e934351Sopenharmony_ci    /**
19021e934351Sopenharmony_ci     * Temporary movement.
19031e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
19041e934351Sopenharmony_ci     * @crossplatform
19051e934351Sopenharmony_ci     * @since 10
19061e934351Sopenharmony_ci     */
19071e934351Sopenharmony_ci    /**
19081e934351Sopenharmony_ci     * Temporary movement.
19091e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
19101e934351Sopenharmony_ci     * @crossplatform
19111e934351Sopenharmony_ci     * @atomicservice
19121e934351Sopenharmony_ci     * @since 11
19131e934351Sopenharmony_ci     */
19141e934351Sopenharmony_ci    MOVED_TEMP,
19151e934351Sopenharmony_ci
19161e934351Sopenharmony_ci    /**
19171e934351Sopenharmony_ci     * View other addresses.
19181e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
19191e934351Sopenharmony_ci     * @since 6
19201e934351Sopenharmony_ci     */
19211e934351Sopenharmony_ci    /**
19221e934351Sopenharmony_ci     * View other addresses.
19231e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
19241e934351Sopenharmony_ci     * @crossplatform
19251e934351Sopenharmony_ci     * @since 10
19261e934351Sopenharmony_ci     */
19271e934351Sopenharmony_ci    /**
19281e934351Sopenharmony_ci     * View other addresses.
19291e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
19301e934351Sopenharmony_ci     * @crossplatform
19311e934351Sopenharmony_ci     * @atomicservice
19321e934351Sopenharmony_ci     * @since 11
19331e934351Sopenharmony_ci     */
19341e934351Sopenharmony_ci    SEE_OTHER,
19351e934351Sopenharmony_ci
19361e934351Sopenharmony_ci    /**
19371e934351Sopenharmony_ci     * Not modified.
19381e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
19391e934351Sopenharmony_ci     * @since 6
19401e934351Sopenharmony_ci     */
19411e934351Sopenharmony_ci    /**
19421e934351Sopenharmony_ci     * Not modified.
19431e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
19441e934351Sopenharmony_ci     * @crossplatform
19451e934351Sopenharmony_ci     * @since 10
19461e934351Sopenharmony_ci     */
19471e934351Sopenharmony_ci    /**
19481e934351Sopenharmony_ci     * Not modified.
19491e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
19501e934351Sopenharmony_ci     * @crossplatform
19511e934351Sopenharmony_ci     * @atomicservice
19521e934351Sopenharmony_ci     * @since 11
19531e934351Sopenharmony_ci     */
19541e934351Sopenharmony_ci    NOT_MODIFIED,
19551e934351Sopenharmony_ci
19561e934351Sopenharmony_ci    /**
19571e934351Sopenharmony_ci     * Using proxies.
19581e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
19591e934351Sopenharmony_ci     * @since 6
19601e934351Sopenharmony_ci     */
19611e934351Sopenharmony_ci    /**
19621e934351Sopenharmony_ci     * Using proxies.
19631e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
19641e934351Sopenharmony_ci     * @crossplatform
19651e934351Sopenharmony_ci     * @since 10
19661e934351Sopenharmony_ci     */
19671e934351Sopenharmony_ci    /**
19681e934351Sopenharmony_ci     * Using proxies.
19691e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
19701e934351Sopenharmony_ci     * @crossplatform
19711e934351Sopenharmony_ci     * @atomicservice
19721e934351Sopenharmony_ci     * @since 11
19731e934351Sopenharmony_ci     */
19741e934351Sopenharmony_ci    USE_PROXY,
19751e934351Sopenharmony_ci
19761e934351Sopenharmony_ci    /**
19771e934351Sopenharmony_ci     * The server cannot understand the syntax error error requested by the client.
19781e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
19791e934351Sopenharmony_ci     * @since 6
19801e934351Sopenharmony_ci     */
19811e934351Sopenharmony_ci    /**
19821e934351Sopenharmony_ci     * The server cannot understand the syntax error error requested by the client.
19831e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
19841e934351Sopenharmony_ci     * @crossplatform
19851e934351Sopenharmony_ci     * @since 10
19861e934351Sopenharmony_ci     */
19871e934351Sopenharmony_ci    /**
19881e934351Sopenharmony_ci     * The server cannot understand the syntax error error requested by the client.
19891e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
19901e934351Sopenharmony_ci     * @crossplatform
19911e934351Sopenharmony_ci     * @atomicservice
19921e934351Sopenharmony_ci     * @since 11
19931e934351Sopenharmony_ci     */
19941e934351Sopenharmony_ci    BAD_REQUEST = 400,
19951e934351Sopenharmony_ci
19961e934351Sopenharmony_ci    /**
19971e934351Sopenharmony_ci     * Request for user authentication.
19981e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
19991e934351Sopenharmony_ci     * @since 6
20001e934351Sopenharmony_ci     */
20011e934351Sopenharmony_ci    /**
20021e934351Sopenharmony_ci     * Request for user authentication.
20031e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
20041e934351Sopenharmony_ci     * @crossplatform
20051e934351Sopenharmony_ci     * @since 10
20061e934351Sopenharmony_ci     */
20071e934351Sopenharmony_ci    /**
20081e934351Sopenharmony_ci     * Request for user authentication.
20091e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
20101e934351Sopenharmony_ci     * @crossplatform
20111e934351Sopenharmony_ci     * @atomicservice
20121e934351Sopenharmony_ci     * @since 11
20131e934351Sopenharmony_ci     */
20141e934351Sopenharmony_ci    UNAUTHORIZED,
20151e934351Sopenharmony_ci
20161e934351Sopenharmony_ci    /**
20171e934351Sopenharmony_ci     * Reserved for future use.
20181e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
20191e934351Sopenharmony_ci     * @since 6
20201e934351Sopenharmony_ci     */
20211e934351Sopenharmony_ci    /**
20221e934351Sopenharmony_ci     * Reserved for future use.
20231e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
20241e934351Sopenharmony_ci     * @crossplatform
20251e934351Sopenharmony_ci     * @since 10
20261e934351Sopenharmony_ci     */
20271e934351Sopenharmony_ci    /**
20281e934351Sopenharmony_ci     * Reserved for future use.
20291e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
20301e934351Sopenharmony_ci     * @crossplatform
20311e934351Sopenharmony_ci     * @atomicservice
20321e934351Sopenharmony_ci     * @since 11
20331e934351Sopenharmony_ci     */
20341e934351Sopenharmony_ci    PAYMENT_REQUIRED,
20351e934351Sopenharmony_ci
20361e934351Sopenharmony_ci    /**
20371e934351Sopenharmony_ci     * The server understands the request from the requesting client, but refuses to execute it.
20381e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
20391e934351Sopenharmony_ci     * @since 6
20401e934351Sopenharmony_ci     */
20411e934351Sopenharmony_ci    /**
20421e934351Sopenharmony_ci     * The server understands the request from the requesting client, but refuses to execute it.
20431e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
20441e934351Sopenharmony_ci     * @crossplatform
20451e934351Sopenharmony_ci     * @since 10
20461e934351Sopenharmony_ci     */
20471e934351Sopenharmony_ci    /**
20481e934351Sopenharmony_ci     * The server understands the request from the requesting client, but refuses to execute it.
20491e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
20501e934351Sopenharmony_ci     * @crossplatform
20511e934351Sopenharmony_ci     * @atomicservice
20521e934351Sopenharmony_ci     * @since 11
20531e934351Sopenharmony_ci     */
20541e934351Sopenharmony_ci    FORBIDDEN,
20551e934351Sopenharmony_ci
20561e934351Sopenharmony_ci    /**
20571e934351Sopenharmony_ci     * The server was unable to find resources (web pages) based on the client's request.
20581e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
20591e934351Sopenharmony_ci     * @since 6
20601e934351Sopenharmony_ci     */
20611e934351Sopenharmony_ci    /**
20621e934351Sopenharmony_ci     * The server was unable to find resources (web pages) based on the client's request.
20631e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
20641e934351Sopenharmony_ci     * @crossplatform
20651e934351Sopenharmony_ci     * @since 10
20661e934351Sopenharmony_ci     */
20671e934351Sopenharmony_ci    /**
20681e934351Sopenharmony_ci     * The server was unable to find resources (web pages) based on the client's request.
20691e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
20701e934351Sopenharmony_ci     * @crossplatform
20711e934351Sopenharmony_ci     * @atomicservice
20721e934351Sopenharmony_ci     * @since 11
20731e934351Sopenharmony_ci     */
20741e934351Sopenharmony_ci    NOT_FOUND,
20751e934351Sopenharmony_ci
20761e934351Sopenharmony_ci    /**
20771e934351Sopenharmony_ci     * The method in the client request is prohibited.
20781e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
20791e934351Sopenharmony_ci     * @since 6
20801e934351Sopenharmony_ci     */
20811e934351Sopenharmony_ci    /**
20821e934351Sopenharmony_ci     * The method in the client request is prohibited.
20831e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
20841e934351Sopenharmony_ci     * @crossplatform
20851e934351Sopenharmony_ci     * @since 10
20861e934351Sopenharmony_ci     */
20871e934351Sopenharmony_ci    /**
20881e934351Sopenharmony_ci     * The method in the client request is prohibited.
20891e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
20901e934351Sopenharmony_ci     * @crossplatform
20911e934351Sopenharmony_ci     * @atomicservice
20921e934351Sopenharmony_ci     * @since 11
20931e934351Sopenharmony_ci     */
20941e934351Sopenharmony_ci    BAD_METHOD,
20951e934351Sopenharmony_ci
20961e934351Sopenharmony_ci    /**
20971e934351Sopenharmony_ci     * The server is unable to complete the request based on the content characteristics requested by the client.
20981e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
20991e934351Sopenharmony_ci     * @since 6
21001e934351Sopenharmony_ci     */
21011e934351Sopenharmony_ci    /**
21021e934351Sopenharmony_ci     * The server is unable to complete the request based on the content characteristics requested by the client.
21031e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
21041e934351Sopenharmony_ci     * @crossplatform
21051e934351Sopenharmony_ci     * @since 10
21061e934351Sopenharmony_ci     */
21071e934351Sopenharmony_ci    /**
21081e934351Sopenharmony_ci     * The server is unable to complete the request based on the content characteristics requested by the client.
21091e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
21101e934351Sopenharmony_ci     * @crossplatform
21111e934351Sopenharmony_ci     * @atomicservice
21121e934351Sopenharmony_ci     * @since 11
21131e934351Sopenharmony_ci     */
21141e934351Sopenharmony_ci    NOT_ACCEPTABLE,
21151e934351Sopenharmony_ci
21161e934351Sopenharmony_ci    /**
21171e934351Sopenharmony_ci     * Request authentication of the proxy's identity.
21181e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
21191e934351Sopenharmony_ci     * @since 6
21201e934351Sopenharmony_ci     */
21211e934351Sopenharmony_ci    /**
21221e934351Sopenharmony_ci     * Request authentication of the proxy's identity.
21231e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
21241e934351Sopenharmony_ci     * @crossplatform
21251e934351Sopenharmony_ci     * @since 10
21261e934351Sopenharmony_ci     */
21271e934351Sopenharmony_ci    /**
21281e934351Sopenharmony_ci     * Request authentication of the proxy's identity.
21291e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
21301e934351Sopenharmony_ci     * @crossplatform
21311e934351Sopenharmony_ci     * @atomicservice
21321e934351Sopenharmony_ci     * @since 11
21331e934351Sopenharmony_ci     */
21341e934351Sopenharmony_ci    PROXY_AUTH,
21351e934351Sopenharmony_ci
21361e934351Sopenharmony_ci    /**
21371e934351Sopenharmony_ci     * The request took too long and timed out.
21381e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
21391e934351Sopenharmony_ci     * @since 6
21401e934351Sopenharmony_ci     */
21411e934351Sopenharmony_ci    /**
21421e934351Sopenharmony_ci     * The request took too long and timed out.
21431e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
21441e934351Sopenharmony_ci     * @crossplatform
21451e934351Sopenharmony_ci     * @since 10
21461e934351Sopenharmony_ci     */
21471e934351Sopenharmony_ci    /**
21481e934351Sopenharmony_ci     * The request took too long and timed out.
21491e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
21501e934351Sopenharmony_ci     * @crossplatform
21511e934351Sopenharmony_ci     * @atomicservice
21521e934351Sopenharmony_ci     * @since 11
21531e934351Sopenharmony_ci     */
21541e934351Sopenharmony_ci    CLIENT_TIMEOUT,
21551e934351Sopenharmony_ci
21561e934351Sopenharmony_ci    /**
21571e934351Sopenharmony_ci     * <p>The server may have returned this code when completing the client's PUT request,
21581e934351Sopenharmony_ci     * as there was a conflict when the server was processing the request.</p>
21591e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
21601e934351Sopenharmony_ci     * @since 6
21611e934351Sopenharmony_ci     */
21621e934351Sopenharmony_ci    /**
21631e934351Sopenharmony_ci     * <p>The server may have returned this code when completing the client's PUT request,
21641e934351Sopenharmony_ci     * as there was a conflict when the server was processing the request.</p>
21651e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
21661e934351Sopenharmony_ci     * @crossplatform
21671e934351Sopenharmony_ci     * @since 10
21681e934351Sopenharmony_ci     */
21691e934351Sopenharmony_ci    /**
21701e934351Sopenharmony_ci     * <p>The server may have returned this code when completing the client's PUT request,
21711e934351Sopenharmony_ci     * as there was a conflict when the server was processing the request.</p>
21721e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
21731e934351Sopenharmony_ci     * @crossplatform
21741e934351Sopenharmony_ci     * @atomicservice
21751e934351Sopenharmony_ci     * @since 11
21761e934351Sopenharmony_ci     */
21771e934351Sopenharmony_ci    CONFLICT,
21781e934351Sopenharmony_ci
21791e934351Sopenharmony_ci    /**
21801e934351Sopenharmony_ci     * The resource requested by the client no longer exists.
21811e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
21821e934351Sopenharmony_ci     * @since 6
21831e934351Sopenharmony_ci     */
21841e934351Sopenharmony_ci    /**
21851e934351Sopenharmony_ci     * The resource requested by the client no longer exists.
21861e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
21871e934351Sopenharmony_ci     * @crossplatform
21881e934351Sopenharmony_ci     * @since 10
21891e934351Sopenharmony_ci     */
21901e934351Sopenharmony_ci    /**
21911e934351Sopenharmony_ci     * The resource requested by the client no longer exists.
21921e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
21931e934351Sopenharmony_ci     * @crossplatform
21941e934351Sopenharmony_ci     * @atomicservice
21951e934351Sopenharmony_ci     * @since 11
21961e934351Sopenharmony_ci     */
21971e934351Sopenharmony_ci    GONE,
21981e934351Sopenharmony_ci
21991e934351Sopenharmony_ci    /**
22001e934351Sopenharmony_ci     * The server is unable to process request information sent by the client without Content Length.
22011e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
22021e934351Sopenharmony_ci     * @since 6
22031e934351Sopenharmony_ci     */
22041e934351Sopenharmony_ci    /**
22051e934351Sopenharmony_ci     * The server is unable to process request information sent by the client without Content Length.
22061e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
22071e934351Sopenharmony_ci     * @crossplatform
22081e934351Sopenharmony_ci     * @since 10
22091e934351Sopenharmony_ci     */
22101e934351Sopenharmony_ci    /**
22111e934351Sopenharmony_ci     * The server is unable to process request information sent by the client without Content Length.
22121e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
22131e934351Sopenharmony_ci     * @crossplatform
22141e934351Sopenharmony_ci     * @atomicservice
22151e934351Sopenharmony_ci     * @since 11
22161e934351Sopenharmony_ci     */
22171e934351Sopenharmony_ci    LENGTH_REQUIRED,
22181e934351Sopenharmony_ci
22191e934351Sopenharmony_ci    /**
22201e934351Sopenharmony_ci     * The prerequisite for requesting information from the client is incorrect.
22211e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
22221e934351Sopenharmony_ci     * @since 6
22231e934351Sopenharmony_ci     */
22241e934351Sopenharmony_ci    /**
22251e934351Sopenharmony_ci     * The prerequisite for requesting information from the client is incorrect.
22261e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
22271e934351Sopenharmony_ci     * @crossplatform
22281e934351Sopenharmony_ci     * @since 10
22291e934351Sopenharmony_ci     */
22301e934351Sopenharmony_ci    /**
22311e934351Sopenharmony_ci     * The prerequisite for requesting information from the client is incorrect.
22321e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
22331e934351Sopenharmony_ci     * @crossplatform
22341e934351Sopenharmony_ci     * @atomicservice
22351e934351Sopenharmony_ci     * @since 11
22361e934351Sopenharmony_ci     */
22371e934351Sopenharmony_ci    PRECON_FAILED,
22381e934351Sopenharmony_ci
22391e934351Sopenharmony_ci    /**
22401e934351Sopenharmony_ci     * The request was rejected because the requested entity was too large for the server to process.
22411e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
22421e934351Sopenharmony_ci     * @since 6
22431e934351Sopenharmony_ci     */
22441e934351Sopenharmony_ci    /**
22451e934351Sopenharmony_ci     * The request was rejected because the requested entity was too large for the server to process.
22461e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
22471e934351Sopenharmony_ci     * @crossplatform
22481e934351Sopenharmony_ci     * @since 10
22491e934351Sopenharmony_ci     */
22501e934351Sopenharmony_ci    /**
22511e934351Sopenharmony_ci     * The request was rejected because the requested entity was too large for the server to process.
22521e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
22531e934351Sopenharmony_ci     * @crossplatform
22541e934351Sopenharmony_ci     * @atomicservice
22551e934351Sopenharmony_ci     * @since 11
22561e934351Sopenharmony_ci     */
22571e934351Sopenharmony_ci    ENTITY_TOO_LARGE,
22581e934351Sopenharmony_ci
22591e934351Sopenharmony_ci    /**
22601e934351Sopenharmony_ci     * The requested URI is too long (usually a URL) and the server cannot process it.
22611e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
22621e934351Sopenharmony_ci     * @since 6
22631e934351Sopenharmony_ci     */
22641e934351Sopenharmony_ci    /**
22651e934351Sopenharmony_ci     * The requested URI is too long (usually a URL) and the server cannot process it.
22661e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
22671e934351Sopenharmony_ci     * @crossplatform
22681e934351Sopenharmony_ci     * @since 10
22691e934351Sopenharmony_ci     */
22701e934351Sopenharmony_ci    /**
22711e934351Sopenharmony_ci     * The requested URI is too long (usually a URL) and the server cannot process it.
22721e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
22731e934351Sopenharmony_ci     * @crossplatform
22741e934351Sopenharmony_ci     * @atomicservice
22751e934351Sopenharmony_ci     * @since 11
22761e934351Sopenharmony_ci     */
22771e934351Sopenharmony_ci    REQ_TOO_LONG,
22781e934351Sopenharmony_ci
22791e934351Sopenharmony_ci    /**
22801e934351Sopenharmony_ci     * The server is unable to process the requested format.
22811e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
22821e934351Sopenharmony_ci     * @since 6
22831e934351Sopenharmony_ci     */
22841e934351Sopenharmony_ci    /**
22851e934351Sopenharmony_ci     * The server is unable to process the requested format.
22861e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
22871e934351Sopenharmony_ci     * @crossplatform
22881e934351Sopenharmony_ci     * @since 10
22891e934351Sopenharmony_ci     */
22901e934351Sopenharmony_ci    /**
22911e934351Sopenharmony_ci     * The server is unable to process the requested format.
22921e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
22931e934351Sopenharmony_ci     * @crossplatform
22941e934351Sopenharmony_ci     * @atomicservice
22951e934351Sopenharmony_ci     * @since 11
22961e934351Sopenharmony_ci     */
22971e934351Sopenharmony_ci    UNSUPPORTED_TYPE,
22981e934351Sopenharmony_ci
22991e934351Sopenharmony_ci    /**
23001e934351Sopenharmony_ci     * The server cannot process the requested data range.
23011e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
23021e934351Sopenharmony_ci     * @crossplatform
23031e934351Sopenharmony_ci     * @atomicservice
23041e934351Sopenharmony_ci     * @since 12
23051e934351Sopenharmony_ci     */
23061e934351Sopenharmony_ci    RANGE_NOT_SATISFIABLE,
23071e934351Sopenharmony_ci
23081e934351Sopenharmony_ci    /**
23091e934351Sopenharmony_ci     * Internal server error, unable to complete the request.
23101e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
23111e934351Sopenharmony_ci     * @since 6
23121e934351Sopenharmony_ci     */
23131e934351Sopenharmony_ci    /**
23141e934351Sopenharmony_ci     * Internal server error, unable to complete the request.
23151e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
23161e934351Sopenharmony_ci     * @crossplatform
23171e934351Sopenharmony_ci     * @since 10
23181e934351Sopenharmony_ci     */
23191e934351Sopenharmony_ci    /**
23201e934351Sopenharmony_ci     * Internal server error, unable to complete the request.
23211e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
23221e934351Sopenharmony_ci     * @crossplatform
23231e934351Sopenharmony_ci     * @atomicservice
23241e934351Sopenharmony_ci     * @since 11
23251e934351Sopenharmony_ci     */
23261e934351Sopenharmony_ci    INTERNAL_ERROR = 500,
23271e934351Sopenharmony_ci
23281e934351Sopenharmony_ci    /**
23291e934351Sopenharmony_ci     * The server does not support the requested functionality and cannot complete the request.
23301e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
23311e934351Sopenharmony_ci     * @since 6
23321e934351Sopenharmony_ci     */
23331e934351Sopenharmony_ci    /**
23341e934351Sopenharmony_ci     * The server does not support the requested functionality and cannot complete the request.
23351e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
23361e934351Sopenharmony_ci     * @crossplatform
23371e934351Sopenharmony_ci     * @since 10
23381e934351Sopenharmony_ci     */
23391e934351Sopenharmony_ci    /**
23401e934351Sopenharmony_ci     * The server does not support the requested functionality and cannot complete the request.
23411e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
23421e934351Sopenharmony_ci     * @crossplatform
23431e934351Sopenharmony_ci     * @atomicservice
23441e934351Sopenharmony_ci     * @since 11
23451e934351Sopenharmony_ci     */
23461e934351Sopenharmony_ci    NOT_IMPLEMENTED,
23471e934351Sopenharmony_ci
23481e934351Sopenharmony_ci    /**
23491e934351Sopenharmony_ci     * The server acting as a gateway or proxy received an invalid request from the remote server.
23501e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
23511e934351Sopenharmony_ci     * @since 6
23521e934351Sopenharmony_ci     */
23531e934351Sopenharmony_ci    /**
23541e934351Sopenharmony_ci     * The server acting as a gateway or proxy received an invalid request from the remote server.
23551e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
23561e934351Sopenharmony_ci     * @crossplatform
23571e934351Sopenharmony_ci     * @since 10
23581e934351Sopenharmony_ci     */
23591e934351Sopenharmony_ci    /**
23601e934351Sopenharmony_ci     * The server acting as a gateway or proxy received an invalid request from the remote server.
23611e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
23621e934351Sopenharmony_ci     * @crossplatform
23631e934351Sopenharmony_ci     * @atomicservice
23641e934351Sopenharmony_ci     * @since 11
23651e934351Sopenharmony_ci     */
23661e934351Sopenharmony_ci    BAD_GATEWAY,
23671e934351Sopenharmony_ci
23681e934351Sopenharmony_ci    /**
23691e934351Sopenharmony_ci     * Due to overload or system maintenance, the server is temporarily unable to process client requests.
23701e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
23711e934351Sopenharmony_ci     * @since 6
23721e934351Sopenharmony_ci     */
23731e934351Sopenharmony_ci    /**
23741e934351Sopenharmony_ci     * Due to overload or system maintenance, the server is temporarily unable to process client requests.
23751e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
23761e934351Sopenharmony_ci     * @crossplatform
23771e934351Sopenharmony_ci     * @since 10
23781e934351Sopenharmony_ci     */
23791e934351Sopenharmony_ci    /**
23801e934351Sopenharmony_ci     * Due to overload or system maintenance, the server is temporarily unable to process client requests.
23811e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
23821e934351Sopenharmony_ci     * @crossplatform
23831e934351Sopenharmony_ci     * @atomicservice
23841e934351Sopenharmony_ci     * @since 11
23851e934351Sopenharmony_ci     */
23861e934351Sopenharmony_ci    UNAVAILABLE,
23871e934351Sopenharmony_ci
23881e934351Sopenharmony_ci    /**
23891e934351Sopenharmony_ci     * The server acting as a gateway or proxy did not obtain requests from the remote server in a timely manner.
23901e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
23911e934351Sopenharmony_ci     * @since 6
23921e934351Sopenharmony_ci     */
23931e934351Sopenharmony_ci    /**
23941e934351Sopenharmony_ci     * The server acting as a gateway or proxy did not obtain requests from the remote server in a timely manner.
23951e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
23961e934351Sopenharmony_ci     * @crossplatform
23971e934351Sopenharmony_ci     * @since 10
23981e934351Sopenharmony_ci     */
23991e934351Sopenharmony_ci    /**
24001e934351Sopenharmony_ci     * The server acting as a gateway or proxy did not obtain requests from the remote server in a timely manner.
24011e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
24021e934351Sopenharmony_ci     * @crossplatform
24031e934351Sopenharmony_ci     * @atomicservice
24041e934351Sopenharmony_ci     * @since 11
24051e934351Sopenharmony_ci     */
24061e934351Sopenharmony_ci    GATEWAY_TIMEOUT,
24071e934351Sopenharmony_ci
24081e934351Sopenharmony_ci    /**
24091e934351Sopenharmony_ci     * The version of the HTTP protocol requested by the server.
24101e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
24111e934351Sopenharmony_ci     * @since 6
24121e934351Sopenharmony_ci     */
24131e934351Sopenharmony_ci    /**
24141e934351Sopenharmony_ci     * The version of the HTTP protocol requested by the server.
24151e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
24161e934351Sopenharmony_ci     * @crossplatform
24171e934351Sopenharmony_ci     * @since 10
24181e934351Sopenharmony_ci     */
24191e934351Sopenharmony_ci    /**
24201e934351Sopenharmony_ci     * The version of the HTTP protocol requested by the server.
24211e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
24221e934351Sopenharmony_ci     * @crossplatform
24231e934351Sopenharmony_ci     * @atomicservice
24241e934351Sopenharmony_ci     * @since 11
24251e934351Sopenharmony_ci     */
24261e934351Sopenharmony_ci    VERSION
24271e934351Sopenharmony_ci  }
24281e934351Sopenharmony_ci
24291e934351Sopenharmony_ci  /**
24301e934351Sopenharmony_ci   * Supported protocols.
24311e934351Sopenharmony_ci   * @enum {string}
24321e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
24331e934351Sopenharmony_ci   * @since 9
24341e934351Sopenharmony_ci   */
24351e934351Sopenharmony_ci  /**
24361e934351Sopenharmony_ci   * Supported protocols.
24371e934351Sopenharmony_ci   * @enum {string}
24381e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
24391e934351Sopenharmony_ci   * @crossplatform
24401e934351Sopenharmony_ci   * @since 10
24411e934351Sopenharmony_ci   */
24421e934351Sopenharmony_ci  /**
24431e934351Sopenharmony_ci   * Supported protocols.
24441e934351Sopenharmony_ci   * @enum {string}
24451e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
24461e934351Sopenharmony_ci   * @crossplatform
24471e934351Sopenharmony_ci   * @atomicservice
24481e934351Sopenharmony_ci   * @since 11
24491e934351Sopenharmony_ci   */
24501e934351Sopenharmony_ci
24511e934351Sopenharmony_ci  export enum HttpProtocol {
24521e934351Sopenharmony_ci    /**
24531e934351Sopenharmony_ci     * Protocol http1.1
24541e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
24551e934351Sopenharmony_ci     * @since 9
24561e934351Sopenharmony_ci     */
24571e934351Sopenharmony_ci    /**
24581e934351Sopenharmony_ci     * Protocol http1.1
24591e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
24601e934351Sopenharmony_ci     * @crossplatform
24611e934351Sopenharmony_ci     * @since 10
24621e934351Sopenharmony_ci     */
24631e934351Sopenharmony_ci    /**
24641e934351Sopenharmony_ci     * Protocol http1.1
24651e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
24661e934351Sopenharmony_ci     * @crossplatform
24671e934351Sopenharmony_ci     * @atomicservice
24681e934351Sopenharmony_ci     * @since 11
24691e934351Sopenharmony_ci     */
24701e934351Sopenharmony_ci    HTTP1_1,
24711e934351Sopenharmony_ci
24721e934351Sopenharmony_ci    /**
24731e934351Sopenharmony_ci     * Protocol http2
24741e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
24751e934351Sopenharmony_ci     * @since 9
24761e934351Sopenharmony_ci     */
24771e934351Sopenharmony_ci    /**
24781e934351Sopenharmony_ci     * Protocol http2
24791e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
24801e934351Sopenharmony_ci     * @crossplatform
24811e934351Sopenharmony_ci     * @since 10
24821e934351Sopenharmony_ci     */
24831e934351Sopenharmony_ci    /**
24841e934351Sopenharmony_ci     * Protocol http2
24851e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
24861e934351Sopenharmony_ci     * @crossplatform
24871e934351Sopenharmony_ci     * @atomicservice
24881e934351Sopenharmony_ci     * @since 11
24891e934351Sopenharmony_ci     */
24901e934351Sopenharmony_ci    HTTP2,
24911e934351Sopenharmony_ci
24921e934351Sopenharmony_ci    /**
24931e934351Sopenharmony_ci     * Protocol http3 for https only.
24941e934351Sopenharmony_ci     * Cause error if using http only or not supporting http3 on this device.
24951e934351Sopenharmony_ci     * Fallback to http2 or http1.1 if needed.
24961e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
24971e934351Sopenharmony_ci     * @since 11
24981e934351Sopenharmony_ci     */
24991e934351Sopenharmony_ci    /**
25001e934351Sopenharmony_ci     * Protocol http3 for https only.
25011e934351Sopenharmony_ci     * Cause error if using http only or not supporting http3 on this device.
25021e934351Sopenharmony_ci     * Fallback to http2 or http1.1 if needed.
25031e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
25041e934351Sopenharmony_ci     * @crossplatform
25051e934351Sopenharmony_ci     * @since 12
25061e934351Sopenharmony_ci     */
25071e934351Sopenharmony_ci    HTTP3
25081e934351Sopenharmony_ci  }
25091e934351Sopenharmony_ci
25101e934351Sopenharmony_ci  /**
25111e934351Sopenharmony_ci   * Indicates the type of the returned data.
25121e934351Sopenharmony_ci   * @enum {number}
25131e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
25141e934351Sopenharmony_ci   * @since 9
25151e934351Sopenharmony_ci   */
25161e934351Sopenharmony_ci  /**
25171e934351Sopenharmony_ci   * Indicates the type of the returned data.
25181e934351Sopenharmony_ci   * @enum {number}
25191e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
25201e934351Sopenharmony_ci   * @crossplatform
25211e934351Sopenharmony_ci   * @since 10
25221e934351Sopenharmony_ci   */
25231e934351Sopenharmony_ci  /**
25241e934351Sopenharmony_ci   * Indicates the type of the returned data.
25251e934351Sopenharmony_ci   * @enum {number}
25261e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
25271e934351Sopenharmony_ci   * @crossplatform
25281e934351Sopenharmony_ci   * @atomicservice
25291e934351Sopenharmony_ci   * @since 11
25301e934351Sopenharmony_ci   */
25311e934351Sopenharmony_ci  export enum HttpDataType {
25321e934351Sopenharmony_ci    /**
25331e934351Sopenharmony_ci     * The returned type is string.
25341e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
25351e934351Sopenharmony_ci     * @since 9
25361e934351Sopenharmony_ci     */
25371e934351Sopenharmony_ci    /**
25381e934351Sopenharmony_ci     * The returned type is string.
25391e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
25401e934351Sopenharmony_ci     * @crossplatform
25411e934351Sopenharmony_ci     * @since 10
25421e934351Sopenharmony_ci     */
25431e934351Sopenharmony_ci    /**
25441e934351Sopenharmony_ci     * The returned type is string.
25451e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
25461e934351Sopenharmony_ci     * @crossplatform
25471e934351Sopenharmony_ci     * @atomicservice
25481e934351Sopenharmony_ci     * @since 11
25491e934351Sopenharmony_ci     */
25501e934351Sopenharmony_ci    STRING,
25511e934351Sopenharmony_ci
25521e934351Sopenharmony_ci    /**
25531e934351Sopenharmony_ci     * The returned type is Object.
25541e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
25551e934351Sopenharmony_ci     * @since 9
25561e934351Sopenharmony_ci     */
25571e934351Sopenharmony_ci    /**
25581e934351Sopenharmony_ci     * The returned type is Object.
25591e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
25601e934351Sopenharmony_ci     * @crossplatform
25611e934351Sopenharmony_ci     * @since 10
25621e934351Sopenharmony_ci     */
25631e934351Sopenharmony_ci    /**
25641e934351Sopenharmony_ci     * The returned type is Object.
25651e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
25661e934351Sopenharmony_ci     * @crossplatform
25671e934351Sopenharmony_ci     * @atomicservice
25681e934351Sopenharmony_ci     * @since 11
25691e934351Sopenharmony_ci     */
25701e934351Sopenharmony_ci    OBJECT = 1,
25711e934351Sopenharmony_ci
25721e934351Sopenharmony_ci    /**
25731e934351Sopenharmony_ci     * The returned type is ArrayBuffer.
25741e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
25751e934351Sopenharmony_ci     * @since 9
25761e934351Sopenharmony_ci     */
25771e934351Sopenharmony_ci    /**
25781e934351Sopenharmony_ci     * The returned type is ArrayBuffer.
25791e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
25801e934351Sopenharmony_ci     * @crossplatform
25811e934351Sopenharmony_ci     * @since 10
25821e934351Sopenharmony_ci     */
25831e934351Sopenharmony_ci    /**
25841e934351Sopenharmony_ci     * The returned type is ArrayBuffer.
25851e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
25861e934351Sopenharmony_ci     * @crossplatform
25871e934351Sopenharmony_ci     * @atomicservice
25881e934351Sopenharmony_ci     * @since 11
25891e934351Sopenharmony_ci     */
25901e934351Sopenharmony_ci    ARRAY_BUFFER = 2
25911e934351Sopenharmony_ci  }
25921e934351Sopenharmony_ci
25931e934351Sopenharmony_ci  /**
25941e934351Sopenharmony_ci   * Defines the response to an HTTP request.
25951e934351Sopenharmony_ci   * @interface HttpResponse
25961e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
25971e934351Sopenharmony_ci   * @since 6
25981e934351Sopenharmony_ci   */
25991e934351Sopenharmony_ci  /**
26001e934351Sopenharmony_ci   * Defines the response to an HTTP request.
26011e934351Sopenharmony_ci   * @interface HttpResponse
26021e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
26031e934351Sopenharmony_ci   * @crossplatform
26041e934351Sopenharmony_ci   * @since 10
26051e934351Sopenharmony_ci   */
26061e934351Sopenharmony_ci  /**
26071e934351Sopenharmony_ci   * Defines the response to an HTTP request.
26081e934351Sopenharmony_ci   * @interface HttpResponse
26091e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
26101e934351Sopenharmony_ci   * @crossplatform
26111e934351Sopenharmony_ci   * @atomicservice
26121e934351Sopenharmony_ci   * @since 11
26131e934351Sopenharmony_ci   */
26141e934351Sopenharmony_ci  export interface HttpResponse {
26151e934351Sopenharmony_ci    /**
26161e934351Sopenharmony_ci     * result can be a string (API 6) or an ArrayBuffer(API 8). Object is deprecated from API 8.
26171e934351Sopenharmony_ci     * If {@link HttpRequestOptions#expectDataType} is set, the system preferentially returns this parameter.
26181e934351Sopenharmony_ci     * @type {string | Object | ArrayBuffer}
26191e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
26201e934351Sopenharmony_ci     * @since 6
26211e934351Sopenharmony_ci     */
26221e934351Sopenharmony_ci    /**
26231e934351Sopenharmony_ci     * result can be a string (API 6) or an ArrayBuffer(API 8). Object is deprecated from API 8.
26241e934351Sopenharmony_ci     * If {@link HttpRequestOptions#expectDataType} is set, the system preferentially returns this parameter.
26251e934351Sopenharmony_ci     * @type {string | Object | ArrayBuffer}
26261e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
26271e934351Sopenharmony_ci     * @crossplatform
26281e934351Sopenharmony_ci     * @since 10
26291e934351Sopenharmony_ci     */
26301e934351Sopenharmony_ci    /**
26311e934351Sopenharmony_ci     * result can be a string (API 6) or an ArrayBuffer(API 8). Object is deprecated from API 8.
26321e934351Sopenharmony_ci     * If {@link HttpRequestOptions#expectDataType} is set, the system preferentially returns this parameter.
26331e934351Sopenharmony_ci     * @type {string | Object | ArrayBuffer}
26341e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
26351e934351Sopenharmony_ci     * @crossplatform
26361e934351Sopenharmony_ci     * @atomicservice
26371e934351Sopenharmony_ci     * @since 11
26381e934351Sopenharmony_ci     */
26391e934351Sopenharmony_ci    result: string | Object | ArrayBuffer;
26401e934351Sopenharmony_ci
26411e934351Sopenharmony_ci    /**
26421e934351Sopenharmony_ci     * If the resultType is string, you can get result directly.
26431e934351Sopenharmony_ci     * If the resultType is Object, you can get result such as this: result['key'].
26441e934351Sopenharmony_ci     * If the resultType is ArrayBuffer, you can use ArrayBuffer to create the binary objects.
26451e934351Sopenharmony_ci     * @type {HttpDataType}
26461e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
26471e934351Sopenharmony_ci     * @since 9
26481e934351Sopenharmony_ci     */
26491e934351Sopenharmony_ci    /**
26501e934351Sopenharmony_ci     * If the resultType is string, you can get result directly.
26511e934351Sopenharmony_ci     * If the resultType is Object, you can get result such as this: result['key'].
26521e934351Sopenharmony_ci     * If the resultType is ArrayBuffer, you can use ArrayBuffer to create the binary objects.
26531e934351Sopenharmony_ci     * @type {HttpDataType}
26541e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
26551e934351Sopenharmony_ci     * @crossplatform
26561e934351Sopenharmony_ci     * @since 10
26571e934351Sopenharmony_ci     */
26581e934351Sopenharmony_ci    /**
26591e934351Sopenharmony_ci     * If the resultType is string, you can get result directly.
26601e934351Sopenharmony_ci     * If the resultType is Object, you can get result such as this: result['key'].
26611e934351Sopenharmony_ci     * If the resultType is ArrayBuffer, you can use ArrayBuffer to create the binary objects.
26621e934351Sopenharmony_ci     * @type {HttpDataType}
26631e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
26641e934351Sopenharmony_ci     * @crossplatform
26651e934351Sopenharmony_ci     * @atomicservice
26661e934351Sopenharmony_ci     * @since 11
26671e934351Sopenharmony_ci     */
26681e934351Sopenharmony_ci    resultType: HttpDataType;
26691e934351Sopenharmony_ci
26701e934351Sopenharmony_ci    /**
26711e934351Sopenharmony_ci     * Server status code.
26721e934351Sopenharmony_ci     * @type {ResponseCode | number}
26731e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
26741e934351Sopenharmony_ci     * @since 6
26751e934351Sopenharmony_ci     */
26761e934351Sopenharmony_ci    /**
26771e934351Sopenharmony_ci     * Server status code.
26781e934351Sopenharmony_ci     * @type {ResponseCode | number}
26791e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
26801e934351Sopenharmony_ci     * @crossplatform
26811e934351Sopenharmony_ci     * @since 10
26821e934351Sopenharmony_ci     */
26831e934351Sopenharmony_ci    /**
26841e934351Sopenharmony_ci     * Server status code.
26851e934351Sopenharmony_ci     * @type {ResponseCode | number}
26861e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
26871e934351Sopenharmony_ci     * @crossplatform
26881e934351Sopenharmony_ci     * @atomicservice
26891e934351Sopenharmony_ci     * @since 11
26901e934351Sopenharmony_ci     */
26911e934351Sopenharmony_ci    responseCode: ResponseCode | number;
26921e934351Sopenharmony_ci
26931e934351Sopenharmony_ci    /**
26941e934351Sopenharmony_ci     * All headers in the response from the server.
26951e934351Sopenharmony_ci     * @type {Object}
26961e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
26971e934351Sopenharmony_ci     * @since 6
26981e934351Sopenharmony_ci     */
26991e934351Sopenharmony_ci    /**
27001e934351Sopenharmony_ci     * All headers in the response from the server.
27011e934351Sopenharmony_ci     * @type {Object}
27021e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
27031e934351Sopenharmony_ci     * @crossplatform
27041e934351Sopenharmony_ci     * @since 10
27051e934351Sopenharmony_ci     */
27061e934351Sopenharmony_ci    /**
27071e934351Sopenharmony_ci     * All headers in the response from the server.
27081e934351Sopenharmony_ci     * @type {Object}
27091e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
27101e934351Sopenharmony_ci     * @crossplatform
27111e934351Sopenharmony_ci     * @atomicservice
27121e934351Sopenharmony_ci     * @since 11
27131e934351Sopenharmony_ci     */
27141e934351Sopenharmony_ci    header: Object;
27151e934351Sopenharmony_ci
27161e934351Sopenharmony_ci    /**
27171e934351Sopenharmony_ci     * Cookies returned by the server.
27181e934351Sopenharmony_ci     * @type {string}
27191e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
27201e934351Sopenharmony_ci     * @since 8
27211e934351Sopenharmony_ci     */
27221e934351Sopenharmony_ci    /**
27231e934351Sopenharmony_ci     * Cookies returned by the server.
27241e934351Sopenharmony_ci     * @type {string}
27251e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
27261e934351Sopenharmony_ci     * @crossplatform
27271e934351Sopenharmony_ci     * @since 10
27281e934351Sopenharmony_ci     */
27291e934351Sopenharmony_ci    /**
27301e934351Sopenharmony_ci     * Cookies returned by the server.
27311e934351Sopenharmony_ci     * @type {string}
27321e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
27331e934351Sopenharmony_ci     * @crossplatform
27341e934351Sopenharmony_ci     * @atomicservice
27351e934351Sopenharmony_ci     * @since 11
27361e934351Sopenharmony_ci     */
27371e934351Sopenharmony_ci    cookies: string;
27381e934351Sopenharmony_ci
27391e934351Sopenharmony_ci    /**
27401e934351Sopenharmony_ci     * The time taken of various stages of HTTP request.
27411e934351Sopenharmony_ci     * @type {PerformanceTiming}
27421e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
27431e934351Sopenharmony_ci     * @since 11
27441e934351Sopenharmony_ci     */
27451e934351Sopenharmony_ci    /**
27461e934351Sopenharmony_ci     * The time taken of various stages of HTTP request.
27471e934351Sopenharmony_ci     * @type {PerformanceTiming}
27481e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
27491e934351Sopenharmony_ci     * @crossplatform
27501e934351Sopenharmony_ci     * @since 12
27511e934351Sopenharmony_ci     */
27521e934351Sopenharmony_ci    performanceTiming: PerformanceTiming;
27531e934351Sopenharmony_ci  }
27541e934351Sopenharmony_ci
27551e934351Sopenharmony_ci  /**
27561e934351Sopenharmony_ci   * Counting the time taken of various stages of HTTP request.
27571e934351Sopenharmony_ci   * @interface PerformanceTiming
27581e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
27591e934351Sopenharmony_ci   * @since 11
27601e934351Sopenharmony_ci   */
27611e934351Sopenharmony_ci  /**
27621e934351Sopenharmony_ci   * Counting the time taken of various stages of HTTP request.
27631e934351Sopenharmony_ci   * @interface PerformanceTiming
27641e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
27651e934351Sopenharmony_ci   * @crossplatform
27661e934351Sopenharmony_ci   * @since 12
27671e934351Sopenharmony_ci   */
27681e934351Sopenharmony_ci  export interface PerformanceTiming {
27691e934351Sopenharmony_ci    /**
27701e934351Sopenharmony_ci     * Time taken from startup to DNS resolution completion, in milliseconds.
27711e934351Sopenharmony_ci     * @type {number}
27721e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
27731e934351Sopenharmony_ci     * @since 11
27741e934351Sopenharmony_ci     */
27751e934351Sopenharmony_ci    /**
27761e934351Sopenharmony_ci     * Time taken from startup to DNS resolution completion, in milliseconds.
27771e934351Sopenharmony_ci     * @type {number}
27781e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
27791e934351Sopenharmony_ci     * @crossplatform
27801e934351Sopenharmony_ci     * @since 12
27811e934351Sopenharmony_ci     */
27821e934351Sopenharmony_ci    dnsTiming: number;
27831e934351Sopenharmony_ci
27841e934351Sopenharmony_ci    /**
27851e934351Sopenharmony_ci     * Time taken from startup to TCP connection completion, in milliseconds.
27861e934351Sopenharmony_ci     * @type {number}
27871e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
27881e934351Sopenharmony_ci     * @since 11
27891e934351Sopenharmony_ci     */
27901e934351Sopenharmony_ci    /**
27911e934351Sopenharmony_ci     * Time taken from startup to TCP connection completion, in milliseconds.
27921e934351Sopenharmony_ci     * @type {number}
27931e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
27941e934351Sopenharmony_ci     * @crossplatform
27951e934351Sopenharmony_ci     * @since 12
27961e934351Sopenharmony_ci     */
27971e934351Sopenharmony_ci    tcpTiming: number;
27981e934351Sopenharmony_ci
27991e934351Sopenharmony_ci    /**
28001e934351Sopenharmony_ci     * Time taken from startup to TLS connection completion, in milliseconds.
28011e934351Sopenharmony_ci     * @type {number}
28021e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
28031e934351Sopenharmony_ci     * @since 11
28041e934351Sopenharmony_ci     */
28051e934351Sopenharmony_ci    /**
28061e934351Sopenharmony_ci     * Time taken from startup to TLS connection completion, in milliseconds.
28071e934351Sopenharmony_ci     * @type {number}
28081e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
28091e934351Sopenharmony_ci     * @crossplatform
28101e934351Sopenharmony_ci     * @since 12
28111e934351Sopenharmony_ci     */
28121e934351Sopenharmony_ci    tlsTiming: number;
28131e934351Sopenharmony_ci
28141e934351Sopenharmony_ci    /**
28151e934351Sopenharmony_ci     * Time taken from startup to start sending the first byte, in milliseconds.
28161e934351Sopenharmony_ci     * @type {number}
28171e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
28181e934351Sopenharmony_ci     * @since 11
28191e934351Sopenharmony_ci     */
28201e934351Sopenharmony_ci    /**
28211e934351Sopenharmony_ci     * Time taken from startup to start sending the first byte, in milliseconds.
28221e934351Sopenharmony_ci     * @type {number}
28231e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
28241e934351Sopenharmony_ci     * @crossplatform
28251e934351Sopenharmony_ci     * @since 12
28261e934351Sopenharmony_ci     */
28271e934351Sopenharmony_ci    firstSendTiming: number;
28281e934351Sopenharmony_ci
28291e934351Sopenharmony_ci    /**
28301e934351Sopenharmony_ci     * Time taken from startup to receiving the first byte, in milliseconds.
28311e934351Sopenharmony_ci     * @type {number}
28321e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
28331e934351Sopenharmony_ci     * @since 11
28341e934351Sopenharmony_ci     */
28351e934351Sopenharmony_ci    /**
28361e934351Sopenharmony_ci     * Time taken from startup to receiving the first byte, in milliseconds.
28371e934351Sopenharmony_ci     * @type {number}
28381e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
28391e934351Sopenharmony_ci     * @crossplatform
28401e934351Sopenharmony_ci     * @since 12
28411e934351Sopenharmony_ci     */
28421e934351Sopenharmony_ci    firstReceiveTiming: number;
28431e934351Sopenharmony_ci
28441e934351Sopenharmony_ci    /**
28451e934351Sopenharmony_ci     * Time taken from startup to the completion of the request, in milliseconds.
28461e934351Sopenharmony_ci     * @type {number}
28471e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
28481e934351Sopenharmony_ci     * @since 11
28491e934351Sopenharmony_ci     */
28501e934351Sopenharmony_ci    /**
28511e934351Sopenharmony_ci     * Time taken from startup to the completion of the request, in milliseconds.
28521e934351Sopenharmony_ci     * @type {number}
28531e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
28541e934351Sopenharmony_ci     * @crossplatform
28551e934351Sopenharmony_ci     * @since 12
28561e934351Sopenharmony_ci     */
28571e934351Sopenharmony_ci    totalFinishTiming: number;
28581e934351Sopenharmony_ci
28591e934351Sopenharmony_ci    /**
28601e934351Sopenharmony_ci     * Time taken from startup to completion of all redirection steps, in milliseconds.
28611e934351Sopenharmony_ci     * @type {number}
28621e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
28631e934351Sopenharmony_ci     * @since 11
28641e934351Sopenharmony_ci     */
28651e934351Sopenharmony_ci    /**
28661e934351Sopenharmony_ci     * Time taken from startup to completion of all redirection steps, in milliseconds.
28671e934351Sopenharmony_ci     * @type {number}
28681e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
28691e934351Sopenharmony_ci     * @crossplatform
28701e934351Sopenharmony_ci     * @since 12
28711e934351Sopenharmony_ci     */
28721e934351Sopenharmony_ci    redirectTiming: number;
28731e934351Sopenharmony_ci
28741e934351Sopenharmony_ci    /**
28751e934351Sopenharmony_ci     * Time taken from HTTP request to header completion, in milliseconds.
28761e934351Sopenharmony_ci     * @type {number}
28771e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
28781e934351Sopenharmony_ci     * @since 11
28791e934351Sopenharmony_ci     */
28801e934351Sopenharmony_ci    /**
28811e934351Sopenharmony_ci     * Time taken from HTTP request to header completion, in milliseconds.
28821e934351Sopenharmony_ci     * @type {number}
28831e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
28841e934351Sopenharmony_ci     * @crossplatform
28851e934351Sopenharmony_ci     * @since 12
28861e934351Sopenharmony_ci     */
28871e934351Sopenharmony_ci    responseHeaderTiming: number;
28881e934351Sopenharmony_ci
28891e934351Sopenharmony_ci    /**
28901e934351Sopenharmony_ci     * Time taken from HTTP Request to body completion, in milliseconds.
28911e934351Sopenharmony_ci     * @type {number}
28921e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
28931e934351Sopenharmony_ci     * @since 11
28941e934351Sopenharmony_ci     */
28951e934351Sopenharmony_ci    /**
28961e934351Sopenharmony_ci     * Time taken from HTTP Request to body completion, in milliseconds.
28971e934351Sopenharmony_ci     * @type {number}
28981e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
28991e934351Sopenharmony_ci     * @crossplatform
29001e934351Sopenharmony_ci     * @since 12
29011e934351Sopenharmony_ci     */
29021e934351Sopenharmony_ci    responseBodyTiming: number;
29031e934351Sopenharmony_ci
29041e934351Sopenharmony_ci    /**
29051e934351Sopenharmony_ci     * Time taken from HTTP Request to callback to the application, in milliseconds.
29061e934351Sopenharmony_ci     * @type {number}
29071e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
29081e934351Sopenharmony_ci     * @since 11
29091e934351Sopenharmony_ci     */
29101e934351Sopenharmony_ci    /**
29111e934351Sopenharmony_ci     * Time taken from HTTP Request to callback to the application, in milliseconds.
29121e934351Sopenharmony_ci     * @type {number}
29131e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
29141e934351Sopenharmony_ci     * @crossplatform
29151e934351Sopenharmony_ci     * @since 12
29161e934351Sopenharmony_ci     */
29171e934351Sopenharmony_ci    totalTiming: number;
29181e934351Sopenharmony_ci  }
29191e934351Sopenharmony_ci
29201e934351Sopenharmony_ci  /**
29211e934351Sopenharmony_ci   * This interface is used to obtain the progress information of file upload or download.
29221e934351Sopenharmony_ci   * @interface DataReceiveProgressInfo
29231e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
29241e934351Sopenharmony_ci   * @since 11
29251e934351Sopenharmony_ci   */
29261e934351Sopenharmony_ci  /**
29271e934351Sopenharmony_ci   * This interface is used to obtain the progress information of file upload or download.
29281e934351Sopenharmony_ci   * @interface DataReceiveProgressInfo
29291e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
29301e934351Sopenharmony_ci   * @crossplatform
29311e934351Sopenharmony_ci   * @since 12
29321e934351Sopenharmony_ci   */
29331e934351Sopenharmony_ci  export interface DataReceiveProgressInfo {
29341e934351Sopenharmony_ci    /**
29351e934351Sopenharmony_ci     * Number of data bytes received.
29361e934351Sopenharmony_ci     * @type { number }
29371e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
29381e934351Sopenharmony_ci     * @since 11
29391e934351Sopenharmony_ci     */
29401e934351Sopenharmony_ci    /**
29411e934351Sopenharmony_ci     * Number of data bytes received.
29421e934351Sopenharmony_ci     * @type { number }
29431e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
29441e934351Sopenharmony_ci     * @crossplatform
29451e934351Sopenharmony_ci     * @since 12
29461e934351Sopenharmony_ci     */
29471e934351Sopenharmony_ci    receiveSize: number;
29481e934351Sopenharmony_ci    /**
29491e934351Sopenharmony_ci     * Total number of bytes to receive.
29501e934351Sopenharmony_ci     * @type { number }
29511e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
29521e934351Sopenharmony_ci     * @since 11
29531e934351Sopenharmony_ci     */
29541e934351Sopenharmony_ci    /**
29551e934351Sopenharmony_ci     * Total number of bytes to receive.
29561e934351Sopenharmony_ci     * @type { number }
29571e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
29581e934351Sopenharmony_ci     * @crossplatform
29591e934351Sopenharmony_ci     * @since 12
29601e934351Sopenharmony_ci     */
29611e934351Sopenharmony_ci    totalSize: number;
29621e934351Sopenharmony_ci  }
29631e934351Sopenharmony_ci
29641e934351Sopenharmony_ci  /**
29651e934351Sopenharmony_ci   * This interface is used to monitor the progress of sending data.
29661e934351Sopenharmony_ci   * @interface DataSendProgressInfo
29671e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
29681e934351Sopenharmony_ci   * @since 11
29691e934351Sopenharmony_ci   */
29701e934351Sopenharmony_ci  /**
29711e934351Sopenharmony_ci   * This interface is used to monitor the progress of sending data.
29721e934351Sopenharmony_ci   * @interface DataSendProgressInfo
29731e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
29741e934351Sopenharmony_ci   * @crossplatform
29751e934351Sopenharmony_ci   * @since 12
29761e934351Sopenharmony_ci   */
29771e934351Sopenharmony_ci  export interface DataSendProgressInfo {
29781e934351Sopenharmony_ci    /**
29791e934351Sopenharmony_ci     * Used to specify the data size to be sent.
29801e934351Sopenharmony_ci     * @type { number }
29811e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
29821e934351Sopenharmony_ci     * @since 11
29831e934351Sopenharmony_ci     */
29841e934351Sopenharmony_ci    /**
29851e934351Sopenharmony_ci     * Used to specify the data size to be sent.
29861e934351Sopenharmony_ci     * @type { number }
29871e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
29881e934351Sopenharmony_ci     * @crossplatform
29891e934351Sopenharmony_ci     * @since 12
29901e934351Sopenharmony_ci     */
29911e934351Sopenharmony_ci    sendSize: number;
29921e934351Sopenharmony_ci    /**
29931e934351Sopenharmony_ci     * Total number of bytes to receive.
29941e934351Sopenharmony_ci     * @type { number }
29951e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
29961e934351Sopenharmony_ci     * @since 11
29971e934351Sopenharmony_ci     */
29981e934351Sopenharmony_ci    /**
29991e934351Sopenharmony_ci     * Total number of bytes to receive.
30001e934351Sopenharmony_ci     * @type { number }
30011e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
30021e934351Sopenharmony_ci     * @crossplatform
30031e934351Sopenharmony_ci     * @since 12
30041e934351Sopenharmony_ci     */
30051e934351Sopenharmony_ci    totalSize: number;
30061e934351Sopenharmony_ci  }
30071e934351Sopenharmony_ci
30081e934351Sopenharmony_ci  /**
30091e934351Sopenharmony_ci   * Creates a default {@code HttpResponseCache} object to store the responses of HTTP access requests.
30101e934351Sopenharmony_ci   * @param { number } cacheSize - the size of cache(max value is 10MB), default is 10*1024*1024(10MB).
30111e934351Sopenharmony_ci   * @returns { HttpResponseCache } the HttpResponseCache of the createHttpResponseCache.
30121e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
30131e934351Sopenharmony_ci   * @since 9
30141e934351Sopenharmony_ci   */
30151e934351Sopenharmony_ci  /**
30161e934351Sopenharmony_ci   * Creates a default {@code HttpResponseCache} object to store the responses of HTTP access requests.
30171e934351Sopenharmony_ci   * @param { number } cacheSize - the size of cache(max value is 10MB), default is 10*1024*1024(10MB).
30181e934351Sopenharmony_ci   * @returns { HttpResponseCache } the HttpResponseCache of the createHttpResponseCache.
30191e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
30201e934351Sopenharmony_ci   * @crossplatform
30211e934351Sopenharmony_ci   * @since 10
30221e934351Sopenharmony_ci   */
30231e934351Sopenharmony_ci  /**
30241e934351Sopenharmony_ci   * Creates a default {@code HttpResponseCache} object to store the responses of HTTP access requests.
30251e934351Sopenharmony_ci   * @param { number } cacheSize - the size of cache(max value is 10MB), default is 10*1024*1024(10MB).
30261e934351Sopenharmony_ci   * @returns { HttpResponseCache } the HttpResponseCache of the createHttpResponseCache.
30271e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
30281e934351Sopenharmony_ci   * @crossplatform
30291e934351Sopenharmony_ci   * @atomicservice
30301e934351Sopenharmony_ci   * @since 11
30311e934351Sopenharmony_ci   */
30321e934351Sopenharmony_ci  function createHttpResponseCache(cacheSize?: number): HttpResponseCache;
30331e934351Sopenharmony_ci
30341e934351Sopenharmony_ci  /**
30351e934351Sopenharmony_ci   * Defines an object that stores the response to an HTTP request.
30361e934351Sopenharmony_ci   * @interface HttpResponseCache
30371e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
30381e934351Sopenharmony_ci   * @since 9
30391e934351Sopenharmony_ci   */
30401e934351Sopenharmony_ci  /**
30411e934351Sopenharmony_ci   * Defines an object that stores the response to an HTTP request.
30421e934351Sopenharmony_ci   * @interface HttpResponseCache
30431e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
30441e934351Sopenharmony_ci   * @crossplatform
30451e934351Sopenharmony_ci   * @since 10
30461e934351Sopenharmony_ci   */
30471e934351Sopenharmony_ci  /**
30481e934351Sopenharmony_ci   * Defines an object that stores the response to an HTTP request.
30491e934351Sopenharmony_ci   * @interface HttpResponseCache
30501e934351Sopenharmony_ci   * @syscap SystemCapability.Communication.NetStack
30511e934351Sopenharmony_ci   * @crossplatform
30521e934351Sopenharmony_ci   * @atomicservice
30531e934351Sopenharmony_ci   * @since 11
30541e934351Sopenharmony_ci   */
30551e934351Sopenharmony_ci  export interface HttpResponseCache {
30561e934351Sopenharmony_ci    /**
30571e934351Sopenharmony_ci     * Writes data in the cache to the file system so that all the cached data can be accessed in the next HTTP request.
30581e934351Sopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of flush.
30591e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
30601e934351Sopenharmony_ci     * @since 9
30611e934351Sopenharmony_ci     */
30621e934351Sopenharmony_ci    /**
30631e934351Sopenharmony_ci     * Writes data in the cache to the file system so that all the cached data can be accessed in the next HTTP request.
30641e934351Sopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of flush.
30651e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
30661e934351Sopenharmony_ci     * @crossplatform
30671e934351Sopenharmony_ci     * @since 10
30681e934351Sopenharmony_ci     */
30691e934351Sopenharmony_ci    /**
30701e934351Sopenharmony_ci     * Writes data in the cache to the file system so that all the cached data can be accessed in the next HTTP request.
30711e934351Sopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of flush.
30721e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
30731e934351Sopenharmony_ci     * @crossplatform
30741e934351Sopenharmony_ci     * @atomicservice
30751e934351Sopenharmony_ci     * @since 11
30761e934351Sopenharmony_ci     */
30771e934351Sopenharmony_ci    flush(callback: AsyncCallback<void>): void;
30781e934351Sopenharmony_ci
30791e934351Sopenharmony_ci    /**
30801e934351Sopenharmony_ci     * Writes data in the cache to the file system so that all the cached data can be accessed in the next HTTP request.
30811e934351Sopenharmony_ci     * @returns { Promise<void> } The promise returned by the flush.
30821e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
30831e934351Sopenharmony_ci     * @since 9
30841e934351Sopenharmony_ci     */
30851e934351Sopenharmony_ci    /**
30861e934351Sopenharmony_ci     * Writes data in the cache to the file system so that all the cached data can be accessed in the next HTTP request.
30871e934351Sopenharmony_ci     * @returns { Promise<void> } The promise returned by the flush.
30881e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
30891e934351Sopenharmony_ci     * @crossplatform
30901e934351Sopenharmony_ci     * @since 10
30911e934351Sopenharmony_ci     */
30921e934351Sopenharmony_ci    /**
30931e934351Sopenharmony_ci     * Writes data in the cache to the file system so that all the cached data can be accessed in the next HTTP request.
30941e934351Sopenharmony_ci     * @returns { Promise<void> } The promise returned by the flush.
30951e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
30961e934351Sopenharmony_ci     * @crossplatform
30971e934351Sopenharmony_ci     * @atomicservice
30981e934351Sopenharmony_ci     * @since 11
30991e934351Sopenharmony_ci     */
31001e934351Sopenharmony_ci    flush(): Promise<void>;
31011e934351Sopenharmony_ci
31021e934351Sopenharmony_ci    /**
31031e934351Sopenharmony_ci     * Disables a cache and deletes the data in it.
31041e934351Sopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of delete.
31051e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
31061e934351Sopenharmony_ci     * @since 9
31071e934351Sopenharmony_ci     */
31081e934351Sopenharmony_ci    /**
31091e934351Sopenharmony_ci     * Disables a cache and deletes the data in it.
31101e934351Sopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of delete.
31111e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
31121e934351Sopenharmony_ci     * @crossplatform
31131e934351Sopenharmony_ci     * @since 10
31141e934351Sopenharmony_ci     */
31151e934351Sopenharmony_ci    /**
31161e934351Sopenharmony_ci     * Disables a cache and deletes the data in it.
31171e934351Sopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of delete.
31181e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
31191e934351Sopenharmony_ci     * @crossplatform
31201e934351Sopenharmony_ci     * @atomicservice
31211e934351Sopenharmony_ci     * @since 11
31221e934351Sopenharmony_ci     */
31231e934351Sopenharmony_ci    delete(callback: AsyncCallback<void>): void;
31241e934351Sopenharmony_ci
31251e934351Sopenharmony_ci    /**
31261e934351Sopenharmony_ci     * Disables a cache and deletes the data in it.
31271e934351Sopenharmony_ci     * @returns { Promise<void> } The promise returned by the delete.
31281e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
31291e934351Sopenharmony_ci     * @since 9
31301e934351Sopenharmony_ci     */
31311e934351Sopenharmony_ci    /**
31321e934351Sopenharmony_ci     * Disables a cache and deletes the data in it.
31331e934351Sopenharmony_ci     * @returns { Promise<void> } The promise returned by the delete.
31341e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
31351e934351Sopenharmony_ci     * @crossplatform
31361e934351Sopenharmony_ci     * @since 10
31371e934351Sopenharmony_ci     */
31381e934351Sopenharmony_ci    /**
31391e934351Sopenharmony_ci     * Disables a cache and deletes the data in it.
31401e934351Sopenharmony_ci     * @returns { Promise<void> } The promise returned by the delete.
31411e934351Sopenharmony_ci     * @syscap SystemCapability.Communication.NetStack
31421e934351Sopenharmony_ci     * @crossplatform
31431e934351Sopenharmony_ci     * @atomicservice
31441e934351Sopenharmony_ci     * @since 11
31451e934351Sopenharmony_ci     */
31461e934351Sopenharmony_ci    delete(): Promise<void>;
31471e934351Sopenharmony_ci  }
31481e934351Sopenharmony_ci}
31491e934351Sopenharmony_ci
31501e934351Sopenharmony_ciexport default http;
3151