📜  express 向 api 发出请求 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:14.900000             🧑  作者: Mango

代码示例1
// Requirements: npm install request

const request = require('request');
request('https://jsonplaceholder.typicode.com/albums', function (error, response, body) {
  if (!error && response.statusCode == 200) {
    console.log( body ); 
  }
})