Problem with http GET request on node js

后端 未结 2 767
悲&欢浪女
悲&欢浪女 2021-02-15 13:24

Im writing an http client to read from facebook using node.js and using the following code:

var http = require(\'http\');

var options = {
  host: \'www.fb.com\'         


        
2条回答
  •  你的背包
    2021-02-15 13:36

    var request_options = 
    {
        host: 'www.fb.com',
        headers: {'user-agent': 'Mozilla/5.0'},
        path: '/'
    };
    

    Setting the request option this way should work.

提交回复
热议问题