jsonstore icon indicating copy to clipboard operation
jsonstore copied to clipboard

PUT overwrites document content.

Open cxmeel opened this issue 6 years ago • 1 comments

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.

cxmeel avatar Jan 17 '19 00:01 cxmeel

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).

jnovack avatar Mar 13 '19 22:03 jnovack