From 7dd52270cadac3be39516e56d97fe7687535a8c1 Mon Sep 17 00:00:00 2001 From: Jeam_wang Date: Tue, 11 Oct 2022 21:24:40 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jeam_wang --- api/@ohos.request.d.ts | 234 +++++++++++++++++++++++++++++++++++++++ api/@system.request.d.ts | 45 ++++++++ 2 files changed, 279 insertions(+) diff --git a/api/@ohos.request.d.ts b/api/@ohos.request.d.ts index 71240158bb..13d03aea29 100644 --- a/api/@ohos.request.d.ts +++ b/api/@ohos.request.d.ts @@ -23,6 +23,48 @@ import BaseContext from './application/BaseContext'; * @permission ohos.permission.INTERNET */ declare namespace request { + /** + * errorcode 201. the permissions check fails + * @syscap SystemCapability.MiscServices.Download + * @since 9 + */ + const EXCEPTION_PERMISSION: number; + /** + * errorcode 401. the parameters check fails + * @syscap SystemCapability.MiscServices.Download + * @since 9 + */ + const EXCEPTION_PARAMCHECK: number; + /** + * errorcode 801. call unsupported api + * @syscap SystemCapability.MiscServices.Download + * @since 9 + */ + const EXCEPTION_UNSUPPORTED: number; + /** + * errorcode 13400001. file operation error + * @syscap SystemCapability.MiscServices.Download + * @since 9 + */ + const EXCEPTION_FILEIO: number; + /** + * errorcode 13400002. bad file path + * @syscap SystemCapability.MiscServices.Download + * @since 9 + */ + const EXCEPTION_FILEPATH: number; + /** + * errorcode 13400003. task manager service error + * @syscap SystemCapability.MiscServices.Download + * @since 9 + */ + const EXCEPTION_SERVICE: number; + /** + * errorcode 13499999. others error + * @syscap SystemCapability.MiscServices.Download + * @since 9 + */ + const EXCEPTION_OTHERS: number; /** * Bit flag indicating download is allowed when using the cellular network. @@ -112,6 +154,22 @@ declare namespace request { */ const ERROR_UNKNOWN: number; + /** + * Indicates network offline. + * @syscap SystemCapability.MiscServices.Download + * @since 9 + * @permission ohos.permission.INTERNET + */ + const ERROR_OFFLINE: number; + + /** + * Indicates network type configuration error. + * @syscap SystemCapability.MiscServices.Download + * @since 9 + * @permission ohos.permission.INTERNET + */ + const ERROR_UNSUPPORTED_NETWORK_TYPE: number; + /** * Indicates that the download is paused and waiting for a WLAN connection, because the file size exceeds the maximum allowed for a session using the cellular network. * @syscap SystemCapability.MiscServices.Download @@ -188,6 +246,8 @@ declare namespace request { * Starts a download session. * @syscap SystemCapability.MiscServices.Download * @since 6 + * @deprecated since 9 + * @useinstead ohos.request.downloadFile * @param config download config * @param callback Indicate the callback function to receive DownloadTask. * @permission ohos.permission.INTERNET @@ -200,6 +260,8 @@ declare namespace request { * Starts a download session. * @syscap SystemCapability.MiscServices.Download * @since 9 + * @deprecated since 9 + * @useinstead ohos.request.downloadFile * @param BaseContext Indicates the application BaseContext. * @param config download config * @param callback Indicate the callback function to receive DownloadTask. @@ -208,10 +270,29 @@ declare namespace request { */ function download(context: BaseContext, config: DownloadConfig, callback: AsyncCallback): void; + /** + * Starts a download session. + * @syscap SystemCapability.MiscServices.Download + * @since 9 + * @param BaseContext Indicates the application BaseContext. + * @param config download config + * @param callback Indicate the callback function to receive DownloadTask. + * @permission ohos.permission.INTERNET + * @return - + * @throws {BusinessError} 201 - the permissions check fails + * @throws {BusinessError} 401 - the parameters check fails + * @throws {BusinessError} 13400001 - file operation error + * @throws {BusinessError} 13400002 - bad file path + * @throws {BusinessError} 13400003 - task service ability error + */ + function downloadFile(context: BaseContext, config: DownloadConfig, callback: AsyncCallback): void; + /** * Starts a download session. * @syscap SystemCapability.MiscServices.Download * @since 6 + * @deprecated since 9, + * @useinstead ohos.request.downloadFile * @param config download config * @permission ohos.permission.INTERNET * @return - @@ -223,6 +304,8 @@ declare namespace request { * Starts a download session. * @syscap SystemCapability.MiscServices.Download * @since 9 + * @deprecated since 9, + * @useinstead ohos.request.downloadFile * @param BaseContext Indicates the application BaseContext. * @param config download config * @permission ohos.permission.INTERNET @@ -230,10 +313,28 @@ declare namespace request { */ function download(context: BaseContext, config: DownloadConfig): Promise; + /** + * Starts a download session. + * @syscap SystemCapability.MiscServices.Download + * @since 9 + * @param BaseContext Indicates the application BaseContext. + * @param config download config + * @permission ohos.permission.INTERNET + * @return - + * @throws {BusinessError} 201 - the permissions check fails + * @throws {BusinessError} 401 - the parameters check fails + * @throws {BusinessError} 13400001 - file operation error + * @throws {BusinessError} 13400002 - bad file path + * @throws {BusinessError} 13400003 - task service ability error + */ + function downloadFile(context: BaseContext, config: DownloadConfig): Promise; + /** * Starts a upload session. * @syscap SystemCapability.MiscServices.Upload * @since 6 + * @deprecated since 9 + * @useinstead ohos.request.uploadFile * @param config upload config * @param callback Indicate the callback function to receive UploadTask. * @permission ohos.permission.INTERNET @@ -246,6 +347,8 @@ declare namespace request { * Starts a upload session. * @syscap SystemCapability.MiscServices.Upload * @since 9 + * @deprecated since 9 + * @useinstead ohos.request.uploadFile * @param BaseContext Indicates the application BaseContext. * @param config upload config * @param callback Indicate the callback function to receive UploadTask. @@ -254,10 +357,26 @@ declare namespace request { */ function upload(context: BaseContext, config: UploadConfig, callback: AsyncCallback): void; + /** + * Starts a upload session. + * @syscap SystemCapability.MiscServices.Upload + * @since 9 + * @param BaseContext Indicates the application BaseContext. + * @param config upload config + * @param callback Indicate the callback function to receive UploadTask. + * @return - + * @throws {BusinessError} 201 - the permissions check fails + * @throws {BusinessError} 401 - the parameters check fails + * @throws {BusinessError} 13400002 - bad file path + */ + function uploadFile(context: BaseContext, config: UploadConfig, callback: AsyncCallback): void; + /** * Starts a upload session. * @syscap SystemCapability.MiscServices.Upload * @since 6 + * @deprecated since 9 + * @useinstead ohos.request.uploadFile * @param config upload config * @permission ohos.permission.INTERNET * @return - @@ -269,6 +388,8 @@ declare namespace request { * Starts a upload session. * @syscap SystemCapability.MiscServices.Upload * @since 9 + * @deprecated since 9 + * @useinstead ohos.request.uploadFile * @param BaseContext Indicates the application BaseContext. * @param config upload config * @permission ohos.permission.INTERNET @@ -276,6 +397,20 @@ declare namespace request { */ function upload(context: BaseContext, config: UploadConfig): Promise; + /** + * Starts a upload session. + * @syscap SystemCapability.MiscServices.Upload + * @since 9 + * @param BaseContext Indicates the application BaseContext. + * @param config upload config + * @permission ohos.permission.INTERNET + * @return - + * @throws {BusinessError} 201 - the permissions check fails + * @throws {BusinessError} 401 - the parameters check fails + * @throws {BusinessError} 13400002 - bad file path + */ + function uploadFile(context: BaseContext, config: UploadConfig): Promise; + /** * DownloadConfig data Structure * @@ -520,6 +655,8 @@ declare namespace request { * Deletes a download session and the downloaded files. * @syscap SystemCapability.MiscServices.Download * @since 6 + * @deprecated since 9 + * @useinstead ohos.request.delete * @param callback Indicates asynchronous invoking Result. * @permission ohos.permission.INTERNET * @return - @@ -530,6 +667,8 @@ declare namespace request { * Deletes a download session and the downloaded files. * @syscap SystemCapability.MiscServices.Download * @since 6 + * @deprecated since 9 + * @useinstead ohos.request.delete * @permission ohos.permission.INTERNET * @return - */ @@ -539,6 +678,8 @@ declare namespace request { * Pause a download session. * @syscap SystemCapability.MiscServices.Download * @since 7 + * @deprecated since 9 + * @useinstead ohos.request.suspend * @param callback Indicates asynchronous invoking Result. * @permission ohos.permission.INTERNET * @return - @@ -549,6 +690,8 @@ declare namespace request { * Pause a download session. * @syscap SystemCapability.MiscServices.Download * @since 7 + * @deprecated since 9 + * @useinstead ohos.request.suspend * @permission ohos.permission.INTERNET * @return - */ @@ -558,6 +701,8 @@ declare namespace request { * Resume a paused download session. * @syscap SystemCapability.MiscServices.Download * @since 7 + * @deprecated since 9 + * @useinstead ohos.request.restore * @param callback Indicates asynchronous invoking Result. * @permission ohos.permission.INTERNET * @return - @@ -568,6 +713,8 @@ declare namespace request { * Resume a paused download session. * @syscap SystemCapability.MiscServices.Download * @since 7 + * @deprecated since 9 + * @useinstead ohos.request.restore * @permission ohos.permission.INTERNET * @return - */ @@ -577,6 +724,8 @@ declare namespace request { * Queries download information of a session, which is defined in DownloadSession.DownloadInfo. * @syscap SystemCapability.MiscServices.Download * @since 7 + * @deprecated since 9 + * @useinstead ohos.request.getTaskInfo * @param callback Indicate the callback function to receive download info. * @permission ohos.permission.INTERNET * @return - @@ -587,6 +736,8 @@ declare namespace request { * Queries download information of a session, which is defined in DownloadSession.DownloadInfo. * @syscap SystemCapability.MiscServices.Download * @since 7 + * @deprecated since 9 + * @useinstead ohos.request.getTaskInfo * @permission ohos.permission.INTERNET * @return - */ @@ -596,6 +747,8 @@ declare namespace request { * Queries the MIME type of the download file. * @syscap SystemCapability.MiscServices.Download * @since 7 + * @deprecated since 9 + * @useinstead ohos.request.getTaskMimeType * @param callback Indicate the callback function to receive download file MIME type. * @permission ohos.permission.INTERNET * @return - @@ -606,10 +759,67 @@ declare namespace request { * Queries the MIME type of the download file. * @syscap SystemCapability.MiscServices.Download * @since 7 + * @deprecated since 9 + * @useinstead ohos.request.getTaskMimeType * @permission ohos.permission.INTERNET * @return - */ queryMimeType(): Promise; + + /** + * Delete the download task + * @since 9 + * @permission ohos.permission.INTERNET + * @throws {BusinessError} 201 - the permissions check fails + * @throws {BusinessError} 401 - the parameters check fails + * @syscap SystemCapability.MiscServices.Download + */ + delete(callback: AsyncCallback): void; + delete(): Promise; + + /** + * Suspend the download task + * @since 9 + * @permission ohos.permission.INTERNET + * @throws {BusinessError} 201 - the permissions check fails + * @throws {BusinessError} 401 - the parameters check fails + * @syscap SystemCapability.MiscServices.Download + */ + suspend(callback: AsyncCallback): void; + suspend(): Promise; + + /** + * Restore the download task + * @since 9 + * @permission ohos.permission.INTERNET + * @throws {BusinessError} 201 - the permissions check fails + * @throws {BusinessError} 401 - the parameters check fails + * @syscap SystemCapability.MiscServices.Download + */ + restore(callback: AsyncCallback): void; + restore(): Promise; + + /** + * Get the download task info + * @since 9 + * @permission ohos.permission.INTERNET + * @throws {BusinessError} 201 - the permissions check fails + * @throws {BusinessError} 401 - the parameters check fails + * @syscap SystemCapability.MiscServices.Download + */ + getTaskInfo(callback: AsyncCallback): void; + getTaskInfo(): Promise; + + /** + * Get mimetype of the download task + * @since 9 + * @permission ohos.permission.INTERNET + * @throws {BusinessError} 201 - the permissions check fails + * @throws {BusinessError} 401 - the parameters check fails + * @syscap SystemCapability.MiscServices.Download + */ + getTaskMimeType(callback: AsyncCallback): void; + getTaskMimeType(): Promise; } /** @@ -834,6 +1044,8 @@ declare namespace request { * Deletes a upload session. * @syscap SystemCapability.MiscServices.Upload * @since 6 + * @deprecated since 9 + * @useinstead ohos.request.delete * @param callback Indicates asynchronous invoking Result. * @permission ohos.permission.INTERNET * @return - @@ -844,10 +1056,32 @@ declare namespace request { * Deletes a upload session. * @syscap SystemCapability.MiscServices.Upload * @since 6 + * @deprecated since 9 + * @useinstead ohos.request.delete * @permission ohos.permission.INTERNET * @return - */ remove(): Promise; + + /** + * Delete the upload task + * @since 9 + * @permission ohos.permission.INTERNET + * @throws {BusinessError} 201 - the permissions check fails + * @throws {BusinessError} 401 - the parameters check fails + * @syscap SystemCapability.MiscServices.Upload + */ + delete(callback: AsyncCallback): void; + + /** + * Delete the upload task + * @since 9 + * @permission ohos.permission.INTERNET + * @throws {BusinessError} 201 - the permissions check fails + * @throws {BusinessError} 401 - the parameters check fails + * @syscap SystemCapability.MiscServices.Upload + */ + delete(): Promise; } } diff --git a/api/@system.request.d.ts b/api/@system.request.d.ts index 9c946b7d73..e1c01a8145 100644 --- a/api/@system.request.d.ts +++ b/api/@system.request.d.ts @@ -15,12 +15,15 @@ /** * @syscap SystemCapability.MiscServices.Upload + * @deprecated since 9, + * @useinstead ohos.request */ export interface UploadResponse { /** * Status code returned by the server. * @syscap SystemCapability.MiscServices.Upload * @since 3 + * @deprecated since 9 */ code: number; @@ -29,6 +32,7 @@ export interface UploadResponse { * The value type is determined by the returned content. * @syscap SystemCapability.MiscServices.Upload * @since 3 + * @deprecated since 9 */ data: string; @@ -36,42 +40,49 @@ export interface UploadResponse { * Headers returned by the server. * @syscap SystemCapability.MiscServices.Upload * @since 3 + * @deprecated since 9 */ headers: Object; } /** * @syscap SystemCapability.MiscServices.Download + * @deprecated since 9 */ export interface DownloadResponse { /** * Download token, which is used to obtain the download status. * @syscap SystemCapability.MiscServices.Download * @since 3 + * @deprecated since 9 */ token: string; } /** * @syscap SystemCapability.MiscServices.Download + * @deprecated since 9 */ export interface OnDownloadCompleteResponse { /** * URI of the download file. * @syscap SystemCapability.MiscServices.Download * @since 3 + * @deprecated since 9 */ uri: string; } /** * @syscap SystemCapability.MiscServices.Upload + * @deprecated since 9 */ export interface RequestFile { /** * File name in the header when multipart is used. * @syscap SystemCapability.MiscServices.Upload * @since 3 + * @deprecated since 9 */ filename?: string; @@ -79,6 +90,7 @@ export interface RequestFile { * Name of a form item when multipart is used. The default value is file. * @syscap SystemCapability.MiscServices.Upload * @since 3 + * @deprecated since 9 */ name?: string; @@ -86,6 +98,7 @@ export interface RequestFile { * Local storage directory of a file. * @syscap SystemCapability.MiscServices.Upload * @since 3 + * @deprecated since 9 */ uri: string; @@ -94,18 +107,21 @@ export interface RequestFile { * By default, the type is obtained based on the suffix of the file name or URI. * @syscap SystemCapability.MiscServices.Upload * @since 3 + * @deprecated since 9 */ type?: string; } /** * @syscap SystemCapability.MiscServices.Upload + * @deprecated since 9 */ export interface RequestData { /** * Name of the form element. * @syscap SystemCapability.MiscServices.Upload * @since 3 + * @deprecated since 9 */ name: string; @@ -113,18 +129,21 @@ export interface RequestData { * Value of the form element. * @syscap SystemCapability.MiscServices.Upload * @since 3 + * @deprecated since 9 */ value: string; } /** * @syscap SystemCapability.MiscServices.Upload + * @deprecated since 9 */ export interface UploadRequestOptions { /** * Resource URL. * @syscap SystemCapability.MiscServices.Upload * @since 3 + * @deprecated since 9 */ url: string; @@ -132,6 +151,7 @@ export interface UploadRequestOptions { * Form data in the request body. * @syscap SystemCapability.MiscServices.Upload * @since 3 + * @deprecated since 9 */ data?: Array; @@ -139,6 +159,7 @@ export interface UploadRequestOptions { * List of files to upload, which is submitted through multipart/form-data. * @syscap SystemCapability.MiscServices.Upload * @since 3 + * @deprecated since 9 */ files: Array; @@ -146,6 +167,7 @@ export interface UploadRequestOptions { * Request header. * @syscap SystemCapability.MiscServices.Upload * @since 3 + * @deprecated since 9 */ header?: Object; @@ -153,6 +175,7 @@ export interface UploadRequestOptions { * Request methods available: POST and PUT. The default value is POST. * @syscap SystemCapability.MiscServices.Upload * @since 3 + * @deprecated since 9 */ method?: string; @@ -160,6 +183,7 @@ export interface UploadRequestOptions { * Called when the files are uploaded successfully. * @syscap SystemCapability.MiscServices.Upload * @since 3 + * @deprecated since 9 */ success?: (data: UploadResponse) => void; @@ -167,6 +191,7 @@ export interface UploadRequestOptions { * Called when uploading fails. * @syscap SystemCapability.MiscServices.Upload * @since 3 + * @deprecated since 9 */ fail?: (data: any, code: number) => void; @@ -174,18 +199,21 @@ export interface UploadRequestOptions { * Called when the execution is completed. * @syscap SystemCapability.MiscServices.Upload * @since 3 + * @deprecated since 9 */ complete?: () => void; } /** * @syscap SystemCapability.MiscServices.Download + * @deprecated since 9 */ export interface DownloadRequestOptions { /** * Resource URL. * @syscap SystemCapability.MiscServices.Download * @since 3 + * @deprecated since 9 */ url: string; @@ -194,6 +222,7 @@ export interface DownloadRequestOptions { * The value is obtained from the current request or resource URL by default. * @syscap SystemCapability.MiscServices.Download * @since 3 + * @deprecated since 9 */ filename?: string; @@ -201,6 +230,7 @@ export interface DownloadRequestOptions { * Request header. * @syscap SystemCapability.MiscServices.Download * @since 3 + * @deprecated since 9 */ header?: string; @@ -209,6 +239,7 @@ export interface DownloadRequestOptions { * The default value is the file name. * @syscap SystemCapability.MiscServices.Download * @since 3 + * @deprecated since 9 */ description?: string; @@ -216,6 +247,7 @@ export interface DownloadRequestOptions { * Called when the files are successfully downloaded. * @syscap SystemCapability.MiscServices.Download * @since 3 + * @deprecated since 9 */ success?: (data: DownloadResponse) => void; @@ -223,6 +255,7 @@ export interface DownloadRequestOptions { * Called when downloading fails. * @syscap SystemCapability.MiscServices.Download * @since 3 + * @deprecated since 9 */ fail?: (data: any, code: number) => void; @@ -230,18 +263,21 @@ export interface DownloadRequestOptions { * Called when the execution is completed. * @syscap SystemCapability.MiscServices.Download * @since 3 + * @deprecated since 9 */ complete?: () => void; } /** * @syscap SystemCapability.MiscServices.Download + * @deprecated since 9 */ export interface OnDownloadCompleteOptions { /** * Token of the result returned by the download function. * @syscap SystemCapability.MiscServices.Download * @since 3 + * @deprecated since 9 */ token: string; @@ -249,6 +285,7 @@ export interface OnDownloadCompleteOptions { * Called when the downloads are successfully obtained * @syscap SystemCapability.MiscServices.Download * @since 3 + * @deprecated since 9 */ success?: (data: OnDownloadCompleteResponse) => void; @@ -256,6 +293,7 @@ export interface OnDownloadCompleteOptions { * Called when the downloads fail to be obtained. * @syscap SystemCapability.MiscServices.Download * @since 3 + * @deprecated since 9 */ fail?: (data: any, code: number) => void; @@ -263,15 +301,20 @@ export interface OnDownloadCompleteOptions { * Called when the execution is completed. * @syscap SystemCapability.MiscServices.Download * @since 3 + * @deprecated since 9 */ complete?: () => void; } +/** + * @deprecated since 9 + */ export default class Request { /** * Upload files. * @param options Options. * @syscap SystemCapability.MiscServices.Upload + * @deprecated since 9 */ static upload(options: UploadRequestOptions): void; @@ -279,6 +322,7 @@ export default class Request { * This API is used to download files. * @param options Options. * @syscap SystemCapability.MiscServices.Download + * @deprecated since 9 */ static download(options: DownloadRequestOptions): void; @@ -286,6 +330,7 @@ export default class Request { * Listens to download task status. * @param options Options. * @syscap SystemCapability.MiscServices.Download + * @deprecated since 9 */ static onDownloadComplete(options: OnDownloadCompleteOptions): void; } \ No newline at end of file -- Gitee From 79188013c3361664bb15b3283bce9d3814fbd7c3 Mon Sep 17 00:00:00 2001 From: Jeam_wang Date: Tue, 11 Oct 2022 21:24:40 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jeam_wang # Conflicts: # api/@ohos.request.d.ts --- api/@ohos.request.d.ts | 62 +++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/api/@ohos.request.d.ts b/api/@ohos.request.d.ts index 13d03aea29..445beb6b17 100644 --- a/api/@ohos.request.d.ts +++ b/api/@ohos.request.d.ts @@ -24,43 +24,43 @@ import BaseContext from './application/BaseContext'; */ declare namespace request { /** - * errorcode 201. the permissions check fails + * Error code 201. the permissions check fails * @syscap SystemCapability.MiscServices.Download * @since 9 */ const EXCEPTION_PERMISSION: number; /** - * errorcode 401. the parameters check fails + * Error code 401. the parameters check fails * @syscap SystemCapability.MiscServices.Download * @since 9 */ const EXCEPTION_PARAMCHECK: number; /** - * errorcode 801. call unsupported api + * Error code 801. call unsupported api * @syscap SystemCapability.MiscServices.Download * @since 9 */ const EXCEPTION_UNSUPPORTED: number; /** - * errorcode 13400001. file operation error + * Error code 13400001. file operation error * @syscap SystemCapability.MiscServices.Download * @since 9 */ const EXCEPTION_FILEIO: number; /** - * errorcode 13400002. bad file path + * Error code 13400002. bad file path * @syscap SystemCapability.MiscServices.Download * @since 9 */ const EXCEPTION_FILEPATH: number; /** - * errorcode 13400003. task manager service error + * Error code 13400003. task manager service error * @syscap SystemCapability.MiscServices.Download * @since 9 */ const EXCEPTION_SERVICE: number; /** - * errorcode 13499999. others error + * Error code 13499999. others error * @syscap SystemCapability.MiscServices.Download * @since 9 */ @@ -243,12 +243,12 @@ declare namespace request { const SESSION_SUCCESSFUL: number; /** - * Starts a download session. + * Starts a download task. * @syscap SystemCapability.MiscServices.Download * @since 6 * @deprecated since 9 * @useinstead ohos.request.downloadFile - * @param config download config + * @param config Download config * @param callback Indicate the callback function to receive DownloadTask. * @permission ohos.permission.INTERNET * @return - @@ -257,13 +257,13 @@ declare namespace request { function download(config: DownloadConfig, callback: AsyncCallback): void; /** - * Starts a download session. + * Starts a download task. * @syscap SystemCapability.MiscServices.Download * @since 9 * @deprecated since 9 * @useinstead ohos.request.downloadFile * @param BaseContext Indicates the application BaseContext. - * @param config download config + * @param config Download config * @param callback Indicate the callback function to receive DownloadTask. * @permission ohos.permission.INTERNET * @return - @@ -271,11 +271,11 @@ declare namespace request { function download(context: BaseContext, config: DownloadConfig, callback: AsyncCallback): void; /** - * Starts a download session. + * Starts a download task. * @syscap SystemCapability.MiscServices.Download * @since 9 * @param BaseContext Indicates the application BaseContext. - * @param config download config + * @param config Download config * @param callback Indicate the callback function to receive DownloadTask. * @permission ohos.permission.INTERNET * @return - @@ -288,12 +288,12 @@ declare namespace request { function downloadFile(context: BaseContext, config: DownloadConfig, callback: AsyncCallback): void; /** - * Starts a download session. + * Starts a download task. * @syscap SystemCapability.MiscServices.Download * @since 6 * @deprecated since 9, * @useinstead ohos.request.downloadFile - * @param config download config + * @param config Download config * @permission ohos.permission.INTERNET * @return - * @FAModelOnly @@ -301,24 +301,24 @@ declare namespace request { function download(config: DownloadConfig): Promise; /** - * Starts a download session. + * Starts a download task. * @syscap SystemCapability.MiscServices.Download * @since 9 * @deprecated since 9, * @useinstead ohos.request.downloadFile * @param BaseContext Indicates the application BaseContext. - * @param config download config + * @param config Download config * @permission ohos.permission.INTERNET * @return - */ function download(context: BaseContext, config: DownloadConfig): Promise; /** - * Starts a download session. + * Starts a download task. * @syscap SystemCapability.MiscServices.Download * @since 9 * @param BaseContext Indicates the application BaseContext. - * @param config download config + * @param config Download config * @permission ohos.permission.INTERNET * @return - * @throws {BusinessError} 201 - the permissions check fails @@ -330,12 +330,12 @@ declare namespace request { function downloadFile(context: BaseContext, config: DownloadConfig): Promise; /** - * Starts a upload session. + * Starts a upload task. * @syscap SystemCapability.MiscServices.Upload * @since 6 * @deprecated since 9 * @useinstead ohos.request.uploadFile - * @param config upload config + * @param config Upload config * @param callback Indicate the callback function to receive UploadTask. * @permission ohos.permission.INTERNET * @return - @@ -344,13 +344,13 @@ declare namespace request { function upload(config: UploadConfig, callback: AsyncCallback): void; /** - * Starts a upload session. + * Starts a upload task. * @syscap SystemCapability.MiscServices.Upload * @since 9 * @deprecated since 9 * @useinstead ohos.request.uploadFile * @param BaseContext Indicates the application BaseContext. - * @param config upload config + * @param config Upload config * @param callback Indicate the callback function to receive UploadTask. * @permission ohos.permission.INTERNET * @return - @@ -358,11 +358,11 @@ declare namespace request { function upload(context: BaseContext, config: UploadConfig, callback: AsyncCallback): void; /** - * Starts a upload session. + * Starts a upload task. * @syscap SystemCapability.MiscServices.Upload * @since 9 * @param BaseContext Indicates the application BaseContext. - * @param config upload config + * @param config Upload config * @param callback Indicate the callback function to receive UploadTask. * @return - * @throws {BusinessError} 201 - the permissions check fails @@ -372,12 +372,12 @@ declare namespace request { function uploadFile(context: BaseContext, config: UploadConfig, callback: AsyncCallback): void; /** - * Starts a upload session. + * Starts a upload task. * @syscap SystemCapability.MiscServices.Upload * @since 6 * @deprecated since 9 * @useinstead ohos.request.uploadFile - * @param config upload config + * @param config Upload config * @permission ohos.permission.INTERNET * @return - * @FAModelOnly @@ -385,24 +385,24 @@ declare namespace request { function upload(config: UploadConfig): Promise; /** - * Starts a upload session. + * Starts a upload task. * @syscap SystemCapability.MiscServices.Upload * @since 9 * @deprecated since 9 * @useinstead ohos.request.uploadFile * @param BaseContext Indicates the application BaseContext. - * @param config upload config + * @param config Upload config * @permission ohos.permission.INTERNET * @return - */ function upload(context: BaseContext, config: UploadConfig): Promise; /** - * Starts a upload session. + * Starts a upload task. * @syscap SystemCapability.MiscServices.Upload * @since 9 * @param BaseContext Indicates the application BaseContext. - * @param config upload config + * @param config Upload config * @permission ohos.permission.INTERNET * @return - * @throws {BusinessError} 201 - the permissions check fails -- Gitee