lib/rest-client.js
function makeRequest(options, callback) {
    request(options, function (error, response, body){
        if (error) {
            callback(error, null);
        }
        else if (response.statusCode == 200) {
            callback( null, JSON.parse(body));
        }
        else {
            callback(new Error('HTTP Response Code: ' + response.statusCode), null);
        }
    });
}
function makeRequest(options, callback) {
    request(options, function (error, response, body){
        if (error) {
            callback(error, null);
        }
        else if (response.statusCode == 200) {
            callback( null, JSON.parse(body));
        }
        else {
            callback(new Error('HTTP Response Code: ' + response.statusCode), null);
        }
    });
}
function makeRequest ( options , callback ) { request ( options , function ( error , response , body ) { if ( error ) { callback ( error , null ) ; } else if ( response . statusCode == 200 ) { callback ( null , JSON . parse ( body ) ) ; } else { callback ( new Error ( 'HTTP Response Code: ' + response . statusCode ) , null ) ; } } ) ; }
Private method to make API call.
Private method to make API call .