Skip to content

Instantly share code, notes, and snippets.

@tylerhannan
Last active December 20, 2015 09:30
Show Gist options
  • Save tylerhannan/6108301 to your computer and use it in GitHub Desktop.
Save tylerhannan/6108301 to your computer and use it in GitHub Desktop.
// Create a new bucket in Riak and enable `allow_mult`
$ curl -i http://localhost:8098/buckets/new_hotness/props \
-X PUT -d '{"props":{"allow_mult":true}}' -H "Content-Type: application/json"
// POST to the `counters` resource. In this example we're adding "1" to the "riak-counters-blog-post-views" counter
$ curl -i http://localhost:8098/buckets/new_hotness/counters/riak-counters-blog-post-views \
-X POST -d "1"
// To read the value of a counter, do a GET on the same object
$ curl -i http://localhost:8098/buckets/new_hotness/counters/riak-counters-blog-post-views
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment