Skip to content

Commit 6db58c1

Browse files
authored
Merge pull request #137 from livehigh/v1.3.5
feat:cos.request支持透传DataType
2 parents 28adb2e + 691c778 commit 6db58c1

File tree

6 files changed

+10
-4
lines changed

6 files changed

+10
-4
lines changed

demo/demo.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,6 +1734,8 @@ function getSnapshot() {
17341734
// mode: 'exactframe', /** 截帧方式,默认为'exactframe',非必须 */
17351735
},
17361736
RawBody: true,
1737+
// 可选返回文件格式为blob
1738+
DataType: 'blob',
17371739
},
17381740
function(err, data){
17391741
logger.log(err || data);

dist/cos-js-sdk-v5.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2485,7 +2485,7 @@ COS.util = {
24852485
json2xml: util.json2xml
24862486
};
24872487
COS.getAuthorization = util.getAuth;
2488-
COS.version = '1.3.4';
2488+
COS.version = '1.3.5';
24892489

24902490
module.exports = COS;
24912491

@@ -7764,7 +7764,8 @@ function request(params, callback) {
77647764
qs: params.Query,
77657765
body: params.Body,
77667766
Url: params.Url,
7767-
rawBody: params.RawBody
7767+
rawBody: params.RawBody,
7768+
DataType: params.DataType
77687769
}, function (err, data) {
77697770
if (err) return callback(err);
77707771
if (data && data.body) {

dist/cos-js-sdk-v5.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1844,6 +1844,8 @@ Bulk:批量模式,恢复时间为24 - 48小时。 */
18441844
Url?: string,
18451845
/** 返回值body是否不需要解析 */
18461846
RawBody?: boolean,
1847+
/** 返回文件内容格式,如string、blob、arraybuffer */
1848+
DataType?: string,
18471849
}
18481850
/** Request 接口返回值 */
18491851
interface RequestResult extends GeneralResult {

src/base.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2890,6 +2890,7 @@ function request(params, callback) {
28902890
body: params.Body,
28912891
Url: params.Url,
28922892
rawBody: params.RawBody,
2893+
DataType: params.DataType,
28932894
}, function (err, data) {
28942895
if (err) return callback(err);
28952896
if (data && data.body) {

src/cos.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,6 @@ COS.util = {
7777
json2xml: util.json2xml,
7878
};
7979
COS.getAuthorization = util.getAuth;
80-
COS.version = '1.3.4';
80+
COS.version = '1.3.5';
8181

8282
module.exports = COS;

0 commit comments

Comments
 (0)