码迷,mamicode.com
首页 > Windows程序 > 详细

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

时间:2014-12-04 13:55:43      阅读:716      评论:0      收藏:0      [点我收藏+]

标签:style   http   io   ar   color   os   sp   for   on   

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.

bubuko.com,布布扣

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

bubuko.com,布布扣

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

bubuko.com,布布扣

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

bubuko.com,布布扣

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”.

bubuko.com,布布扣

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

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

标签:style   http   io   ar   color   os   sp   for   on   

原文地址:http://www.cnblogs.com/Benoly/p/4142634.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!