Skip to content

Instantly share code, notes, and snippets.

@PharkMillups
Created July 29, 2013 22:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PharkMillups/6108587 to your computer and use it in GitHub Desktop.
Save PharkMillups/6108587 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