Trying to make a http request with axios, then accessing some property from request. Property is undefined, although it is present
public getApiURL() {
axios.get('https://xxxxxxxxx.com/metadata.json')
.then(res => {
console.log(res.data); // {"apiUrl":"https://xxxx.com/Api"}
console.log(res.data.apiUrl); // undefined
}).catch(err => {
console.log('error', err);
})
}