Created
November 14, 2013 12:21
-
-
Save thapakazi/7465913 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//function to process http request | |
httpRequest = function(message, path, action, options, callback) { | |
return message.http("" + BASEURL + "/" + path).query(options)[action]()(function(err, res, body) { | |
return callback(err, res, body); | |
}); | |
}; | |
//function call | |
httpRequest(msg, 'getDrink', 'post', { | |
coffee: "coffee", | |
tea: "tea" | |
}, function(err, msg, body) { | |
return console.log(body); | |
}); | |
---------------------------------------------------------- | |
## my problem is that, | |
how do I generate this object dynamically | |
{coffee: "coffee", tea: "tea" } ... from an array items=["coffee","tea"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment