提交 dbcbbd22 编写于 作者: E ester.zhou

update js-apis-request.md

Signed-off-by: Nester.zhou <ester.zhou@huawei.com>
上级 7cb044ad
......@@ -85,7 +85,7 @@ Uploads files. This API uses a promise to return the result.
```js
let file1 = { filename: "test", name: "test", uri: "internal://cache/test.jpg", type: "jpg" };
let data = { name: "name123", value: "123" };
let header = { key1: value1, key2: value2 };
let header = { key1: "value1", key2: "value2" };
let uploadTask;
request.upload({ url: 'https://patch', header: header, method: "POST", files: [file1], data: [data] }).then((data) => {
uploadTask = data;
......@@ -117,7 +117,7 @@ Uploads files. This API uses an asynchronous callback to return the result.
```js
let file1 = { filename: "test", name: "test", uri: "internal://cache/test.jpg", type: "jpg" };
let data = { name: "name123", value: "123" };
let header = { key1: value1, key2: value2 };
let header = { key1: "value1", key2: "value2" };
let uploadTask;
request.upload({ url: 'https://patch', header: header, method: "POST", files: [file1], data: [data] }, (err, data) => {
if (err) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册