0

My $http.delete call is failing with a 404 only when running on out development server - running the website from my own machine is fine.

Here's my code:

application.factory('Task', function ($http) {

    var Task = function (data) {
        angular.extend(this, data);
    }

    Task.deleteTask = function (id) {
        return $http.delete('/api/Tasks/' + id).then(function (response) {
            return response.data;
        });
    }

    Task.prototype.create = function () {
        var result = this;
        return result;
    }

    return Task;

});

Does anyone have an idea what might be the problem?

I'm running the website remotely on IIS 7 and using cassini locally (Visual Studio 2010).

I'm using angularjs from Google's CDN (https://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.min.js)

Thanks.

2
  • After further investigation this appears to be an IIS configuration issue - i.e. nothing to do with angularjs. Commented Sep 19, 2012 at 13:20
  • I managed to get this working and will provide an answer. Commented Sep 19, 2012 at 13:40

1 Answer 1

2

I got this working by adding the following into my web.config:

<system.webServer>
    <handlers>
      <remove name="ExtensionlessUrl-Integrated-4.0" />
      <add name="ExtensionlessUrl-Integrated-4.0"
           path="*."
           verb="GET,POST,DELETE,PUT"
           type="System.Web.Handlers.TransferRequestHandler"
           preCondition="integratedMode,runtimeVersionv4.0" />
    </handlers>
</system.webServer>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.