Shivanand Arur

Shivanand Arur

  • NA
  • 3.6k
  • 1.4m

Web API - PUT Operation does not work on Production

Nov 11 2013 11:54 AM
Hello friends, I need your help regarding an issue in Web API. I am performing some CRUD operations in my web application. The GET, POST, PUT and DELETE functionality works fine on my local machine. Also when I uploaded my application on the Server and tried to run the app locally on the Server, it worked....

Whereas after publishing the site, when I try to update(PUT OPERATION) any information the app gives me a 404 error.... Well I followed this link for some configuration in IIS on my Server, but the issue still remains.

http://geekswithblogs.net/michelotti/archive/2011/05/28/resolve-404-in-iis-express-for-put-and-delete-verbs.aspx

I also checked the routes, and everything looks fine. This is how my WebAPI route looks....

public static void Register(HttpConfiguration config)
{
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);

config.Routes.MapHttpRoute(
name: "NewActionApi",
routeTemplate: "api/{controller}/{action}/{url}",
defaults: new { id = RouteParameter.Optional }
);
}

Please help if possible. The GET, PUT, POST and DELETE operations work fine locally but the PUT operation fails on Production. Please help. Let me know if you need any more information.

Thank you. 

Answers (1)