Getting 403 using axios

Hello i'm getting error 403 forbbiten acces when using axios.get on https://gorest.co.in/public/v2/users

this is my code:

try{ let users = await axios.get('https://gorest.co.in/public/v2/users?access-token=MY-TOKEN-HERE)

console.log(users)

} catch(err) { console.log(err) }

Can you please check now and let me know

I discovered the issue, it's a https problem. When we run the development build using localhost the API gets blocked by CORS because localhost runs on http and it's not the secure protocol.

I think if you run anything that enables requests by http access would be incredible so we don't have to install SSL on to run dev builds or deploy the development version just to check if the API call is working

https is mandatory, I can't disable that.

I have seen some logs blocking the user agent axios in backend, adjusted those rules

let users = await axios.get('https://gorest.co.in/public/v2/users').set('Authorization', 'Bearer MY-TOKEN-HERE')

Have you tried it this way?


Little markdown supported