I am trying to access an API, by postman, it works and returns the json normally, since the code (using VueJS + Axios) does not return, from the CROSS error, how can this? and does the axios return normally?
let headers = {
'Authorization': 'AUTENTICACAO BASIC',
'Content-Type': 'application/json'
}
axios.post('URL DA API', body, headers)
.then(response => {
console.log(response)
})
.catch(error => {
console.log(error)
})
In body
, I'm sending the necessary data to the return .. Remembering that in postman, returns the json correctly.
Return is error 401