[整理]IIS 6.0 下部署 Asp.net MVC Web Api 后 HTTP PUT and DELETE 请求失败

http://guodong.me/?p=1560

ASP.NET MVC 4 has a new feature called WebAPI which makes it much easier to create a REST API in ASP.NET. Unfortunately, I ran into one problem with IIS 6.0 that prevented the full REST spec from being used. By default IIS 6 wouldn’t allow the PUT or DELETE verbs to be used with the WebAPI app that we created.

 

Page requests using GET and POST worked fine, but PUT and DELETE gave the following error:

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

In order to solve the issue I needed to add the ASP.NET 4.0 dll to the Wildcard mappings in the Configuration area on the Home Directory tab for the website. That fixed the problem for me. Here are the steps that I took to correct the issue in IIS.

1. Find the web site in the “Web Sites” folder in Internet Information Services (IIS) and right-click and select properties.

1

2. Go to the “Home Directory” tab and click the “Configuration…” button.

2

3. Find the .aspx extension in the “Application extensions” table, select it and press the “Edit…” button.

3

4. Copy the entire path and file name in the “Executable:” text box to the clipboard.  Press the “Cancel” button.

4

5. Press the “Insert…” button near the “Wildcard application maps” list box.  Paste the text from the clipboard into the “Executable:” text box and press “OK”.

5

6. Press OK on the Application Configuration dialog and again on the website properties box.

参考:

IIS WebDAV安全配置

http://stackoverflow.com/questions/9904897/iisnode-iis7-5-405-method-not-allowed-when-performing-put-request

http://www.cnblogs.com/artech/p/3606873.html

http://www.cnblogs.com/artech/p/web-api-sample.html

http://blog.csdn.net/forgotaboutgirl/article/details/6936982

转载于:https://www.cnblogs.com/Benoly/p/4142634.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值