PUT & DELETE issues with IIS 7.5

Posted on 2012-09-17
Last Modified: 2013-03-18
Hey experts,

 I'm having an issue similar to the one in this link - - It happened on one of our servers after upgrading Plesk from 10 to 11 (it's not happening on other servers running Plesk 10 or in a local environment). And the issue is PUT & DELETE HTTP verbs not working when trying to call REST APIs.

We have a site that is calling REST APIs on via an API Proxy (<api_call> ). However, the call is NOT going from the proxy to the The error code returned is 404 [Not Found] (a bit different than the ones in the link); and we have calls from other subdomains (running flash swf) calling directly that are working normally after the upgrade to Plesk 11. I verified that everything mentioned in the forums.iis link is already done on our server (or else it wouldn't have worked before on Plesk 10); but still it seems that the Plesk upgrade messed up with some flag or permission.

Any help on it would be super great (The server is running IIS 7.5 on Windows Server 2008 R2 on a VPS machine, and both & are running on .NET 4.0).
Question by:mte01
    LVL 3

    Accepted Solution

    I fixed this by disabling WebDAV in IIS (I didn't see before an option to disable WebDav - it was only being removed in web.config).

    Expert Comment

    Hi mte01,
    what if I want to use WebDAV and RESTApi together?
    Disabling the whole WebDAV is not an option for me.
    LVL 3

    Author Comment


    If you want to use both, I'm not sure what you can do in this case :)

    Expert Comment

    >>If you want to use both, I'm not sure what you can do in this case :)
    WebDAV is installed, but for the site A it is deactivated and the site B has it activated.
    I want to use PUT DELETE for a REST API ( apicontroller), and added these verbs to be allowed in requests, but still get the 405 not allowed. MS website does not tell anything about deploying apicontroller websites to a production iis environment.
    But when you use the IIS Express to run the rest api, it is working... but not on the IIS7.5 in production environment.
    I guess it is not an issue to Plesk 11, because I get the same behavior on IIS7.5 that is not installed in a plesk environment.

    Expert Comment

    I have found the ASP.Net solution for this, to have WebDAV running an still can have REST Apis with CRUD operations.

    Original Post found at:

    using System.Net.Http;
    public class HttpMethodOverrideHandler : DelegatingHandler
       const string header = "X-Http-Method-Override";
       string[] methods = new string[] { "PUT", "DELETE" };
       protected override System.Threading.Tasks.Task<HttpResponseMessage> 
       SendAsync(HttpRequestMessage request, 
          System.Threading.CancellationToken cancellationToken)
          if (request.Method == HttpMethod.Post &&
             var realmethod = request.Headers.GetValues(header).FirstOrDefault();
             if (realmethod != null && methods.Contains(realmethod.ToUpperInvariant()))
                request.Method = new HttpMethod(realmethod);
          return base.SendAsync(request, cancellationToken);

    Open in new window

    and then add this in your Global.asax.cs file:

    GlobalConfiguration.Configuration.MessageHandlers.Add(new HttpMethodOverrideHandler());

    Open in new window

    Then you can do your REST PUT and DELETE requests as (I am using amplify.js here):

    amplify.request.define("restUpdate", "ajax", {
       url: "api/restapiurl",
       dataType: "json",
       type: "POST",
       contentType: "application/json; charset=UTF-8",
       beforeSend: function (xhr) {
          xhr.setRequestHeader("X-Http-Method-Override", "PUT"); // <= the magic header
          return true;
    var updateContactAmplify = function (callbacks, data) {
       return amplify.request({
          resourceId: 'restUpdate',
          data: data,
          success: callbacks.success,
          error: callbacks.error

    Open in new window


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
    Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now