cURL equivalent in Node.js?

后端 未结 18 587
误落风尘
误落风尘 2020-11-29 16:43

I\'m looking to use information from an HTTP request using Node.js (i.e. call a remote web service and echo the response to the client).

In PHP I would have used cUR

18条回答
  •  离开以前
    2020-11-29 17:10

    You might want to try using something like this

    curl = require('node-curl');
    curl('www.google.com', function(err) {
      console.info(this.status);
      console.info('-----');
      console.info(this.body);
      console.info('-----');
      console.info(this.info('SIZE_DOWNLOAD'));
    });
    

提交回复
热议问题