Ric*_*rdB 5 javascript http node.js
发现此问题调试代码,其中以下不起作用:
var req = http.request(options,function(res){
            // res.on('error',cb(err));
            res.on('end',function(){
                cb();
            });
        });
但是,以下确实有效:
       var req = http.request(options,function(res){
            // res.on('error',cb(err));
            res.on('data',function(chunk){
                //why do we need this?
            });
            res.on('end',function(){
                cb();
            });
        });
| 归档时间: | 
 | 
| 查看次数: | 1351 次 | 
| 最近记录: |