Skip to content Skip to sidebar Skip to footer

How To Block After Http Request With Node.js

I have the following code: var options1 = { host: 'maps.googleapis.com', port: 80, path: '/maps/api/geocode/json?latlng=' + lat + ',' + lng + '&sensor=false', method:

Solution 1:

Change

res.on('close', function () {
    console.log('get_zillow : ' + body1);
  });

to

res.on('end', function () {
     callback_function(body1);
});

//defined new function

function callback_function(finaldata)
{
 // handle your final data
}

Post a Comment for "How To Block After Http Request With Node.js"