Browser security protocols are preventing access to '' from 'http://localhost:4200' due to CORS policy blocking. The requested resource lacks an 'Access-Control-Allow-Origin' header. If a non-transparent response is acceptable, adjust the request mode to 'no-cors' to fetch without CORS.
This error was encountered in the console, even though CORS has been enabled for other API requests in the WEB API.
Service:
ViewPDF(mMagazineId){
return this.http.get(this.BASE_URL + `/api/ViewPDF/?mMagazineId=${mMagazineId}`);
}
WebApiConfig.cs
config.EnableCors(new EnableCorsAttribute("*", headers: "*", methods: "*"));
This issue is causing confusion for me. Any assistance in resolving it would be greatly appreciated.