- 最新
- 最多得票
- 最多評論
The SDK parses the raw XML responses from the S3 API and converts them into JavaScript objects before returning them to the user.
https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-select.html
But you can directly query S3 API
https://docs.aws.amazon.com/AmazonS3/latest/API/API_SelectObjectContent.html
You can use axios library to do this.
For AWS SDK for JavaScript v2, you can access the raw response via the response field on the request object. Note that response field on the request object will not be set until after the request has been completed, thus the need to await in the example below before accessing.
const listBucketsRequest = S3.listBuckets({});
const listBucketsResponse = await listBucketsRequest.promise()
console.log(listBucketsRequest.response.httpResponse.body.toString());
If AWS SDK for JavaScript v3 does not expose a similar set of objects. Access to the raw response would be done at the middleware level:
相關內容
- 已提問 6 個月前
- AWS 官方已更新 2 年前