npm install restc
var client = restc({ port: 1337 },
pluginA,
pluginB,
pluginC
);
client.get('/foo', function (err, req, res, data) {
/* ... */
});
setup
: invoked once when initializing a client to shape the default request optionsbefore
: invoked before issuing a requestafter
: invoked after a response has been received
example
{
setup: function (options, next) { /* ... */ },
before: function (options, next) { /* ... */ },
after: function (req, res, next) { /* ... */ }
}