I'm trying to get data from an authorized API in a Reactjs app and I'm still getting that 401(Unauthorized) error, also 'OPTIONS' request keeps popping up instead of GET request.
const api_call = await axios.get(`api-link`, {'Access-Control-Allow-Headers': "Origin, X-Requested-With, Content-Type, Accept", 'Access-Control-Allow-Origin' : "*", headers: {'Authorization': "bearer API-auth"}});
const response= await api_call.json();
console.log(response);