我是一个初学者程序员,我正在使用下面的代码从IGDB API中获取数据。
axios.get('https://api-v3.igdb.com/games', {
headers: {
'user-key': 'my-key'
}
}).then(res => console.log(res)).catch(error => console.log(error))
而不是游戏,它回应了很多东西。 我想要游戏的JSON数据。 我怎么才能拿到那个? 请帮帮我。 文件在这里。
可能使用axios响应,您需要访问data
对象,如下所示
axios.get('https://api-v3.igdb.com/games', {
headers: {
'user-key': 'my-key'
}
// use res.data
}).then(res => console.log(res.data)).catch(error => console.log(error))