Kindly confirm if this correct:
How about POST and LIST?
Additional question, is get_bucket_filesize() and get_object_filesize() (from PHP SDK) considered a LIST request?
POST: Takes in data, applies it to the resource identified by the given URI, here the rules you documented for the resource media type are followed. PUT: It will replace whatever is identified by the given URI with this data, and ignore whatever is in there already, if anything.
The PUT request operation is used to add an object to a bucket. The response indicates that the object has been successfully stored. S3 never stores partial objects: if you receive a successful response, then you can be confident that the entire object was stored.
You can use the S3 PUT Object - Copy request to create a copy of an object that is already stored in S3. A PUT copy operation is the same as performing a GET and then a PUT.
The AWS Free Tier, offered to new AWS customers, gives you 5 GB of storage in the AWS S3 Standard storage tier. This includes up to 2000 PUT, POST, COPY or LIST requests, 20,000 GET requests and 15 GB of outgoing data transfer per month for a year.
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 is an alternate form of PUT that enables browser-based uploads as a way of putting objects in buckets
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.
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With