I am using the Fetch API in my React+Redux app like this:
fetch("http://news.at.zhihu.com/api/4/news/before/20160127").
The app is running in Chrome and I also set the --disable-web-security
argument when I open Chrome. However, I still get the CORS issue:
Fetch API cannot load http://news.at.zhihu.com/api/4/news/before/20160127. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access.
If I use XMLHTTPRequest, it works well. It looks like that the --disable-web-security
can not work well with Fetch API.
Does anyone know how to use Fetch API without worrying about CORS issue? I can not modify response header such as 'Access-Control-Allow-Origin' since the services are not in my charge.