title: 405 method not allowed .Net Web Api
body: <p>This issue is killing me, and no matter what I tried, I can't seem to fix it.
  I have an Angular 4 application sending Http requests to a .Net WEB Api. On IIS Express (via Visual Studio 2013), everything was working fine, including Get, Put and Post methods. As soon as I configured the Web Api on a IIS server or even the local IIS, Get method was still working, but Put and Post stopped working.</p>
  
  <p>My request:</p>
  
  <pre><code>     headers.append('Content-Type', 'application/json');
       return this.http.put('http://iisserver/dbServerMonitor/api/server/updateServer', this.serversService.getServer(index), {headers: headers});
  </code></pre>
  
  <p>WebConfig.Cs</p>
  
  <pre><code>    public static void Register(HttpConfiguration config)
      {
          //Enable cors
          var cors = new EnableCorsAttribute("*", "accept, accesstoken, autorization, cache-control, pragma, content-type, origin", "GET, PUT, POST, DELETE, OPTIONS");
          // Web API configuration and services
          //var cors = new EnableCorsAttribute("*", "*", "*");
          //config.MessageHandlers.Add(new CorsHandler());
  
          config.EnableCors(cors);
          // Web API routes
          config.MapHttpAttributeRoutes();
          config.Formatters.JsonFormatter.SupportedMediaTypes.Add(new MediaTypeHeaderValue("text/html"));
          config.Routes.MapHttpRoute(
              name: "DefaultApi",
              routeTemplate: "api/{controller}/{id}",
              defaults: new { id = RouteParameter.Optional }
          );
      }
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>    [HttpPut]
      [Route("updateServer")]
      public HttpResponseMessage updateServer([FromBody] Server server)
      {
        ....code
  </code></pre>
  
  <p>And I also have in the controller:</p>
  
  <pre><code>    [HttpOptions]
      public HttpResponseMessage Options()
      {
          return new HttpResponseMessage { StatusCode = HttpStatusCode.OK };
      }
  </code></pre>
  
  <p>I tried everything from changing the headers, removing them altogether from the request code, dealing with the CORS on the web config xml file but eventually it only worked on the cs file. I'm totally clueless on how to solve this.</p>
  
  <p><strong>Edit:</strong> After getting rid of authentication, I am now able to successfully call Post and Put on my local IIS. However, on a different IIS server (same domain), I get a 404 on Put and Post calls. Help, please.</p>