https://www.cnblogs.com/gyweiUSTC/articles/1886443.html
一些笔记:
web api能接受PUT,DELETE请求
在<system.webServer>标签里面
<!--使web api能接受PUT,DELETE请求 ->
<modules runAllManagedModulesForAllRequests="true" runManagedModulesForWebDavRequests="true">
<remove name="WebDAVModule" />
<!-- 解决部分低IIS版本时不能识别WEB API的URL路径问题 >
<remove name="UrlRoutingModule-4.0" />
<add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
</modules>
设定跨域,访问的Headers,Method等的限制
在<system.webServer>标签里面
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Methods" value="GET, POST, PUT, DELETE, OPTIONS" />
<add name="Access-Control-Allow-Headers" value="Content-Type, version, context" />
</customHeaders>
</httpProtocol>
配置网站的默认页面
在<system.webServer>标签里面
<defaultDocument>
<files>
<clear />
<add value="Index.aspx" />
</files>
</defaultDocument>
配置网站的可访问的目录
在<system.webServer>标签里面
<security>
<requestFiltering>
<!--如可访问 App_Data 目录-->
<hiddenSegments>
<remove segment="App_Data"/>
</hiddenSegments>
</requestFiltering>
</security>