在web.api上获取404以进行PUT和DELETE请求 [英] Getting 404 for PUT and DELETE request on web.api

查看:185
本文介绍了在web.api上获取404以进行PUT和DELETE请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我对asp.net MVC相当陌生.最近,我开始使用Web API玩arround,并遇到一些奇怪的错误.当我创建新项目(ASP.NET MVC 4 Web应用程序-> WEB API)时,我尝试通过提琴手访问值控制器,PUT和DELETE方法无效-我找不到404.当我尝试该问题时,我发现只有在选择.net 4.5框架(使用Visual Studio 11 RC)时才会发生这种情况.当应用程序使用.net 4.0时,放置和删除方法可以正常工作.到目前为止,我发现的唯一解决方法是创建应用程序并选择.net 4.0,一旦创建项目,就将目标框架更改为4.5.

还有其他人也有类似的问题,并找到了解决方案.有人可以复制我的问题吗?

任何建议将不胜感激.
Uros

Hi
I am quite new with asp.net MVC. Recently I started playing arround with web api and came accross some strange errors. When I create new project(ASP.NET MVC 4 Web application -> WEB API), and I try to access the values controller via fiddler the PUT and DELETE methods dot''t work - I get 404 not found. When I experimented with the problem I found out that this only occurs when I choose .net 4.5 framework(I use visual studio 11 RC). When the application uses .net 4.0 put and delete methods work normally. The only work-around I found so far is to create the application and choose .net 4.0 and once the project is created change the target framework to 4.5.

DId anybody else had similar problems and found a solution. Can anybody replicate my problem?

Any advice will be appreciated.
Uros

推荐答案

检查以下链接...


http: //forums.asp.net/t/1826146.aspx/1?How+to+get+net+c+webAPI+PUT+and+DELETE+methods+verbs+working [ http://stackoverflow. com/questions/10906411/asp-net-web-api-put-delete-verbs-not-allowed-vs2012rc-iis-8-express [ http://stackoverflow.com/questions/3946283/enabling-html- put-method-on-iis-7-5 [ ^ ]
Check the below Links...


http://forums.asp.net/t/1826146.aspx/1?How+to+get+net+c+webAPI+PUT+and+DELETE+methods+verbs+working[^]


http://stackoverflow.com/questions/10906411/asp-net-web-api-put-delete-verbs-not-allowed-vs2012rc-iis-8-express[^]


http://stackoverflow.com/questions/3946283/enabling-html-put-method-on-iis-7-5[^]


这篇关于在web.api上获取404以进行PUT和DELETE请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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