Search code examples

How would I get the full response from this Axios request?

I'm trying to get some data from a HTTP request (via Axios), however my issue is that I'm unsure of how I can get the "imageUrl" from it.

axios request

As you can see in the above image, this is the response I get. Below is the code I'm currently using:

function getAvatarURL(userID) {
        .then(r => {
} returns what is in the image.

When I try and do console.log( is simply returns 'Undefined'

How would I go about getting the imageUrl from this?


  • The API is returning an Array of Objects. You should first select the first element within the array to get the imageURL You should change your console.log line to


    This should make it output as you expect it to be.