Asp.Net MVC + WebApi 2 combine paths when calling WebApi from Angular 8 app

我只是一个虾纸丫 提交于 2020-03-17 03:15:59

问题



I have one question with witch I have having issues for some time now.

First, a little background. I have created an MVC app that holds Angular 8 app. Nothing special about it. I also have WebApi 2 app that this Angular app is supposed to "talk" with.
The problem I have is, when I build everything and call Api (https) from MVC with Angular (http) I get correct URL to Api. You can see picture 1.
Picture 1
But, see what happens when I call Api (http) from MVC with Angular (http). Please, see picture 2.
Picture 2
Note here that with blue color is the base URL for MVC with Angular, and with green it is Api. For some reason these two get combined and I don't understand why. The only difference is that one is on http and another is on https. The code behind is the same.
Could somebody please explain this to me? I tryed googling the issue, but no luck. Maybe I am asking the wrong question.
Anyways, every help is appreciated.
Thanks..


回答1:


Take a look at the meaning of a TCP Reset here...

https://www.google.com/search?q=tcp+reset&oq=tcp+reset&aqs=chrome..69i57j35i39j0l6.5585j0j7&sourceid=chrome&ie=UTF-8



来源:https://stackoverflow.com/questions/60688416/asp-net-mvc-webapi-2-combine-paths-when-calling-webapi-from-angular-8-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!