【问题标题】:How to use AWS S3 REST API ListObjects(v2) with multiple parent/child bucket directories?如何将 AWS S3 REST API ListObjects(v2) 与多个父/子存储桶目录一起使用?
【发布时间】:2021-07-11 21:26:51
【问题描述】:

我在这里错过了什么?

我可以使用aws cli 和这个命令列出对象没有问题:

aws s3 ls s3://bucket.mycompany.com/parent-dir1/parent-dir2/

但是通过 Postman 使用 REST API,等效请求会返回一个空响应。

  • 工具:邮递员
  • 方法: GET
  • 网址:
    • https://bucket.mycompany.com.s3.amazonaws.com/parent-dir1/parent-dir2/?list-type=2
  • 授权:
  • 标题:
    • 我试过没有标题和x-amz-content-sha256 UNSIGNED-PAYLOAD
    • 当我尝试使用此标头时,消息说“这是一个重复的标头,将被覆盖...”
  • 回复:
  • Status 200 但响应为空(parent-dir2 中有很多文件)。

【问题讨论】:

    标签: amazon-web-services rest amazon-s3 postman


    【解决方案1】:

    尤里卡!在 AWS 文档 here

    中找到了答案

    最终获胜者是:

    • https://bucket.mycompany.com.s3.amazonaws.com/?list-type=2&prefix=parent-dir1/parent-dir2/

    【讨论】:

      猜你喜欢
      • 2012-03-28
      • 2018-03-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-02-10
      • 2018-08-16
      • 2020-05-29
      相关资源
      最近更新 更多