大佬教程收集整理的这篇文章主要介绍了node.js – 如何在nodejs中设置user-agent?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
http.get({ url: 'http://www.panda.tv/ajax_chaTinfo?roomid=89757',agent: 'Mozilla/5.0' },function(res) { res.on('data',function(chunk) { doSomething(); }); });
_http_client.js:158 self.agent.addrequest(self,options); ^ TypeError: self.agent.addrequest is not a function at new Clientrequest (_http_client.js:158:16) at Object.exports.request (http.js:31:10) at Object.exports.get (http.js:35:21) at getChaTinfo (/home/zeek/Documents/pandatv/node/app.js:5:10) at Object.<anonymous> (/home/zeek/Documents/pandatv/node/app.js:153:1) at Module._compile (module.js:541:32) at Object.Module._extensions..js (module.js:550:10) at Module.load (module.js:458:32) at trymoduleLoad (module.js:417:12) at Function.Module._load (module.js:409:3)
以上是大佬教程为你收集整理的node.js – 如何在nodejs中设置user-agent?全部内容,希望文章能够帮你解决node.js – 如何在nodejs中设置user-agent?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。