问题原因:
Apache、IIS、Nginx等绝大多数web服务器,都不允许静态文件响应POST请求,否则会返回“HTTP/1.1 405 Method not allowed”错误。
https://www.cnblogs.com/xiaobie123/p/5949053.html
https://www.cnblogs.com/hnlong1/p/5228644.html
解决办法二:修改web.config中的配置
集成模式下配置:
<handlers>
<add name="html" path="*.html" verb="*" modules="IsapiModule"
scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll"
resourceType="Unspecified" preCondition="classicMode,runtimeVersionv4.0,bitness64" />
</handlers>
经典模式下配置,目前使用可能有问题:
这个模式下配置始终有问题,找到的说明如下:https://bbs.csdn.net/topics/390969635
注意如果IIS使用.net4.0以上版本的框架,<system.web>中的httpHandlers节点就没有用了,而应该使用微软专为4.0以上版本设计的新节点
<httpHandlers>
<add path="*.html" verb="*" type="URLRewriter.RewriterFactoryHandler,URLRewriter" />
</httpHandlers>