As you wrote, there’s regularly some debate. That’s why it’s also useful to have an authoritative source of truth to confirm what a server should do if we want to make it follow the standards.
And that’s where RFC 7231 (section 4.3.4) comes in to confirm what you wrote:
If the target resource does not have a current representation and the PUT successfully creates one, then the origin server MUST inform the user agent by sending a 201 (Created) response.
If the target resource does have a current representation and that representation is successfully modified in accordance with the state of the enclosed representation, then the origin server MUST send either a 200 (OK) or a 204 (No Content) response to indicate successful completion of the request.
src: tools.ietf.org/html/rfc7231
Every time such discussion starts in a design doc review or code review, following RFC is very helpful. We need very strong reason and special edge cases to pick non standard behaviors.
As you wrote, there’s regularly some debate. That’s why it’s also useful to have an authoritative source of truth to confirm what a server should do if we want to make it follow the standards.
And that’s where RFC 7231 (section 4.3.4) comes in to confirm what you wrote:
src: tools.ietf.org/html/rfc7231
Every time such discussion starts in a design doc review or code review, following RFC is very helpful. We need very strong reason and special edge cases to pick non standard behaviors.