如何使IIS支持put和delete请求

调试的时候是可以使用put请求的,后面部署到IIS上面的使用旧提示报错了。

原因是IIS默认是不支持put和delete的请求的,要想IIS支持,则需要进行如下两个步骤。

1、删除自己项目下的IIS安装的WebDav模块

2、修改你项目的web.config ,在<system.webServer>标签内加上以下代码。

     <modules runAllManagedModulesForAllRequests="true" runManagedModulesForWebDavRequests="true">
           <remove name="WebDAVModule"/>
      </modules>
       <handlers>
          <remove name="WebDAV" />

        </handlers>

具体操作参考原文:https://blog.csdn.net/lynehylo/article/details/80623190

猜你喜欢

转载自www.cnblogs.com/masha2017/p/12556857.html