title: WebApi2 Requested resource does not support post
body: <p>I've read a ton of similar posts that describe the same error message but they don't seem to match what i'm experiencing.</p>
  
  <p>I have recently started using Web API and ripped all my MVC methods out where I was returning JSON etc, so MVC will just render the html and I will call down the models via ajax from my webapi controllers.</p>
  
  <p>Here's the strange thing, I can GET and POST from my Home apiController (so I can login/signup etc) but I can only GET from an API Controller in an area I have created.  I get a 405 (Method Not Allowed) even though its decorated and called the same way as other controller.  I guess the routing is okay otherwise it wouldn't return my initial get? </p>
  
  <p>Routing</p>
  
  <pre><code> public static void Register(HttpConfiguration config)
      {
          config.Routes.MapHttpRoute(
              name: "DefaultAreaApi",
              routeTemplate: "api/{area}/{controller}/{action}/{id}",
              defaults: new { id = RouteParameter.Optional }
          );
  
          config.Routes.MapHttpRoute(
              name: "DefaultApi",
              routeTemplate: "api/{controller}/{action}/{id}",
              defaults: new { id = RouteParameter.Optional }
          );
      }
  </code></pre>
  
  <p>Controller</p>
  
  <pre><code> // Returns Model
   [HttpGet]
   public HttpResponseMessage SelectAgent()
  
   // The requested resource does not support http method 'POST'. 
   [HttpPost]
   public HttpResponseMessage SelectAgent(Guid id)
  </code></pre>
  
  <p>JQuery</p>
  
  <pre><code> // Works fine
      $.ajax({
              type: 'POST',
              url: '/api/Home/Login',
              headers: options.headers,
              contentType: "application/json; charset=utf-8",
              dataType: 'JSON',
              data: ko.toJSON(self.serverModel),
              success: function (response) {
  
     // Works fine
     $.getJSON("/api/Account/Users/SelectAgent", function (model) { ....
  
     // 405 
      $.ajax({
          type: 'POST',
          url: '/api/Account/Users/SelectAgent',
          headers: options.headers,
          contentType: "application/json; charset=utf-8",
          dataType: 'JSON',
          data: "{'id':'" + selectModel.agentId() + "'}",
          success: function (response) {....
  </code></pre>
  
  <p>data being passed seems fine (or at least it was for the MVC controller that it used to work with).</p>
  
  <p>I haven't modified the Home API Controller at all, I don't understand how I can post to that and not my other controller. Argh.</p>
  
  <p>Any pointers in the right direction would be awesome.</p>