I had a problem is that when I type **console.log(response.data)
**It should show me an object Containing many arrays, but its place shows me an error: Uncaught (in promise) => I get this error in the console
Knowing that there is no error in my API because when I try it in postman it brings the correct parameters.
this is my code :
const baseUrl = "https://....";
function getStandings() {
const url = `${baseUrl}/standings`
axios.get(url, {
headers: {
"X-Auth-Token": `${token}`
}
})
.then((response) => {
console.log(response.data)
});
}
getStandings();
⚠ note : token
and baseUrl
they correct.
It goes in the error and I log it to the console. This is what I get:👇🏼:
message: 'Network Error', name: 'AxiosError', code: 'ERR_NETWORK', config: {…}, request: XMLHttpRequest, …
Comments
Post a Comment