📜  superagent vs axios - 任何代码示例

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

代码示例3
const axios = require('axios');

(async () => {
  try {
    const response = await axios.get('https://the-one-api.dev/v2/book?api_key=MY_KEY')
    console.log(response.data.name);
  } catch (error) {
    console.log(error.response.body);
  }
})();