From 972c6b4aaa6ac2845f9e6348ca0ca3fc6b19047b Mon Sep 17 00:00:00 2001 From: anyueling Date: Wed, 14 Dec 2022 10:29:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E6=A1=A3=E5=A4=9A=E4=BD=99=E6=8B=AC?= =?UTF-8?q?=E5=8F=B7=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: anyueling --- .../reference/apis/js-apis-request.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/zh-cn/application-dev/reference/apis/js-apis-request.md b/zh-cn/application-dev/reference/apis/js-apis-request.md index 6ffa652da0..543f0f349c 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-request.md +++ b/zh-cn/application-dev/reference/apis/js-apis-request.md @@ -33,8 +33,9 @@ var config = { 在开发stage模型下的应用程序时,不涉及属性标识 "cleartextTraffic"。 -下载服务器需要支持HTTP协议的head方法,能够通过Content-length获取下载数据大小,否则下载任务失败,可通过[on('fail')7+)](#onfail7)查看失败原因。 +下载服务器需要支持HTTP协议的head方法,能够通过Content-length获取下载数据大小,否则下载任务失败,可通过[on('fail')7+](#onfail7)查看失败原因。 +上传目前仅支持HTTP请求,不支持HTTPS。 ## 常量 @@ -104,7 +105,7 @@ uploadFile(context: BaseContext, config: UploadConfig): Promise<UploadTask> ```js let uploadTask; let uploadConfig = { - url: 'https://patch', + url: 'http://patch', header: { key1: "value1", key2: "value2" }, method: "POST", files: [{ filename: "test", name: "test", uri: "internal://cache/test.jpg", type: "jpg" }], @@ -148,7 +149,7 @@ uploadFile(context: BaseContext, config: UploadConfig, callback: AsyncCallback&l ```js let uploadTask; let uploadConfig = { - url: 'https://patch', + url: 'http://patch', header: { key1: "value1", key2: "value2" }, method: "POST", files: [{ filename: "test", name: "test", uri: "internal://cache/test.jpg", type: "jpg" }], @@ -194,7 +195,7 @@ upload(config: UploadConfig): Promise<UploadTask> ```js let uploadTask; let uploadConfig = { - url: 'https://patch', + url: 'http://patch', header: { key1: "value1", key2: "value2" }, method: "POST", files: [{ filename: "test", name: "test", uri: "internal://cache/test.jpg", type: "jpg" }], @@ -234,7 +235,7 @@ upload(config: UploadConfig, callback: AsyncCallback<UploadTask>): void ```js let uploadTask; let uploadConfig = { - url: 'https://patch', + url: 'http://patch', header: { key1: "value1", key2: "value2" }, method: "POST", files: [{ filename: "test", name: "test", uri: "internal://cache/test.jpg", type: "jpg" }], @@ -280,7 +281,7 @@ upload(context: BaseContext, config: UploadConfig): Promise<UploadTask> ```js let uploadTask; let uploadConfig = { - url: 'https://patch', + url: 'http://patch', header: { key1: "value1", key2: "value2" }, method: "POST", files: [{ filename: "test", name: "test", uri: "internal://cache/test.jpg", type: "jpg" }], @@ -319,7 +320,7 @@ upload(context: BaseContext, config: UploadConfig, callback: AsyncCallback<Up ```js let uploadTask; let uploadConfig = { - url: 'https://patch', + url: 'http://patch', header: { key1: "value1", key2: "value2" }, method: "POST", files: [{ filename: "test", name: "test", uri: "internal://cache/test.jpg", type: "jpg" }], -- GitLab