diff --git a/README.md b/README.md index cebd44a..972b716 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,9 @@ SYNOPSIS port: 8098, }); - // store nyarlathotep in deities as plain text with an 'r' value of 1 - db.store('deities', 'nyarlathotep', "The crawling chaos", { r: 1 }) + // store nyarlathotep in deities as plain text with an 'r' value of 1, and + // return the content again (content is not returned by default) + db.store('deities', 'nyarlathotep', "The crawling chaos", { returnbody: 1, r: 1 }) .addCallback(function (resp, statusCode) { // ... }); diff --git a/lib/riak.js b/lib/riak.js index 40b86d0..d1a41b0 100644 --- a/lib/riak.js +++ b/lib/riak.js @@ -110,7 +110,7 @@ Client.prototype.makeRequest = function(method, url, headers, data) { var request = this.client.request(method, url, headers); var promise = new process.Promise(); - if (data) request.sendBody(data); + if (data) request.write(data); request.addListener('response', function (response) { var body = ""; diff --git a/tests/test_walk.js b/tests/test_walk.js index 8bd2f3e..4ba49ac 100644 --- a/tests/test_walk.js +++ b/tests/test_walk.js @@ -56,11 +56,11 @@ function parseMessage(resp) { var body = message.body; process.nextTick(function s () { if (body) { - message.emit("body", body.substr(0, chunkSize)); + message.emit("data", body.substr(0, chunkSize)); body = body.substr(chunkSize); process.nextTick(s); } else { - message.emit("complete"); + message.emit("end"); } }); }