他们给出了这个代码示例const axios = require('axios');const params = { access_key: 'YOUR_ACCESS_KEY'}axios.get('https://api.aviationstack.com/v1/flights', {params}) .then(response => { const apiResponse = response.data; if (Array.isArray(apiResponse['results'])) { apiResponse['results'].forEach(flight => { if (!flight['live']['is_ground']) { console.log(`${flight['airline']['name']} flight ${flight['flight']['iata']}`, `from ${flight['departure']['airport']} (${flight['departure']['iata']})`, `to ${flight['arrival']['airport']} (${flight['arrival']['iata']}) is in the air.`); } }); } }).catch(error => { console.log(error); });但是我应该如何在 Postman 中没有变量作为上面的“参数”的情况下使用 api 密钥?
1 回答
慕的地6264312
TA贡献1817条经验 获得超6个赞
axiosparams
只是 URL 查询参数。像这样使用它:
https://api.aviationstack.com/v1/flights?access_key=YOUR_ACCESS_KEY
添加回答
举报
0/150
提交
取消