[整理]IIS 6.0 下部署 Asp.net MVC Web Api 後 HTTP PUT and DELETE 請求失敗

來源:互聯網
上載者:User

標籤: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.


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

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

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

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

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 請求失敗

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.