diff --git a/Documentation/v2/api.md b/Documentation/v2/api.md index 7a3198528..b808a48f2 100644 --- a/Documentation/v2/api.md +++ b/Documentation/v2/api.md @@ -559,6 +559,25 @@ Let's create a key-value pair first: `foo=one`. curl http://127.0.0.1:2379/v2/keys/foo -XPUT -d value=one ``` +```json +{ + "action":"set", + "node":{ + "key":"/foo", + "value":"one", + "modifiedIndex":4, + "createdIndex":4 + } +} +``` + +Specifying `noValueOnSuccess` option skips returning the node as value. + +```sh +curl http://127.0.0.1:2379/v2/keys/foo?noValueOnSuccess=true -XPUT -d value=one +# {"action":"set"} +``` + Now let's try some invalid `CompareAndSwap` commands. Trying to set this existing key with `prevExist=false` fails as expected: