Asp.net MVC Web Api Http put and delete requests failing

我的梦境 提交于 2020-01-04 05:05:50

问题


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.

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

"Failed to load resource: the server responded with a status of 501 (Not Implemented) "

The application is hosted on iis 6.

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.


回答1:


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

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.

EDIT: 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/



来源:https://stackoverflow.com/questions/11727525/asp-net-mvc-web-api-http-put-and-delete-requests-failing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!