make-json-request
v1.0.2
Published
Wrapper around the request module that defaults to JSON and uses request-callback-wrapper
Downloads
455
Readme
make-json-request
Wrapper around the request module that defaults to JSON and uses request-callback-wrapper
Why
Because I am sick of typing the same crap over and over again...
Usage
Prety much the same as basic usage of request except callback takes (error, result)
makeJsonRequest(url, callback)
or
makeJsonRequest(options, callback)
var makeJsonRequest = require('make-json-request');
makeJsonRequest('http://foo.com', function(error, result){
});
makeJsonRequest(
{
url: 'http://foo.com',
method: 'POST'
},
function(error, result){
}
);