@baiducloud/sdk
Advanced tools
Changelog
1.0.1-beta.1
published on 2024-01-08
_req.abort()
in Node.js env.Changelog
1.0.1-beta.0
published on 2023-11-29
requestInstance
to manipulate request cancellation.Changelog
1.0.0-rc.42
published on 2023-10-26
Approach 1:
Use the callback parameter, the SDK will help you process the parameter and add it to the request header.
try {
const res = await client.putObjectFromString('bucketName', 'fileName', 'demo-string', {
callback: {
urls: ['https://www.test.com/callback'],
vars: {name: 'baidu'},
encrypt: 'config',
key: 'callback1'
}
});
/* callback result */
console.log(res.body.callback.result);
} catch (e) {
/* callback error code */
console.error(res.body.callback.code);
/* callback error message */
console.error(res.body.callback.message);
}
Approach 2:
Directly pass the "x-bce-process" parameter to headers.
try {
const res = await client.putObjectFromString('bucketName', 'fileName', 'demo-string', {
'x-bce-process': 'callback/callback,u_WyJodHRwczovL3d3dy50ZXN0LmNvbS9jYWxsYmFjayJd,m_sync,v_eyJuYW1lIjoiYmFpZHUifQ'
});
/* callback result */
console.log(res.body.callback.result);
} catch (e) {
/* callback error code */
console.error(res.body.callback.code);
/* callback error message */
console.error(res.body.callback.message);
}
Changelog
1.0.0-rc.41
published on 2023-10-26
Changelog
1.0.0-rc.40
published on 2023-06-19
Changelog
1.0.0-rc.39
published on 2023-06-16
Changelog
1.0.0-rc.38
published on 2023-02-16
Changelog
1.0.0-rc.37
published on 2023-01-09
Changelog
1.0.0-rc.36
published on 2022-05-06