Asp.net MVC网页API HTTP PUT和删除请求失败 [英] Asp.net MVC Web Api Http put and delete requests failing

查看:590
本文介绍了Asp.net MVC网页API HTTP PUT和删除请求失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用MVC Asp.net 4 网页API 项目。我的应用程序使用MVC实现一个网站。它使HTTP请求到Web API来实现服务器的功能。

I am using Asp.net MVC 4 Web Api project. MY application uses mvc to implement a web site. It makes http requests to the web api to implement server functionality.

常规页面请求到控制器做工精细,它能够显示网页。该应用程序能够使获取发表的API请求来。但是,当它试图为删除 Web请求它获得

Regular page requests to controllers work fine and it is able to display web pages. The application is able to make get and post requests to the api. But when it tries to to put or delete web requests it gets

无法加载资源:服务器回应501(未实现)的状态为

应用程序托管在IIS 6。

The application is hosted on iis 6.

应用程序运行的本地卡萨尼服务器实例时的作品,能够让提出删除的请求,但一旦应用程序从 IIS执行它不正常工作。

The application works when running a local cassani server instance and is able to make put and delete requests, but as soon as the application is executed from iis it doesn't work as expected.

推荐答案

我尝试了所有从上面的意见建议,并没有一次成功。

I tried all the suggestions from the comment above and none of them worked.

我不得不在ASP.NET 4.0的dll添加到通配符映射在主目录选项卡上的配置区域。这为我工作。请记住,取消选中检查文件是否存在复选框。

I had to add the ASP.NET 4.0 dll to the Wildcard mappings in the Configuration area on the Home Directory tab. That worked for me. Remember to uncheck the "Verify file exists" checkbox.

编辑:我张贴的确切过程博客,使这里出现这种情况:<一href=\"http://www.proworks.com/blog/2012/11/14/how-to-fix-aspnet-mvc-web-api-http-put-and-delete-requests-failing/\">http://www.proworks.com/blog/2012/11/14/how-to-fix-aspnet-mvc-web-api-http-put-and-delete-requests-failing/

I posted a blog on the exact process to make this happen here: http://www.proworks.com/blog/2012/11/14/how-to-fix-aspnet-mvc-web-api-http-put-and-delete-requests-failing/

这篇关于Asp.net MVC网页API HTTP PUT和删除请求失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆