我最近将我的Visual Studio升级到2015,将我的Windows升级到10,因此我的IIS和IIS Express已更改为版本10。 在此升级之后,在WebAPI中放置/删除动词结果404 Not Found。 这是我在WebAPI中的删除操作:
public class SlideShowApiController : ApiController
{
[AcceptVerbs("DELETE")]
[HttpDelete]
public HttpResponseMessage Delete(int id)
{
......
}
}
I found this configuration that work in IIS 8 but not work in IIS 10.
我正在使用MVC 5和WebAPI 2,我的请求标头是:
接受: /
Accept-Encoding:gzip,deflate,sdch
接受语言:EN-US,EN; Q = 0.8,FA; Q = 0.6
AlexaToolbar-ALX_NS_PH:AlexaToolbar / alxg-3.3
连接:保持活跃
内容长度:5
内容类型:应用/ X WWW的窗体-urlencoded;字符集= UTF-8
饼干:ASP.NET_SessionId = vu5joofojlqjs0qd4susdxxa;
__RequestVerificationToken = hGDy2Mm9BHqAAdGBlTqOzsSFnfvRPBbR87lIKUgkInKLpuFgb4JGcq-c817EtV96VZ8-YbLq85SusCVALYZWrAyAEZZdiiYWEMWaQxFGDCs1; _USERDATA = c099a18b-FACF-4b67-9037-1961ffadc326; .ASPXAUTH = 22B333AD3B0F591C08C35ACCF1014B4FCB326037EFFA5312382B437A323E58AC5896B3340F972A36AA9C1E3782948745310FBD51E9EB005013ABA934B2E789DA91EC4635E85D7445B635AC05BAE9FB2631E749382A5F8EF75DBFB1E5F84C336A0DAF1663625596AEEE4A14398911AED816E1617C6D6B1D95665F72969ED864A177E5A6458C79E4CD74BF5D950C5B7EA061367CAF450C6762A7F0A0777817E8A0C68C018D6E3E780564503FADEEA0517A29280927D957B1C0A8657EA8C2776198DEB42242D093F2C683F47C05DB04C3B0
主持人:本地主机:11631
起源:http://localhost:11631
引用者:http://localhost:11631/WebManagemenet/SlideShow
User-Agent:Mozilla / 5.0(Windows NT 10.0; WOW64)AppleWebKit / 537.36(KHTML,与Gecko一样)Chrome / 44.0.2403.157 Safari / 537.36
X-请求-随着:XMLHttpRequest的