c# mvc webapi的put报405错误
2021-01-24 05:16
标签:rem www tle RoCE add charset icm 图片 delete 程序在本机调试可正常修改,本机是iis11 放到服务器上,报错了:405。服务器iis7.0 返回的错误页面: 这个郁闷呐,最后修改web.config配置文件解决了 也就是添加一条: c# mvc webapi的put报405错误 标签:rem www tle RoCE add charset icm 图片 delete 原文地址:https://www.cnblogs.com/mantishell/p/12056423.htmlDOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
html xmlns="http://www.w3.org/1999/xhtml">
head>
meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
title>405 - 不允许用于访问此页的 HTTP 谓词。title>
style type="text/css">
style>
head>
body>
div id="header">h1>服务器错误h1>div>
div id="content">
div class="content-container">fieldset>
h2>405 - 不允许用于访问此页的 HTTP 谓词。h2>
h3>您要查找的页面无法显示,因为尝试访问时使用了无效方法(HTTP 谓词)。h3>
fieldset>div>
div>
body>
html>
handlers>
remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
remove name="ExtensionlessUrlHandler-Integrated-4.0" />
remove name="WebDAV" />
add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
handlers>
modules>
remove name="WebDAVModule" />
modules>
和
解决的,暂时还不清楚为什么这个搞
https://stackoverflow.com/questions/12440277/how-do-i-enable-http-put-and-delete-for-asp-net-mvc-in-iis
文章标题:c# mvc webapi的put报405错误
文章链接:http://soscw.com/index.php/essay/46196.html