小编Ste*_*ris的帖子

MVC Web API Angular App ('http://localhost:4200' has been blocked by CORS policy)

I have been spending hours and hours about looking a way to enable my front end web app (Angular) to access my Asp.NET MVC (Controller) but it displays the following error:

Access to XMLHttpRequest at 'https://localhost:44344/Authentication/SignIn' from origin 'http://localhost:4200' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.

Angular URL: http://localhost:4200/login?returnUrl=%2F

MVC URL: https://localhost:44344/

Here also what I have added to my web.config …

asp.net-mvc http cors asp.net-web-api angular

5
推荐指数
2
解决办法
982
查看次数

标签 统计

angular ×1

asp.net-mvc ×1

asp.net-web-api ×1

cors ×1

http ×1