Skip to content
This repository has been archived by the owner on Jul 16, 2020. It is now read-only.

PUT overwrites document content. #50

Open
cxmeel opened this issue Jan 17, 2019 · 1 comment
Open

PUT overwrites document content. #50

cxmeel opened this issue Jan 17, 2019 · 1 comment

Comments

@cxmeel
Copy link

cxmeel commented Jan 17, 2019

Shouldn't PUT requests be for updating key/value pairs within a document, and POST for overwriting/creating a document? PUT behaves the same as POST in this instance.

@jnovack
Copy link

jnovack commented Mar 13, 2019

PUT is idempotent by nature. If you want to use PUT to update a resource, it must be a full resource update; you MUST send all attribute values in a PUT request to guarantee idempotency.

  • POSTting TWICE to /accounts SHOULD create two accounts.

  • PUTting to /accounts SHOULD fail (nothing to update).

  • POSTting TWICE to /accounts/jnovack SHOULD result in 1 account with exactly the same data (perhaps, save for last-modified).

  • PUTting TWICE to /accounts/jnovack SHOULD result in 1 account with exactly the same data (perhaps, save for last-modified).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants