问题描述
访问外网API可以,同样的地址在本地测试就不行,例如:http://aaa.cloudapp.net/apis/v3/xxx/aaa可以,但是我在本地调试http://127.0.0.1:47417/apis/v3/xxx/aaa或者http://localhost:47417/apis/v3/xxx/aaa不可以我的VS已经打开(iis正常)还有一个问题,就是http://localhost:47417/打开是正常的,但是http://127.0.0.1:47417/却不能打开!显示:BadRequest-InvalidHostnameHTTPError400.Therequesthostnameisinvalid.C:WindowsSystem32driversetchost文件:#Copyright(c)1993-2009MicrosoftCorp.##ThisisasampleHOSTSfileusedbyMicrosoftTCP/IPforWindows.##ThisfilecontainsthemappingsofIPaddressestohostnames.Each#entryshouldbekeptonanindividualline.TheIPaddressshould#beplacedinthefirstcolumnfollowedbythecorrespondinghostname.#TheIPaddressandthehostnameshouldbeseparatedbyatleastone#space.##Additionally,comments(suchasthese)maybeinsertedonindividual#linesorfollowingthemachinenamedenotedbya'#'symbol.##Forexample:##102.54.94.97rhino.acme.com#sourceserver#38.25.63.10x.acme.com#xclienthost#localhostnameresolutionishandledwithinDNSitself.#127.0.0.1localhost#::1localhost