0
I’m trying to consume a Federal Board of Medicine API but so far unsuccessful.
This is a very simple GET request: https://portal.cfm.org.br/api_rest_php/api/v1/medicos/buscar_foto/9666/PA
Where the last 2 parameters are the doctor’s CRM and the state acronym (UF).
I’m trying for Ode.js with the code below:
const url = 'https://portal.cfm.org.br/api_rest_php/api/v1/medicos/buscar_foto/9666/PA'
axios.get(url)
.then(retorno => {
res.json(retorno.data)
})
.catch(err => {
res.json(err)
})
The problem is that return.data always returns empty, but calling the same URL in the browser data is returned correctly.
What am I doing wrong?