📜  如何在节点 js 中使用请求模块 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:50:16.844000             🧑  作者: Mango

代码示例1
const request = require('request');
request('http://www.google.com', function (error, response, body) {
  console.error('error:', error); // Print the error if one occurred
  console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received
  console.log('body:', body); // Print the HTML for the Google homepage.
});