Used to check for browser translation.
用于检测浏览器翻译。
ブラウザの翻訳を検出する

GetObjectCommand


GetObjectCommand can help developers get object data on the DID Space.

Parameter Type#

Parameter name

Type

necessary

default value

Explanation

key

string

Y

None

It can be a file name or a folder

Return Type#

Parameter Name

Type

Necessary

Explanation

statusCode

number

Y

Return status code

statusMessage

string

N

Errors should only have values when they occur

stack

string

N

Stack Information

data

易读

Y

Data of the acquired object

headers

AxiosResponseHeaders

Y

Response headers

Example code#

  • Read object data
const { SpaceClient, GetObjectCommand } = require('@blocklet/did-space-js');
const getWallet = require('@blocklet/sdk/lib/wallet');

const spaceClient = new SpaceClient({
endpoint,
wallet: getWallet(),
});

const { data } = await spaceClient.send(
new GetObjectCommand({
key: 'hello world!',
})
);

console.log(await streamToString(data));







你获得 0 积分