IIS服务HTTP请求出现Error:远程服务器返回404了意外响应: (405) Method Not Allowed。

他的最新文章
他的热门文章
您举报文章:
举报原因:
原文地址:
原因补充:
(最多只允许输入30个字)I wasn't able to find helpfull answer to the following problem.
Angular $resource POST/PUT (both) generate 405.0 - Method Not Allowed error on a simple WebAPI calls. Get works just fine. App is an MVC with WebAPI running in IIS 7.5. When I try to run a sample locally - works fine. It's not a CORS issue and Auth was stripped out.
405 (Method Not Allowed)
&!DOCTYPE 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"&
&title&IIS 7.5 Detailed Error - 405.0 - Method Not Allowed&/title&
&style type="text/css"&
&!-- body {
margin: 0;
font-size: .7
font-family: Verdana, Arial, Helvetica, sans-
background: #CBE1EF;
margin: 0;
color: #006600;
font-size: 1.1
font-weight:
.config_source code {
font-size: .8
color: #000000;
margin: 0;
font-size: 1.4
word-wrap: break-
margin: 10px 0 10px 40
ol.first {
margin-top: 5
fieldset {
padding: 0 15px 10px 15
.summary-container fieldset {
padding-bottom: 5
margin-top: 4
legend.no-expand-all {
padding: 2px 15px 4px 10
margin: 0 0 0 -12
color: #333333;
padding: 4px 15px 4px 10
margin: 4px 0 8px -12
_margin-top: 0
border-top: 1px solid #EDEDED;
border-left: 1px solid #EDEDED;
border-right: 1px solid #969696;
border-bottom: 1px solid #969696;
background: #E7ECF0;
font-weight:
font-size: 1
a:visited {
color: #007EFF;
font-weight:
text-decoration:
font-size: 2.4
margin: 0;
color: #FFF;
font-size: 1.7
margin: 0;
color: #CC0000;
font-size: 1.4
margin: 10px 0 0 0;
color: #CC0000;
font-size: 1.2
margin: 10px 0 5px 0;
width: 96%;
margin: 0 0 0 0;
padding: 6px 2% 6px 2%;
font-family: "trebuchet MS", Verdana, sans-
color: #FFF;
background-color: #5C87B2;
#content {
margin: 0 0 0 2%;
.summary-container,
.content-container {
background: #FFF;
width: 96%;
margin-top: 8
padding: 10
.config_source {
background: #fff5c4;
.content-container p {
margin: 0 0 10px 0;
#details-left {
width: 35%;
margin-right: 2%;
#details-right {
width: 63%;
#server_version {
width: 96%;
_height: 1
min-height: 1
margin: 0 0 5px 0;
padding: 11px 2% 8px 2%;
color: #FFFFFF;
background-color: #5A7FA5;
border-bottom: 1px solid #C1CFDD;
border-top: 1px solid #4A6C8E;
font-weight:
font-size: 1
color: #FFF;
text-align:
#server_version p {
margin: 5px 0;
margin: 4px 0 4px 0;
width: 100%;
vertical-align:
padding: 3px 0;
text-align:
font-weight:
width: 30%;
text-align:
padding-right: 2%;
font-weight:
thead th {
background-color: #
width: 25%;
#details-right th {
width: 20%;
table tr.alt td,
table tr.alt th {
background-color: #
.highlight-code {
color: #CC0000;
font-weight:
font-style:
.preferred {
padding: 0 5px 2px 5
font-weight:
background: #006633;
color: #FFF;
font-size: .8
&div id="header"&
&h1&Server Error in Application "LITE_PORTAL"&/h1&
&div id="server_version"&
&p&Internet Information Services 7.5&/p&
&div id="content"&
&div class="content-container"&
&fieldset&
&legend&Error Summary&/legend&
&h2&HTTP Error 405.0 - Method Not Allowed&/h2&
&h3&The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used.&/h3&
&/fieldset&
&div class="content-container"&
&fieldset&
&legend&Detailed Error Information&/legend&
&div id="details-left"&
&table border="0" cellpadding="0" cellspacing="0"&
&tr class="alt"&
&th&Module&/th&
&td&WebDAVModule&/td&
&th&Notification&/th&
&td&MapRequestHandler&/td&
&tr class="alt"&
&th&Handler&/th&
&td&WebDAV&/td&
&th&Error Code&/th&
&td&0x&/td&
&div id="details-right"&
&table border="0" cellpadding="0" cellspacing="0"&
&tr class="alt"&
&th&Requested URL&/th&
&td&http://portal.local.com:80/api/products/5&/td&
&th&Physical Path&/th&
&td&C:\_Dev\Applications\liteangular_portal\LiteAngular\api\products\5&/td&
&tr class="alt"&
&th&Logon Method&/th&
&td&Anonymous&/td&
&th&Logon User&/th&
&td&Anonymous&/td&
&div class="clear"&&/div&
&/fieldset&
&div class="content-container"&
&fieldset&
&legend&Most likely causes:&/legend&
&li&The request sent to the Web server used an HTTP verb that is not allowed by the module configured to handle the request.&/li&
&li&A request was sent to the server that contained an invalid HTTP verb.&/li&
&li&The request is for static content and contains an HTTP verb other than GET or HEAD.&/li&
&li&A request was sent to a virtual directory using the HTTP verb POST and the default document is a static file that does not support HTTP verbs other than GET or HEAD.&/li&
&/fieldset&
&div class="content-container"&
&fieldset&
&legend&Things you can try:&/legend&
&li&Verify the list of verbs enabled for the module handler this request was sent to, and ensure that this verb should be allowed for the Web site.&/li&
&li&Check the IIS log file to see which verb is not allowed for the request.&/li&
&li&Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click &a href="http://go.microsoft.com/fwlink/?LinkID=66439"&here&/a&.&/li&
&/fieldset&
&div class="content-container"&
&fieldset&
&legend&Links and More Information&/legend&
This error means that the request sent to the Web server contained an HTTP verb that is not allowed by the configured module handler for the request.
&p&&a href="http://go.microsoft.com/fwlink/?LinkID=62293&IIS70Error=405,0,0x1"&View more information &&/a&
&/fieldset&
I can make ajax calls to this api methods, so they should be fine. I've tried adding/removing Http ResponseType attributes to them all to no luck. Can some web/angular guru shed some light on this problem? Is it something in IIS? I found this:
But messing with the IIS apphost config seems hackish. And I'm not familiar enough with it to make educated decision.
EDIT: My config:
&customHeaders&
&add name="Access-Control-Allow-Origin" value="*" /&
&add name="Access-Control-Allow-Headers" value="Content-Type, Accept, Authorization" /&
&add name="Access-Control-Allow-Credentials" value="true" /&
&add name="Access-Control-Allow-Methods" value="POST,GET,PUT,DELETE,OPTIONS" /&
&add name="Access-Control-Max-Age" value="1728000" /&
&/customHeaders&
Thanks in advance!
P.S. It looks like the problem has to do with WebDAVModule:
Notification
MapRequestHandler
Handler WebDAV
Error Code
Anyone knows what it might be, though? Anyone?...
解决方案 It turned out removing WebDAV handler and WebDAVModule took care of the problem:
&handlers&
&remove name="WebDAV" /&
&/handlers&
&modules runAllManagedModulesForAllRequests="true"&
&remove name="WebDAVModule" /&
&/modules&
本文地址: &
我无法找到有益的回答以下问题。结果,角$资源POST / PUT(两者)产生405.0
- 一个简单的WebAPI调用不允许的方法错误。找工作就好了。应用与的WebAPI一个MVC在IIS 7.5上运行。当我尝试在本地运行一个示例 - 工作正常。这不是一个CORS问题,验证被剥离出来。
405(不允许的方法) \r\r <!DOCTYPE HTML PUBLIC“ -
// W3C // DTD XHTML 1.0 Strict标准// EN“”http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"&\r< HTML的xmlns =“http://www.w3.org/1999/xhtml”>\r\r< HEAD>\r
<标题> IIS 7.5的详细错误 -
- 不允许的方法< /标题>\r
<风格类型=“文/ CSS”>\r
<! - 身体{\r
保证金:0;\r
字体大小:.7\r
FONT-FAMILY:宋体,宋体,黑体,无衬线;\r
背景:#CBE1EF;\r
保证金:0;\r
颜色:#006600;\r
字体大小:1.1\r
字体重量:大胆的;\r
.config_source code {\r
字体大小:.8\r
颜色:#000000;\r
保证金:0;\r
字体大小:1.4\r
自动换行:打破字;\r
保证金:10px的0 10px的40像素;\r
ul.first,\r
ol.first {\r
的margin-top:5像素;\r
填充:0 15px的10px的15px的;\r
。总结容器字段集{\r
填充底:5像素;\r
的margin-top:4PX;\r
legend.no展开,所有{\r
填充:2px的均为15px 10px的4PX;\r
保证金:0 0 0 -12\r
颜色:#333333;\r
填充:4PX均为15px 10px的4PX;\r
保证金:4PX 0 8像素-12\r
_margin顶:0像素;\r
边境顶:1px的固体#EDEDED;\r
左边框:1px的固体#EDEDED;\r
右边框:1px的固体#969696;\r
下边框:1px的固体#969696;\r
背景:#E7ECF0;\r
字体重量:大胆的;\r
字体大小:1EM;\r
一条链接,\r
答:访问{\r
颜色:#007EFF;\r
字体重量:大胆的;\r
答:悬停{\r
文字修饰:无;\r
字体大小:2.4\r
保证金:0;\r
颜色:#FFF;\r
字体大小:1.7\r
保证金:0;\r
颜色:#CC0000;\r
字体大小:1.4\r
保证金:10px的0 0 0;\r
颜色:#CC0000;\r
字体大小:1.2\r
保证金:10px的0为5px 0;\r
{的#header\r
宽度:96%;\r
保证金:0 0 0 0;\r
填充:6像素2%6像素2%;\r
FONT-FAMILY:“投石机MS”,宋体,无衬线;\r
颜色:#FFF;\r
背景颜色:#5C87B2;\r
保证金:0 0 0 2%;\r
位置:相对;\r
。总结容器,\r
.content容器{\r
背景:#FFF;\r
宽度:96%;\r
的margin-top:8像素;\r
填充:10px的;\r
位置:相对;\r
.config_source {\r
背景:#fff5c4;\r
.content容器p {\r
保证金:0 0 10px的0;\r
#细节左{\r
宽度:35%;\r
浮动:左;\r
保证金右:2%;\r
#细节右{\r
宽度:63%;\r
浮动:左;\r
溢出:隐藏;\r
#server_version {\r
宽度:96%;\r
_height:1px的;\r
最小高度:1px的;\r
保证金:0 0 0为5\r
填充:11像素的2%加上了8px 2%;\r
颜色:#FFFFFF;\r
背景颜色:#5A7FA5;\r
下边框:1px的固体#C1CFDD;\r
边境顶:1px的固体#4A6C8E;\r
字体重量:正常;\r
字体大小:1EM;\r
颜色:#FFF;\r
文本对齐:权利;\r
#server_version p {\r
保证金:为5px 0;\r
保证金:4PX 0 4PX 0;\r
宽度:100%;\r
边界:无;\r
垂直对齐:首位;\r
填充:0的3\r
文本对齐:左;\r
字体重量:大胆的;\r
边界:无;\r
宽度:30%;\r
文本对齐:权利;\r
填充右:2%;\r
字体重量:正常;\r
THEAD日{\r
背景色:#\r
宽度:25%;\r
#细节右次{\r
宽度:20%;\r
表tr.alt TD,\r
表tr.alt日{\r
背景色:#\r
.highlight- code {\r
颜色:#CC0000;\r
字体重量:大胆的;\r
字体样式:斜体;\r
.clear {\r
明确:两者;\r
。$ P $ {pferred\r
填充:0 2px的为5px为5\r
字体重量:正常;\r
背景:#006633;\r
颜色:#FFF;\r
字体大小:.8\r
< /风格>\r\r< /头>\r\r<身体GT;\r
< DIV ID =“头”>\r
< H1&在应用程序“LITE_PORTAL”&LT服务器错误; / H1>\r
< / DIV>\r
< DIV ID =“SERVER_VERSION”>\r
< P> Internet信息服务7.5 LT; / P>\r
< / DIV>\r
< DIV ID =“内容”>\r
< DIV CLASS =“内容的容器”>\r
<&字段集GT;\r
<传奇>错误总结< /传说>\r
< H2> HTTP错误405.0
- 不允许的方法< / H>\r
< H3&您正在寻找的,因为正在使用无效的方法(HTTP动词)是无法显示该页面< / H3 GT&;\r
< /字段集>\r
< / DIV>\r
< DIV CLASS =“内容的容器”>\r
<&字段集GT;\r
<传奇>详细的错误信息与LT; /传说>\r
< DIV ID =“细节左”>\r
<表格边框=“0”的cellpadding =“0”CELLSPACING =“0”>\r
< TR类=“ALT”>\r
<第i个模块< /第i\r
< TD> WebDAVModule< / TD>\r
< / TR>\r
&所述; TR>\r
<第i通知和LT; /第i\r
< TD>麻prequestHandler< / TD>\r
< / TR>\r
< TR类=“ALT”>\r
<第i处理器< /第i\r
< TD>的WebDAV< / TD>\r
< / TR>\r
&所述; TR>\r
<第i个错误code< /第i\r
< TD> < / TD>\r
< / TR>\r\r
< /表&\r
< / DIV>\r
< DIV ID =“细节 - 右”>\r
<表格边框=“0”的cellpadding =“0”CELLSPACING =“0”>\r
< TR类=“ALT”>\r
<第i个请求的URL< /第i\r
< TD> HTTP://portal.local.com:80 / API /产品/ 5℃; / TD>\r
< / TR>\r
&所述; TR>\r
<第i个物理路径< /第i\r
< TD> C:\\ _开发\\应用程序\\ liteangular_portal \\ LiteAngular \\ API \\产品\\ 5℃; / TD>\r
< / TR>\r
< TR类=“ALT”>\r
<第i个登录方法< /第i\r
< TD>&匿名LT; / TD>\r
< / TR>\r
&所述; TR>\r
<第i登录用户< /第i\r
< TD>&匿名LT; / TD>\r
< / TR>\r\r
< /表&\r
< DIV CLASS =“清除”>< / DIV>\r
< / DIV>\r
< /字段集>\r
< / DIV>\r
< DIV CLASS =“内容的容器”>\r
<&字段集GT;\r
<传奇>最可能的原因:其中; /传说>\r
< UL>\r
<李方式&发送到使用LT不是由配置来处理请求的模块允许的HTTP动词Web服务器的请求; /李>\r
<李方式&的请求被发送到包含无效的HTTP动词的服务器16; /李>\r
<李&该请求的是静态内容,并含有比GET或HEAD&LT以外的HTTP动词; /李>\r
<李&将请求发送到使用HTTP动词POST和默认文档的虚拟目录是一个静态文件不支持超过GET或HEAD&LT其他HTTP动词; /李>\r
< / UL>\r
< /字段集>\r
< / DIV>\r
< DIV CLASS =“内容的容器”>\r
<&字段集GT;\r
<传奇>可尝试:< /传说>\r
< UL>\r
<李方式&验证模块处理这个请求被送到启用动词列表中,并确保这个动词应该被允许的Web站点和LT; /李>\r
<李方式&检查IIS日志文件,看看哪些动词是不允许的请求< /李>\r
<立GT;创建跟踪规则以跟踪此HTTP状态code失败的请求。有关为失败的请求创建跟踪规则的详细信息,单击& A HREF =“http://go.microsoft.com/fwlink/?LinkID=66439”>此处& / A>< /李>\r
< / UL>\r
< /字段集>\r
< / DIV>\r\r\r
< DIV CLASS =“内容的容器”>\r
<&字段集GT;\r
<传奇>链接和更多信息< /传说>\r
此错误表示发送到Web服务器的请求中包含的不被请求的配置模块允许处理一个HTTP动词。\r
< P>< A HREF =“http://go.microsoft.com/fwlink/?LinkID=62293&IIS70Error=405,0,0x1”&查看更多的信息和放大器; RAQUO;< / A>\r
&所述; / P>\r\r
< /字段集>\r
< / DIV>\r
< / DIV>\r< /身体GT;\r\r< / HTML>
\r\r\r我可以为这一API的方法Ajax调用,所以他们应该罚款。我试着添加/删除的Http responseTyp的属性,他们都没有运气。一些web /角度大师可以提供一些线索对这个问题呢?有什么事情在IIS中?我发现这个:这的但与IIS配置APPHOST搞乱似乎的hackish。而且我没有足够的熟悉它做出明智的决定。编辑:我的配置: \r\r < customHeaders>\r
<添加名称=“访问控制允许来源”VALUE =“*”/>\r
<添加名称=“访问控制 - 允许 - 头”VALUE =“Content-Type的,接受授权”/>\r
<添加名称=“访问控制允许的凭据”VALUE =“真”/>\r
<添加名称=“访问控制允许的方法”VALUE =“POST,GET,PUT,DELETE,OPTIONS”/>\r
<添加名称=“访问控制-max-age的”值=“1728000”/>\r< / customHeaders>
在此先感谢! P.S。它看起来像问题与WebDAVModule做:通知马prequestHandler处理器的WebDAV错误code 0x0000000 任何人都知道它可能是有关系吗?有人吗?... 解决方案 原来删除WebDAV处理程序,并WebDAVModule照顾的问题: <&处理GT;
<清除NAME =“WebDAV的”/>< /处理器><模块runAllManagedModulesForAllRequests =“真正的”>
<清除NAME =“WebDAVModule”/>< /模块&
本文地址: &
扫一扫关注官方微信他的最新文章
他的热门文章
您举报文章:
举报原因:
原文地址:
原因补充:
(最多只允许输入30个字)本机上可以,置服务器上后,用ajax模拟post请求报错 “405 Method not allowed” - Web Service当前位置:& &&&本机上可以,置服务器上后,用ajax模拟post请求报错本机上可以,置服务器上后,用ajax模拟post请求报错 “405 Method not allowed”www.MyException.Cn&&网友分享于:&&浏览:1次本机上可以,放服务器上后,用ajax模拟post请求报错 “405 Method not allowed”程序没问题,用ajax测试的时候,在本地可以,把url换成服务器的,就进不去了。&
Status&Code:405&Method&Not&Allowed
var&json&=&.......&.&//json格式的字符串
url:&"http://localhost:3770/XXXService.svc/InsertCCFB",&
type:&"POST",&
contentType:&"application/json",&
data:&'{&"ccfb":'&+&json&+&'}',
dataType:&"json",&
success:&function&(returnValue)&{&
alert(returnValue);&
error:&function&()&{&
alert('没有进入');&
&&&&&&&&[WebInvoke(Method&=&"POST",&UriTemplate&=&"/InsertCCFB",&ResponseFormat&=&WebMessageFormat.Json,&BodyStyle&=&WebMessageBodyStyle.Wrapped)]
&&&&&&&&string&InsertCCFB(CCFB&ccfb);
网上查了很多资料,iis上面
1)加了MIME类型(扩展名&.json&&&类型text/json)
2)处理映射程序也添加了&执行路径&*.json&,&谓词GET,POST
3)WebDAV的谓词限制也改成了全部为此
但还是405错误。。------解决方案--------------------服务器地址可以在ie中打开吗------解决方案--------------------添加这个配置也不行的?
&handlers&
&&&remove&name="WebDAV"&/&
&&&add&name="WebDAV"&path="*"&verb="*"&modules="WebDAVModule"
&&&&&&resourceType="Unspecified"&requireAccess="None"&/&
&/handlers&------解决方案--------------------&system.webServer&
&&&&&modules&
&&&&&&&&&remove&name="WebDAVModule"&/&
&&&&&/modules&
&&&&&handlers&
&&&&&&&&&remove&name="WebDAV"&/&
&&&&&/handlers&
&/system.webServer&
12345678910
12345678910
12345678910 上一篇:下一篇:文章评论相关解决方案 12345678910 Copyright & &&版权所有

我要回帖

更多关于 ajax请求远程服务器 的文章

 

随机推荐