提交 42c545c4 编写于 作者: A anyueling

request示例代码自动化检测问题修复

Signed-off-by: Nanyueling <anyueling@huawei.com>
上级 1f1c76d4
...@@ -18,14 +18,16 @@ import request from '@ohos.request'; ...@@ -18,14 +18,16 @@ import request from '@ohos.request';
默认支持https,如果要支持http,需要在config.json里增加network标签,属性标识 "cleartextTraffic": true。即: 默认支持https,如果要支持http,需要在config.json里增加network标签,属性标识 "cleartextTraffic": true。即:
``` ```
var config = {
"deviceConfig": { "deviceConfig": {
"default": { "default": {
"network": { "network": {
"cleartextTraffic": true "cleartextTraffic":true
} }
... //...
} }
} }
}
``` ```
...@@ -470,7 +472,6 @@ on(type: 'progress', callback:(receivedSize: number, totalSize: number) =&gt; vo ...@@ -470,7 +472,6 @@ on(type: 'progress', callback:(receivedSize: number, totalSize: number) =&gt; vo
console.info("download receivedSize:" + receivedSize + " totalSize:" + totalSize); console.info("download receivedSize:" + receivedSize + " totalSize:" + totalSize);
} }
); );
});
``` ```
...@@ -505,7 +506,6 @@ off(type: 'progress', callback?: (receivedSize: number, totalSize: number) =&gt; ...@@ -505,7 +506,6 @@ off(type: 'progress', callback?: (receivedSize: number, totalSize: number) =&gt;
console.info("download receivedSize:" + receivedSize + " totalSize:" + totalSize); console.info("download receivedSize:" + receivedSize + " totalSize:" + totalSize);
} }
); );
});
``` ```
...@@ -533,7 +533,6 @@ on(type: 'complete'|'pause'|'remove', callback:() =&gt; void): void ...@@ -533,7 +533,6 @@ on(type: 'complete'|'pause'|'remove', callback:() =&gt; void): void
console.info('Download task completed.'); console.info('Download task completed.');
} }
); );
});
``` ```
...@@ -561,7 +560,6 @@ off(type: 'complete'|'pause'|'remove', callback?:() =&gt; void): void ...@@ -561,7 +560,6 @@ off(type: 'complete'|'pause'|'remove', callback?:() =&gt; void): void
console.info('Download task completed.'); console.info('Download task completed.');
} }
); );
});
``` ```
...@@ -595,7 +593,6 @@ on(type: 'fail', callback: (err: number) =&gt; void): void ...@@ -595,7 +593,6 @@ on(type: 'fail', callback: (err: number) =&gt; void): void
console.info('Download task failed. Cause:' + err); console.info('Download task failed. Cause:' + err);
} }
); );
});
``` ```
...@@ -629,7 +626,6 @@ off(type: 'fail', callback?: (err: number) =&gt; void): void ...@@ -629,7 +626,6 @@ off(type: 'fail', callback?: (err: number) =&gt; void): void
console.info('Download task failed. Cause:' + err); console.info('Download task failed. Cause:' + err);
} }
); );
});
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册