let https = require('https');
function httpGetAsync(url,callback) {
return https.get(url,
function(response) {
var body = ";
response.on('data', function(d) {
body += d; });
response.on('end', function() {
let parsed = JSON.parse(body)
callback(parsed)
})
}
);
}
//This is a simple function that uses
//an https module from a node to
//fire an AJAX call to get the
//response back.
httpGetAsync Function Definition
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.