未验证 提交 65bbcaa6 编写于 作者: O openharmony_ci 提交者: Gitee

!16617 翻译完成 16328:上传下载资料修改

Merge pull request !16617 from ester.zhou/TR-16328
...@@ -16,24 +16,6 @@ import request from '@ohos.request'; ...@@ -16,24 +16,6 @@ import request from '@ohos.request';
## Constraints ## Constraints
HTTPS is supported by default in the FA model. To support HTTP, add **network** to the **config.json** file and set the **cleartextTraffic** attribute to **true**.
```js
var config = {
"deviceConfig": {
"default": {
"network": {
"cleartextTraffic": true
}
//...
}
}
}
```
The **cleartextTraffic** attribute is not involved during application development in the stage model.
The download server must support the HTTP HEAD method so that the size of the data to download can be obtained through **Content-length**. Otherwise, the download task fails. If this is the case, you can check the failure cause through [on('fail')<sup>7+</sup>](#onfail7). The download server must support the HTTP HEAD method so that the size of the data to download can be obtained through **Content-length**. Otherwise, the download task fails. If this is the case, you can check the failure cause through [on('fail')<sup>7+</sup>](#onfail7).
Only HTTP requests are supported. HTTPS requests are not supported. Only HTTP requests are supported. HTTPS requests are not supported.
...@@ -105,24 +87,24 @@ Uploads files. This API uses a promise to return the result. ...@@ -105,24 +87,24 @@ Uploads files. This API uses a promise to return the result.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| context | [BaseContext](js-apis-inner-application-baseContext.md) | Yes| Application-based context.| | context | [BaseContext](js-apis-inner-application-baseContext.md) | Yes| Application-based context.|
| config | [UploadConfig](#uploadconfig) | Yes| Upload configurations.| | config | [UploadConfig](#uploadconfig) | Yes| Upload configurations.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;[UploadTask](#uploadtask)&gt; | Promise used to return the **UploadTask** object.| | Promise&lt;[UploadTask](#uploadtask)&gt; | Promise used to return the **UploadTask** object.|
**Error codes** **Error codes**
For details about the error codes, see [Upload and Download Error Codes](../errorcodes/errorcode-request.md). For details about the error codes, see [Upload and Download Error Codes](../errorcodes/errorcode-request.md).
| ID| Error Message| | ID| Error Message|
| -------- | -------- | | -------- | -------- |
| 13400002 | Bad file path. | | 13400002 | Bad file path. |
**Example** **Example**
...@@ -159,18 +141,18 @@ Uploads files. This API uses an asynchronous callback to return the result. ...@@ -159,18 +141,18 @@ Uploads files. This API uses an asynchronous callback to return the result.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| context | [BaseContext](js-apis-inner-application-baseContext.md) | Yes| Application-based context.| | context | [BaseContext](js-apis-inner-application-baseContext.md) | Yes| Application-based context.|
| config | [UploadConfig](#uploadconfig) | Yes| Upload configurations.| | config | [UploadConfig](#uploadconfig) | Yes| Upload configurations.|
| callback | AsyncCallback&lt;[UploadTask](#uploadtask)&gt; | Yes| Callback used to return the **UploadTask** object.| | callback | AsyncCallback&lt;[UploadTask](#uploadtask)&gt; | Yes| Callback used to return the **UploadTask** object.|
**Error codes** **Error codes**
For details about the error codes, see [Upload and Download Error Codes](../errorcodes/errorcode-request.md). For details about the error codes, see [Upload and Download Error Codes](../errorcodes/errorcode-request.md).
| ID| Error Message| | ID| Error Message|
| -------- | -------- | | -------- | -------- |
| 13400002 | Bad file path. | | 13400002 | Bad file path. |
**Example** **Example**
...@@ -214,15 +196,15 @@ Uploads files. This API uses a promise to return the result. ...@@ -214,15 +196,15 @@ Uploads files. This API uses a promise to return the result.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| config | [UploadConfig](#uploadconfig) | Yes| Upload configurations.| | config | [UploadConfig](#uploadconfig) | Yes| Upload configurations.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;[UploadTask](#uploadtask)&gt; | Promise used to return the **UploadTask** object.| | Promise&lt;[UploadTask](#uploadtask)&gt; | Promise used to return the **UploadTask** object.|
**Example** **Example**
...@@ -261,10 +243,10 @@ Uploads files. This API uses an asynchronous callback to return the result. ...@@ -261,10 +243,10 @@ Uploads files. This API uses an asynchronous callback to return the result.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| config | [UploadConfig](#uploadconfig) | Yes| Upload configurations.| | config | [UploadConfig](#uploadconfig) | Yes| Upload configurations.|
| callback | AsyncCallback&lt;[UploadTask](#uploadtask)&gt; | Yes| Callback used to return the **UploadTask** object.| | callback | AsyncCallback&lt;[UploadTask](#uploadtask)&gt; | Yes| Callback used to return the **UploadTask** object.|
**Example** **Example**
...@@ -304,10 +286,10 @@ Subscribes to an upload event. This API uses an asynchronous callback to return ...@@ -304,10 +286,10 @@ Subscribes to an upload event. This API uses an asynchronous callback to return
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| type | string | Yes| Type of the event to subscribe to. The value is **'progress'** (upload progress).| | type | string | Yes| Type of the event to subscribe to. The value is **'progress'** (upload progress).|
| callback | function | Yes| Callback for the upload progress event.| | callback | function | Yes| Callback for the upload progress event.|
Parameters of the callback function Parameters of the callback function
...@@ -338,10 +320,10 @@ Subscribes to an upload event. This API uses an asynchronous callback to return ...@@ -338,10 +320,10 @@ Subscribes to an upload event. This API uses an asynchronous callback to return
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| type | string | Yes| Type of the event to subscribe to. The value is **'headerReceive'** (response header).| | type | string | Yes| Type of the event to subscribe to. The value is **'headerReceive'** (response header).|
| callback | function | Yes| Callback for the HTTP Response Header event.| | callback | function | Yes| Callback for the HTTP Response Header event.|
Parameters of the callback function Parameters of the callback function
...@@ -371,10 +353,10 @@ Subscribes to an upload event. This API uses an asynchronous callback to return ...@@ -371,10 +353,10 @@ Subscribes to an upload event. This API uses an asynchronous callback to return
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| type | string | Yes| Type of the event to subscribe to. The value **'complete'** means the upload completion event, and **'fail'** means the upload failure event.| | type | string | Yes| Type of the event to subscribe to. The value **'complete'** means the upload completion event, and **'fail'** means the upload failure event.|
| callback | Callback&lt;Array&lt;TaskState&gt;&gt; | Yes| Callback used to return the result.| | callback | Callback&lt;Array&lt;TaskState&gt;&gt; | Yes| Callback used to return the result.|
Parameters of the callback function Parameters of the callback function
...@@ -413,10 +395,10 @@ Unsubscribes from an upload event. This API uses an asynchronous callback to ret ...@@ -413,10 +395,10 @@ Unsubscribes from an upload event. This API uses an asynchronous callback to ret
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| type | string | Yes| Type of the event to unsubscribe from. The value is **'progress'** (upload progress).| | type | string | Yes| Type of the event to unsubscribe from. The value is **'progress'** (upload progress).|
| callback | function | No| Callback for the upload progress event.| | callback | function | No| Callback for the upload progress event.|
Parameters of the callback function Parameters of the callback function
...@@ -447,10 +429,10 @@ Unsubscribes from an upload event. This API uses an asynchronous callback to ret ...@@ -447,10 +429,10 @@ Unsubscribes from an upload event. This API uses an asynchronous callback to ret
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| type | string | Yes| Type of the event to unsubscribe from. The value is **'headerReceive'** (response header).| | type | string | Yes| Type of the event to unsubscribe from. The value is **'headerReceive'** (response header).|
| callback | function | No| Callback for the HTTP Response Header event.| | callback | function | No| Callback for the HTTP Response Header event.|
Parameters of the callback function Parameters of the callback function
...@@ -479,10 +461,10 @@ Unsubscribes from an upload event. This API uses an asynchronous callback to ret ...@@ -479,10 +461,10 @@ Unsubscribes from an upload event. This API uses an asynchronous callback to ret
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| type | string | Yes| Type of the event to subscribe to. The value **'complete'** means the upload completion event, and **'fail'** means the upload failure event.| | type | string | Yes| Type of the event to subscribe to. The value **'complete'** means the upload completion event, and **'fail'** means the upload failure event.|
| callback | Callback&lt;Array&lt;TaskState&gt;&gt; | No| Callback used to return the result.| | callback | Callback&lt;Array&lt;TaskState&gt;&gt; | No| Callback used to return the result.|
Parameters of the callback function Parameters of the callback function
...@@ -519,9 +501,9 @@ Deletes this upload task. This API uses a promise to return the result. ...@@ -519,9 +501,9 @@ Deletes this upload task. This API uses a promise to return the result.
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;boolean&gt; | Promise used to return the task removal result. It returns **true** if the operation is successful and returns **false** otherwise.| | Promise&lt;boolean&gt; | Promise used to return the task removal result. It returns **true** if the operation is successful and returns **false** otherwise.|
**Example** **Example**
...@@ -550,9 +532,9 @@ Deletes this upload task. This API uses an asynchronous callback to return the r ...@@ -550,9 +532,9 @@ Deletes this upload task. This API uses an asynchronous callback to return the r
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;boolean&gt; | Yes| Callback used to return the result.| | callback | AsyncCallback&lt;boolean&gt; | Yes| Callback used to return the result.|
**Example** **Example**
...@@ -587,9 +569,9 @@ Removes this upload task. This API uses a promise to return the result. ...@@ -587,9 +569,9 @@ Removes this upload task. This API uses a promise to return the result.
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;boolean&gt; | Promise used to return the task removal result. It returns **true** if the operation is successful and returns **false** otherwise.| | Promise&lt;boolean&gt; | Promise used to return the task removal result. It returns **true** if the operation is successful and returns **false** otherwise.|
**Example** **Example**
...@@ -622,9 +604,9 @@ Removes this upload task. This API uses an asynchronous callback to return the r ...@@ -622,9 +604,9 @@ Removes this upload task. This API uses an asynchronous callback to return the r
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;boolean&gt; | Yes| Callback used to return the result.| | callback | AsyncCallback&lt;boolean&gt; | Yes| Callback used to return the result.|
**Example** **Example**
...@@ -705,25 +687,25 @@ Downloads files. This API uses a promise to return the result. ...@@ -705,25 +687,25 @@ Downloads files. This API uses a promise to return the result.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| context | [BaseContext](js-apis-inner-application-baseContext.md) | Yes| Application-based context.| | context | [BaseContext](js-apis-inner-application-baseContext.md) | Yes| Application-based context.|
| config | [DownloadConfig](#downloadconfig) | Yes| Download configurations.| | config | [DownloadConfig](#downloadconfig) | Yes| Download configurations.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;[DownloadTask](#downloadtask)&gt; | Promise used to return the result.| | Promise&lt;[DownloadTask](#downloadtask)&gt; | Promise used to return the result.|
**Error codes** **Error codes**
For details about the error codes, see [Upload and Download Error Codes](../errorcodes/errorcode-request.md). For details about the error codes, see [Upload and Download Error Codes](../errorcodes/errorcode-request.md).
| ID| Error Message| | ID| Error Message|
| -------- | -------- | | -------- | -------- |
| 13400001 | File operation error. | | 13400001 | File operation error. |
| 13400002 | Bad file path. | | 13400002 | Bad file path. |
| 13400003 | Task manager service error. | | 13400003 | Task manager service error. |
**Example** **Example**
...@@ -753,20 +735,20 @@ Downloads files. This API uses an asynchronous callback to return the result. ...@@ -753,20 +735,20 @@ Downloads files. This API uses an asynchronous callback to return the result.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| context | [BaseContext](js-apis-inner-application-baseContext.md) | Yes| Application-based context.| | context | [BaseContext](js-apis-inner-application-baseContext.md) | Yes| Application-based context.|
| config | [DownloadConfig](#downloadconfig) | Yes| Download configurations.| | config | [DownloadConfig](#downloadconfig) | Yes| Download configurations.|
| callback | AsyncCallback&lt;[DownloadTask](#downloadtask)&gt; | Yes| Callback used to return the result.| | callback | AsyncCallback&lt;[DownloadTask](#downloadtask)&gt; | Yes| Callback used to return the result.|
**Error codes** **Error codes**
For details about the error codes, see [Upload and Download Error Codes](../errorcodes/errorcode-request.md). For details about the error codes, see [Upload and Download Error Codes](../errorcodes/errorcode-request.md).
| ID| Error Message| | ID| Error Message|
| -------- | -------- | | -------- | -------- |
| 13400001 | File operation error. | | 13400001 | File operation error. |
| 13400002 | Bad file path. | | 13400002 | Bad file path. |
| 13400003 | Task manager service error. | | 13400003 | Task manager service error. |
**Example** **Example**
...@@ -804,15 +786,15 @@ Downloads files. This API uses a promise to return the result. ...@@ -804,15 +786,15 @@ Downloads files. This API uses a promise to return the result.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| config | [DownloadConfig](#downloadconfig) | Yes| Download configurations.| | config | [DownloadConfig](#downloadconfig) | Yes| Download configurations.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;[DownloadTask](#downloadtask)&gt; | Promise used to return the result.| | Promise&lt;[DownloadTask](#downloadtask)&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -844,10 +826,10 @@ Downloads files. This API uses an asynchronous callback to return the result. ...@@ -844,10 +826,10 @@ Downloads files. This API uses an asynchronous callback to return the result.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| config | [DownloadConfig](#downloadconfig) | Yes| Download configurations.| | config | [DownloadConfig](#downloadconfig) | Yes| Download configurations.|
| callback | AsyncCallback&lt;[DownloadTask](#downloadtask)&gt; | Yes| Callback used to return the result.| | callback | AsyncCallback&lt;[DownloadTask](#downloadtask)&gt; | Yes| Callback used to return the result.|
**Example** **Example**
...@@ -880,10 +862,10 @@ Subscribes to a download event. This API uses an asynchronous callback to return ...@@ -880,10 +862,10 @@ Subscribes to a download event. This API uses an asynchronous callback to return
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| type | string | Yes| Type of the event to subscribe to. The value is **'progress'** (download progress).| | type | string | Yes| Type of the event to subscribe to. The value is **'progress'** (download progress).|
| callback | function | Yes| Callback for the download progress event.| | callback | function | Yes| Callback for the download progress event.|
Parameters of the callback function Parameters of the callback function
...@@ -914,10 +896,10 @@ Unsubscribes from a download event. This API uses an asynchronous callback to re ...@@ -914,10 +896,10 @@ Unsubscribes from a download event. This API uses an asynchronous callback to re
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| type | string | Yes| Type of the event to unsubscribe from. The value is **'progress'** (download progress).| | type | string | Yes| Type of the event to unsubscribe from. The value is **'progress'** (download progress).|
| callback | function | No| Callback for the download progress event.| | callback | function | No| Callback for the download progress event.|
Parameters of the callback function Parameters of the callback function
...@@ -948,10 +930,10 @@ Subscribes to a download event. This API uses an asynchronous callback to return ...@@ -948,10 +930,10 @@ Subscribes to a download event. This API uses an asynchronous callback to return
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| type | string | Yes| Type of the event to subscribe to.<br>- **'complete'**: download task completion event.<br>- **'pause'**: download task pause event.<br>- **'remove'**: download task removal event.| | type | string | Yes| Type of the event to subscribe to.<br>- **'complete'**: download task completion event.<br>- **'pause'**: download task pause event.<br>- **'remove'**: download task removal event.|
| callback | function | Yes| Callback used to return the result.| | callback | function | Yes| Callback used to return the result.|
**Example** **Example**
...@@ -975,10 +957,10 @@ Unsubscribes from a download event. This API uses an asynchronous callback to re ...@@ -975,10 +957,10 @@ Unsubscribes from a download event. This API uses an asynchronous callback to re
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| type | string | Yes| Type of the event to unsubscribe from.<br>- **'complete'**: download task completion event.<br>- **'pause'**: download task pause event.<br>- **'remove'**: download task removal event.| | type | string | Yes| Type of the event to unsubscribe from.<br>- **'complete'**: download task completion event.<br>- **'pause'**: download task pause event.<br>- **'remove'**: download task removal event.|
| callback | function | No| Callback used to return the result.| | callback | function | No| Callback used to return the result.|
**Example** **Example**
...@@ -1002,10 +984,10 @@ Subscribes to the download task failure event. This API uses an asynchronous cal ...@@ -1002,10 +984,10 @@ Subscribes to the download task failure event. This API uses an asynchronous cal
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| type | string | Yes| Type of the event to subscribe to. The value is **'fail'** (download failure).| | type | string | Yes| Type of the event to subscribe to. The value is **'fail'** (download failure).|
| callback | function | Yes| Callback for the download task failure event.| | callback | function | Yes| Callback for the download task failure event.|
Parameters of the callback function Parameters of the callback function
...@@ -1035,10 +1017,10 @@ Unsubscribes from the download task failure event. This API uses an asynchronous ...@@ -1035,10 +1017,10 @@ Unsubscribes from the download task failure event. This API uses an asynchronous
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| type | string | Yes| Type of the event to unsubscribe from. The value is **'fail'** (download failure).| | type | string | Yes| Type of the event to unsubscribe from. The value is **'fail'** (download failure).|
| callback | function | No| Callback for the download task failure event.| | callback | function | No| Callback for the download task failure event.|
Parameters of the callback function Parameters of the callback function
...@@ -1067,9 +1049,9 @@ Removes this download task. This API uses a promise to return the result. ...@@ -1067,9 +1049,9 @@ Removes this download task. This API uses a promise to return the result.
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;boolean&gt; | Promise used to return the task removal result.| | Promise&lt;boolean&gt; | Promise used to return the task removal result.|
**Example** **Example**
...@@ -1098,9 +1080,9 @@ Deletes this download task. This API uses an asynchronous callback to return the ...@@ -1098,9 +1080,9 @@ Deletes this download task. This API uses an asynchronous callback to return the
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;boolean&gt; | Yes| Callback used to return the task deletion result.| | callback | AsyncCallback&lt;boolean&gt; | Yes| Callback used to return the task deletion result.|
**Example** **Example**
...@@ -1131,9 +1113,9 @@ Obtains the information about this download task. This API uses a promise to ret ...@@ -1131,9 +1113,9 @@ Obtains the information about this download task. This API uses a promise to ret
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;[DownloadInfo](#downloadinfo7)&gt; | Promise used to return the download task information.| | Promise&lt;[DownloadInfo](#downloadinfo7)&gt; | Promise used to return the download task information.|
**Example** **Example**
...@@ -1158,9 +1140,9 @@ Obtains the information about this download task. This API uses an asynchronous ...@@ -1158,9 +1140,9 @@ Obtains the information about this download task. This API uses an asynchronous
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;[DownloadInfo](#downloadinfo7)&gt; | Yes| Callback used to return the download task information.| | callback | AsyncCallback&lt;[DownloadInfo](#downloadinfo7)&gt; | Yes| Callback used to return the download task information.|
**Example** **Example**
...@@ -1187,9 +1169,9 @@ Obtains the **MimeType** of this download task. This API uses a promise to retur ...@@ -1187,9 +1169,9 @@ Obtains the **MimeType** of this download task. This API uses a promise to retur
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;string&gt; | Promise used to return the **MimeType** of the download task.| | Promise&lt;string&gt; | Promise used to return the **MimeType** of the download task.|
**Example** **Example**
...@@ -1214,9 +1196,9 @@ Obtains the **MimeType** of this download task. This API uses an asynchronous ca ...@@ -1214,9 +1196,9 @@ Obtains the **MimeType** of this download task. This API uses an asynchronous ca
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;string&gt; | Yes| Callback used to return the **MimeType** of the download task.| | callback | AsyncCallback&lt;string&gt; | Yes| Callback used to return the **MimeType** of the download task.|
**Example** **Example**
...@@ -1243,9 +1225,9 @@ Pauses this download task. This API uses a promise to return the result. ...@@ -1243,9 +1225,9 @@ Pauses this download task. This API uses a promise to return the result.
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;boolean&gt; | Promise used to return the download task pause result.| | Promise&lt;boolean&gt; | Promise used to return the download task pause result.|
**Example** **Example**
...@@ -1274,9 +1256,9 @@ Pauses this download task. This API uses an asynchronous callback to return the ...@@ -1274,9 +1256,9 @@ Pauses this download task. This API uses an asynchronous callback to return the
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;boolean&gt; | Yes| Callback used to return the result.| | callback | AsyncCallback&lt;boolean&gt; | Yes| Callback used to return the result.|
**Example** **Example**
...@@ -1307,9 +1289,9 @@ Resumes this download task. This API uses a promise to return the result. ...@@ -1307,9 +1289,9 @@ Resumes this download task. This API uses a promise to return the result.
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;boolean&gt; | Promise used to return the result.| | Promise&lt;boolean&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -1339,9 +1321,9 @@ Resumes this download task. This API uses an asynchronous callback to return the ...@@ -1339,9 +1321,9 @@ Resumes this download task. This API uses an asynchronous callback to return the
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;boolean&gt; | Yes| Callback used to return the result.| | callback | AsyncCallback&lt;boolean&gt; | Yes| Callback used to return the result.|
**Example** **Example**
...@@ -1377,9 +1359,9 @@ Removes this download task. This API uses a promise to return the result. ...@@ -1377,9 +1359,9 @@ Removes this download task. This API uses a promise to return the result.
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;boolean&gt; | Promise used to return the task removal result.| | Promise&lt;boolean&gt; | Promise used to return the task removal result.|
**Example** **Example**
...@@ -1412,9 +1394,9 @@ Removes this download task. This API uses an asynchronous callback to return the ...@@ -1412,9 +1394,9 @@ Removes this download task. This API uses an asynchronous callback to return the
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;boolean&gt; | Yes| Callback used to return the task removal result.| | callback | AsyncCallback&lt;boolean&gt; | Yes| Callback used to return the task removal result.|
**Example** **Example**
...@@ -1449,9 +1431,9 @@ Queries this download task. This API uses a promise to return the result. ...@@ -1449,9 +1431,9 @@ Queries this download task. This API uses a promise to return the result.
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;[DownloadInfo](#downloadinfo7)&gt; | Promise used to return the download task information.| | Promise&lt;[DownloadInfo](#downloadinfo7)&gt; | Promise used to return the download task information.|
**Example** **Example**
...@@ -1480,9 +1462,9 @@ Queries this download task. This API uses an asynchronous callback to return the ...@@ -1480,9 +1462,9 @@ Queries this download task. This API uses an asynchronous callback to return the
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;[DownloadInfo](#downloadinfo7)&gt; | Yes| Callback used to return the download task information.| | callback | AsyncCallback&lt;[DownloadInfo](#downloadinfo7)&gt; | Yes| Callback used to return the download task information.|
**Example** **Example**
...@@ -1513,9 +1495,9 @@ Queries the **MimeType** of this download task. This API uses a promise to retur ...@@ -1513,9 +1495,9 @@ Queries the **MimeType** of this download task. This API uses a promise to retur
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;string&gt; | Promise used to return the **MimeType** of the download task.| | Promise&lt;string&gt; | Promise used to return the **MimeType** of the download task.|
**Example** **Example**
...@@ -1544,9 +1526,9 @@ Queries the **MimeType** of this download task. This API uses an asynchronous ca ...@@ -1544,9 +1526,9 @@ Queries the **MimeType** of this download task. This API uses an asynchronous ca
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;string&gt; | Yes| Callback used to return the **MimeType** of the download task.| | callback | AsyncCallback&lt;string&gt; | Yes| Callback used to return the **MimeType** of the download task.|
**Example** **Example**
...@@ -1577,9 +1559,9 @@ Pauses this download task. This API uses a promise to return the result. ...@@ -1577,9 +1559,9 @@ Pauses this download task. This API uses a promise to return the result.
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;void&gt; | Promise used to return the download task pause result.| | Promise&lt;void&gt; | Promise used to return the download task pause result.|
**Example** **Example**
...@@ -1612,9 +1594,9 @@ Pauses this download task. This API uses an asynchronous callback to return the ...@@ -1612,9 +1594,9 @@ Pauses this download task. This API uses an asynchronous callback to return the
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result.| | callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result.|
**Example** **Example**
...@@ -1649,9 +1631,9 @@ Resumes this download task. This API uses a promise to return the result. ...@@ -1649,9 +1631,9 @@ Resumes this download task. This API uses a promise to return the result.
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -1685,9 +1667,9 @@ Resumes this download task. This API uses an asynchronous callback to return the ...@@ -1685,9 +1667,9 @@ Resumes this download task. This API uses an asynchronous callback to return the
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result.| | callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result.|
**Example** **Example**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册