400 bad request when access ASP.net web api via computer name on IISExpress

情到浓时终转凉″ 提交于 2021-02-07 13:18:23

问题


I'm getting a 400 bad request error message when accessing an ASP.net web api via a url that uses the computer name. When I use localhost it works fine. I'm using the iisExpress for visual studio 2012.

Any help is appreciated! Thanks in advance!


回答1:


I found the answer to this from another post on here. I had to update my IISExpress' applicationhost.config file and add a binding with my computer name on it.

The link to the other post is here: Configure IIS Express for external access to VS2010 project




回答2:


If you prefer not to change configurations, you can use our free VS extension called Conveyor

https://marketplace.visualstudio.com/items?itemName=vs-publisher-1448185.ConveyorbyKeyoti



来源:https://stackoverflow.com/questions/17223404/400-bad-request-when-access-asp-net-web-api-via-computer-name-on-iisexpress

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