如何使用axios获取更多数据?

当我这样做时:

const uuidapi = await axios.get('https://api.hypixel.net/player?key=mykey&name=' + args[1]);
console.log(uuidapi);

我收到来自Axios的回复:

https://paste.menudocs.org/paste/7vppu

So my question is: How do I get the Data after "socialMedia"? Heres how socialMedia looks like:

"socialMedia": {
          "links": {
            "YOUTUBE": "https://www.youtube.com/channel/UC1L7H9qQyB2zZgt-1XUv6jA",
            "DISCORD": "Altpapier#4847
        }
    }

Why does it say socialMedia: [Object], and how do I get more than this? I can't use const { data } = await axios.get(URL); because I want to get 2 URL responses with the complete data.

评论
依、太难
依、太难

See this question: How can I get the full object in Node.js's console.log(), rather than '[Object]'?

you can use console.dir( yourObject, { depth: null } )

点赞
评论
菊花开
菊花开

所有数据已经​​在这里,只是console.log的格式并不打印每个嵌套的对象。 如果您更换

 console.log(uuidapi);

通过

 console.log(JSON.stringify(uuidapi));

它会更好地工作

点赞
评论