how ot send user agent in nodejs https header

Solutions on MaxInterview for how ot send user agent in nodejs https header by the best coders in the world

showing results for - "how ot send user agent in nodejs https header"
Paolo
12 Mar 2019
1const options = {
2  hostname: 'www.panda.tv',
3  path: 'ajax_chatinfo?roomid=89757',
4  headers: { 'User-Agent': 'Mozilla/5.0' }
5};
6
7http.get(options, function(res) {
8  res.on('data', function(chunk) { console.log(chunk) });
9});
Rafael
15 Sep 2018
1http.get({ url: 'http://www.panda.tv/ajax_chatinfo?roomid=89757',
2    agent: 'Mozilla/5.0' }, function(res) {
3    res.on('data', function(chunk) {
4        doSomething();
5    });
6});