2018-09-30 nodejs http.get req.o

2018-09-30  本文已影响21人  五大RobertWu伍洋
    http.get(callbackurl, function(req, response) {
        var html = '';
        req.on('data', function(data) {
            html += data;
            debug('callback response data:', data, " html:", html);
        });
        req.on('end', () => {
            console.log("adv side callback result:", html);
            saveeventarray(html, querydata, clickid, clickresult, (result) => {
                debug("linktestbyid final rs:", result);
                callback(result);
            });
        });
    });

注意: 最开始 写的是 :

 req.on('end', (html) => {
  console.log("adv side callback result:", html);

发现一直是空呢?!最后才明白req.on('end',回调函数没有参数啊!)

上一篇 下一篇

猜你喜欢

热点阅读