From a700972a47ab448f8ab45cd860b809ec778849b6 Mon Sep 17 00:00:00 2001 From: oh_ci Date: Thu, 14 Aug 2025 15:36:42 +0000 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E9=80=80=20'Pull=20Request=20!23631?= =?UTF-8?q?=20:=20Refactoring=20of=20any&object=20in=20network=20servi?= =?UTF-8?q?ces'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/@ohos.net.http.d.ts | 65 ++++++------------------------------ api/@ohos.net.webSocket.d.ts | 12 ++----- 2 files changed, 12 insertions(+), 65 deletions(-) diff --git a/api/@ohos.net.http.d.ts b/api/@ohos.net.http.d.ts index 7656c2864e..953539807f 100644 --- a/api/@ohos.net.http.d.ts +++ b/api/@ohos.net.http.d.ts @@ -20,9 +20,6 @@ import type { AsyncCallback, Callback } from './@ohos.base'; import type connection from './@ohos.net.connection'; -/*** if arkts 1.2 */ -import type { RecordData } from './@ohos.base'; -/*** endif */ /** * Provides http related APIs. @@ -195,20 +192,11 @@ declare namespace http { * @syscap SystemCapability.Communication.NetStack * @crossplatform * @atomicservice - * @since 11 + * @since arkts {'1.1':'11','1.2':'20'} + * @arkts 1.1&1.2 */ extraData?: string | Object | ArrayBuffer; - /** - * Additional data of the request. - * extraData can be a string or an Object (API 6) or an ArrayBuffer(API 8). - * @type { ?(string | RecordData | ArrayBuffer) } - * @syscap SystemCapability.Communication.NetStack - * @since 20 - * @arkts 1.2 - */ - extraData?: string | RecordData | ArrayBuffer; - /** * Data type to be returned. If this parameter is set, the system preferentially returns the specified type. * @type {?HttpDataType} @@ -300,19 +288,11 @@ declare namespace http { * @syscap SystemCapability.Communication.NetStack * @crossplatform * @atomicservice - * @since 11 + * @since arkts {'1.1':'11','1.2':'20'} + * @arkts 1.1&1.2 */ header?: Object; - /** - * HTTP request header. default is 'content-type': 'application/json' - * @type {?Record} - * @syscap SystemCapability.Communication.NetStack - * @since 20 - * @arkts 1.2 - */ - header?: Record; - /** * Read timeout period. The default value is 60,000, in ms. * @type {?int} @@ -949,19 +929,11 @@ declare namespace http { * @type {?(string | Object | ArrayBuffer)} * @syscap SystemCapability.Communication.NetStack * @crossplatform - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ data?: string | Object | ArrayBuffer; - /** - * This parameter sets a mime part's body content from memory data. - * @type {?(string | RecordData | ArrayBuffer)} - * @syscap SystemCapability.Communication.NetStack - * @since 20 - * @arkts 1.2 - */ - data?: string | RecordData | ArrayBuffer; - /** * This parameter sets a mime part's body content from the file's contents. * This is an alternative to curl_mime_data for setting data to a mime part. @@ -3849,20 +3821,11 @@ declare namespace http { * @syscap SystemCapability.Communication.NetStack * @crossplatform * @atomicservice - * @since 11 + * @since arkts {'1.1':'11','1.2':'20'} + * @arkts 1.1&1.2 */ result: string | Object | ArrayBuffer; - /** - * result can be a string (API 6) or an ArrayBuffer(API 8). Object is deprecated from API 8. - * If {@link HttpRequestOptions#expectDataType} is set, the system preferentially returns this parameter. - * @type {string | RecordData | ArrayBuffer} - * @syscap SystemCapability.Communication.NetStack - * @since 20 - * @arkts 1.2 - */ - result: string | RecordData | ArrayBuffer; - /** * If the resultType is string, you can get result directly. * If the resultType is Object, you can get result such as this: result['key']. @@ -3936,19 +3899,11 @@ declare namespace http { * @syscap SystemCapability.Communication.NetStack * @crossplatform * @atomicservice - * @since 11 + * @since arkts {'1.1':'11','1.2':'20'} + * @arkts 1.1&1.2 */ header: Object; - /** - * All headers in the response from the server. - * @type {Record} - * @syscap SystemCapability.Communication.NetStack - * @since 20 - * @arkts 1.2 - */ - header: Record; - /** * Cookies returned by the server. * @type {string} diff --git a/api/@ohos.net.webSocket.d.ts b/api/@ohos.net.webSocket.d.ts index 102539b2f3..e582a5f2ed 100644 --- a/api/@ohos.net.webSocket.d.ts +++ b/api/@ohos.net.webSocket.d.ts @@ -118,19 +118,11 @@ declare namespace webSocket { * @syscap SystemCapability.Communication.NetStack * @crossplatform * @atomicservice - * @since 11 + * @since arkts {'1.1':'11','1.2':'20'} + * @arkts 1.1&1.2 */ header?: Object; - /** - * HTTP request header. - * @type {?Record} - * @syscap SystemCapability.Communication.NetStack - * @since 20 - * @arkts 1.2 - */ - header?: Record; - /** * File path for client cert. * @type {?string} -- Gitee