As noted above, this is the error I receive when trying to pull from a raspberry pi serving up info via API. When I remove Access-Control-Allow-Origin, it then says that it’s missing.
export default axios.create({
baseURL: `http://${wlanIP}`,
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': "*",
"Access-Control-Allow-Headers": "Access-Control-Allow-Headers, Origin, Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers, Access-Control-Allow-Origin",
"Access-Control-Allow-Credentials" : "true",
"Access-Control-Allow-Methods": "GET,HEAD,OPTIONS,POST,PUT",
}
})
I don’t have a backend configured as of yet because the backend for the project has not been decided. Would prefer not to just demonstrate it working in a particular backend if that’s not going to be the long term solution.
Already tried: adjusting value of Access-Control-Allow-Origin, changing what’s included in Access-Control-Allow-Headers, as well as adjusting the config of the 3rd party software I’m using on the raspberry pi to allow CORS. Any help would be greatly appreciated.