Amazon S3:什么是PUT/COPY/POST/LIST请求? [英] Amazon S3: What are considered PUT/COPY/POST/LIST request?

查看:584
本文介绍了Amazon S3:什么是PUT/COPY/POST/LIST请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请确认是否正确:

  • PUT 可能正在将文件上传到S3?
  • COPY 可能正在S3中复制文件?
  • PUT is probably uploading files to S3?
  • COPY is probably copying files within S3?

POST LIST 如何?

其他问题,是否将get_bucket_filesize()和get_object_filesize()(来自PHP SDK)视为LIST请求?

Additional question, is get_bucket_filesize() and get_object_filesize() (from PHP SDK) considered a LIST request?

推荐答案

根据我使用S3的经验(以及HTTP协议和REST的基础知识),POST是一个新对象的创建(在S3中,它将是(上传新文件),而PUT是创建新对象或更新现有对象(即创建或更新文件).此外,来自S3文档:

From my experience using S3 (and also from the basics of HTTP protocol and REST), POST is the creation of a new object (in S3, it would be the upload of a new file), and PUT is a creation of a new object or update of an existing object (i.e., creation or update of a file). Additionally, from S3 docs:

POST是PUT的另一种形式,它使基于浏览器的上传成为 一种将对象放入桶中的方法

POST is an alternate form of PUT that enables browser-based uploads as a way of putting objects in buckets

例如,每次获取给定S3存储桶的内容时,您都会遇到LIST操作.您没有要求,但是GET是从S3下载文件,而DELETE显然是删除文件.当然,这些假设取决于您使用的是哪个SDK(似乎您使用的是PHP)及其底层实现.我的观点是,可以使用GET实现下载,使用PUT或POST实现上传,等等.

Every time you, for example, get the contents of a given S3 bucket, you're running into a LIST operation. You have not asked, but a GET is the download of a file from S3 and DELETE would obviously be the deletion of a file. Of course these assumptions depend on which SDK you are using (it seems you're using the PHP one) and its underlying implementation. My argument is that it is possible to implement a download using a GET, an upload using a PUT or a POST, and so forth.

尽管 S3 REST API 假设get_bucket_filesize()被实现为LIST(存储桶上的GET操作带来了响应中每个对象的大小以及更多数据),而get_object_filesize()被实现为GET(在单个对象上使用HEAD操作)文件也将其大小包含在元数据中.)

Taking a look into S3 REST API, though, I assume get_bucket_filesize() is implemented as a LIST (a GET operation on a bucket brings, along with some more data, the size of each object in the response) and get_object_filesize() is implemented as a GET (using the HEAD operation on a single file also brings its size included in the metadata).

这篇关于Amazon S3:什么是PUT/COPY/POST/LIST请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆