AWS Certified Solutions Architect - Professional 2020

Sign Up Free or Log In to participate!

S3 PUTs of new objects (consistency)

In this lesson, Scott talks about a PUT (instead of a POST) for a new object to be stored in S3. Why the REST architecture style/semantic is not being used here? Shouldn’t we use POST for new objects and PUT only for existing objects? Any considerations/recommendations? Is there any real difference in S3 API regarding those verbs? Thanks in advance.

1 Answers

The REST semantic claims that both PUT and POST can be used for creating entities.
The AWS S3 API for adding an object to a bucket says PUT. https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html
There is also a POST API actually for sending a request from a browser. https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPOST.html

França

You are right regarding the REST semantic, thanks for pointing that out, I was wrong. Now I understand that we (should) use PUT on S3 because we’re supplying the key (required) for the new object – a POST would return a 404 in that case. And I got that POST is kind of "syntactic sugar" for browser-based uploads. Thank you so much!

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?