WebApi HTTP Put 405 Method not allowed
2017-09-19 17:21
976 查看
总结列表:
1. There is already an open DataReader associated with this Connection which must be closed first
2. npm install 失败
3. WebApi HTTP Put 405 Method not allowed
服务器升级了IIS,WebApi项目的put接口全部报405
搜索发现解决方案不少,尝试了张善友博客给出的解决方案,问题解决。
IIS7.5上的REST服务的Put操作发生HTTP Error 405.0 - Method Not Allowed 解决方法
WebDAV 是超文本传输协议 (HTTP) 的一组扩展,为 Internet 上计算机之间的编辑和文件管理提供了标准.利用这个协议用户可以通过Web进行远程的基本文件操作,如拷贝、移动、删除等。在IIS 7.0中,WebDAV是作为独立扩展模块,需要单独进行下载,而IIS 7.5中将集成WebDAV,然而WebDav把Put,Delete给咔嚓了。所以在IIS 7.5上部署的RESTful服务(WCF Data Service,WCF Rest Service,ASP.NET Web API,ASP.NET MVC)就悲剧了,当发送Put请求就会发生HTTP Error 405.0 – Method Not Allowed错误,解决方法也很简单,在Web.config里面加入如下设置:
<system.webServer> <modules> <remove name="WebDAVModule" /> </modules> <handlers> <remove name="WebDAV" /> </handlers> </system.webServer>
添加配置之后,出现了另一个问题
两个Route
一个post的Route,形如
Route["A/B"],另一个get的Route形如
Route["A/B/{id}"],
会报错:在多个Controller里有相同的Route。
不知道是不是修改配置之后导致的问题。
CSND博客中还有一篇文章介绍如何解决405,配置修改略有不同,未尝试过,先记录在这里
https://www.geek-share.com/detail/2699117623.html
相关文章推荐
- WebApi HTTP Put 405 Method not allowed
- IIS 8.0部署ASP.Net, WebAPI, Restful API, PUT/DELETE 报405错解决办法, method not allowed 405
- 调用 webapi的put和delete 报"Method Not Allowed" 405 错误。
- Asp.net WebApi Put模式调用,“HTTP 错误 405.0 - Method Not Allowed”解决方法
- IIS7 HTTP/405 METHOD NOT ALLOWED_PUT AND DELETE ME
- IIS 部署ASP.Net, WebAPI, Restful API, PUT/DELETE 报405错解决办法, webapi method not allowed 405
- IIS 部署ASP.Net, WebAPI, Restful API, PUT/DELETE 报405错解决办法, webapi method not allowed 405
- [环境搭建]-Web Api搭建到IIS服务器后PUT请求返回HTTP Error 405.0 - Method Not Allowed 解决方法 转摘:http://blog.csdn.net/qiujuer/article/details/23827531
- 解决“HTTP/1.1 405 Method not allowed”问题
- nginx中HTTP/1.1 405 Method not allowed 的解决方法
- 前端到后端------HTTP Status 405 ( The specified HTTP method is not allowed for the requested resource )
- Apache、IIS、Nginx等绝大多数web服务器,都不允许静态文件响应POST请求,否则会返回“HTTP/1.1 405 Method not allowed”错误。
- 解决“HTTP/1.1 405 Method not allowed”问题,让静态文件响应POST请求
- jQuery ajax 请求HttpServlet返回[HTTP/1.1 405 Method not allowed]
- 解决IIS7 HTTP/405 Method Not Allowed 问题的方法.
- WebApi Put方法出现MethodNotAllowed解决方法
- HTTP错误405-Method Not Allowed
- EXT解决“HTTP/1.1 405 Method not allowed”问题
- 解决“HTTP/1.1 405 Method not allowed”问题,让静态文件响应POST请求
- webapi 405 method not allowed