thunkagent
v1.0.2
Published
Yieldable SuperAgent with a thunk() method
Downloads
11
Maintainers
Readme
thunkagent
Yieldable SuperAgent with a thunk() method.
This module is a workaround for SuperAgent's issue #230.
Installation
$ npm install thunkagent --save
Example
var request = require('thunkagent');
var co = require('co');
co(function *(){
var ua = 'Mozilla/1.0';
var response = yield request
.post('http://httpbin.org/post')
.send({lorem: 'ipsum'})
.set('User-Agent', ua)
.thunk();
console.log(response.body);
})();