basho / riak_dt

Convergent replicated datatypes in Erlang
Apache License 2.0
353 stars 70 forks source link

Fix semantics of counters resource #39

Closed seancribbs closed 12 years ago

seancribbs commented 12 years ago

The current counters increment and decrement like so:

POST /counters/a/increment
POST /counters/a/decrement

This is a bad practice as it puts the verb in the URL. It would be better to use form parameters or JSON to submit the "change". curl examples:

curl http://riakhost:8098/counters/a -F increment=5
curl http://riakhost:8098/counters/a -F decrement=2
curl http://riakhost:8098/counters/a -d '{"increment":5}' -H "Content-Type: application/json"
russelldb commented 12 years ago

Is it possible that the README could be updated to reflect this change, too, please?

seancribbs commented 12 years ago

Will do.

Sean Cribbs

On Oct 11, 2012, at 9:48 AM, Russell Brown notifications@github.com wrote:

Is it possible that the README could be updated to reflect this change, too, please?

— Reply to this email directly or view it on GitHub.

seancribbs commented 12 years ago

@russelldb Fixed the examples. Travis build is failing, but could you run the WM tests locally?

russelldb commented 12 years ago

Hmm, test times out for me locally. Will dig a little.

seancribbs commented 12 years ago

@russelldb This may be similar to the timeouts I would occasionally see testing riak_api. I'll find out what I did there and possibly include an additional wait.

seancribbs commented 12 years ago

@russelldb I found the culprit, the vnode test wasn't calling meck:unload() at the end of a test with mocks installed. This broke the vnode, making it impossible to send a request to any of them. Now it works and plows through the tests quickly.

russelldb commented 12 years ago

Works for me. Many thanks +1.