“No Access-Control-Allow-Origin” Error – Cors Plugin
I have been developing a reactjs application that calls a spotify-api that return some information on music artist. I got this error “No Access-Control-Allow-Origin Error” as below
- Ex 1: your domain is example.com and you want to make a request to test.com => you cannot.
- Ex 2: your domain is example.com and you want to make a request to inner.example.com => you cannot.
- Ex 3: your domain is example.com:80 and you want to make a request to example.com:81 => you cannot
- EX 4: your domain is example.com and you want to make a request to example.com => you can.
To fix this error I had to install Cross-Origin Resource Sharing (CORS) client plugin on my chrome browser.
The results, I was able to call Web Spotift Api and return the information on that music artist
Others way of fixing this error is to install Cors also on the server end. Below is video from utube on resolving this on C# – https://www.youtube.com/watch?v=uDy_cvf4nDg