title: WebApi 2 Http Post 405 "The requested resource does not support http method 'POST'"
body: <p>I have looked throw all StackOverflow, but didn`t find solution for my case
  I have 405 HttpStatusCode calling API/Regions/Create action
  Here is my baseController method:</p>
  
  <pre><code> [HttpPost]
          public virtual IHttpActionResult Create([FromBody]T entity)
          {
              try
              {
                  repository.Create(entity);
  
                  return Ok(entity);
              }
              catch (HttpException e)
              {
                  return new ExceptionResult(e, this);
              }
          }
  </code></pre>
  
  <p>RegionController.cs</p>
  
  <pre><code>public class RegionsController : BaseController&lt;Region, RegionRepository&gt;
  {
      public RegionsController()
      { }
      public RegionsController(RegionRepository _repository)
      {
          RegionRepository repository = new RegionRepository();//_repository;
      }
  
      RegionRepository repository = new RegionRepository();
  
      [HttpGet]
      [Route("api/regions/{name}")]
      public IHttpActionResult Get(string name)
      {
          try
          {
              var region = repository.Get(name);
  
              return Ok(region);
          }
          catch (HttpException e)
          {
              return new ExceptionResult(e, this);
          }
      }
  }
  </code></pre>
  
  <p>WebApi config:</p>
  
  <pre><code>      public static class WebApiConfig
      {
          public static void Register(HttpConfiguration config)
          {
              // Web API configuration and services
              // Configure Web API to use only bearer token authentication.
              // Web API configuration and services
              var cors = new EnableCorsAttribute("*", "*", "*");
              config.EnableCors(cors);
  
  
              config.SuppressDefaultHostAuthentication();
              config.Filters.Add(new HostAuthenticationFilter(OAuthDefaults.AuthenticationType));
  
  
              // Web API routes
              config.MapHttpAttributeRoutes();
  
              config.Routes.MapHttpRoute(
                  name: "DefaultApi",
                  routeTemplate: "api/{controller}/{id}",
                  defaults: new { id = RouteParameter.Optional }
              );
          }
      }
  }
  </code></pre>
  
  <p>Global.asax:</p>
  
  <pre><code>    public class WebApiApplication : System.Web.HttpApplication
          {
              private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
              protected void Application_Start()
              {
                  logger.Info("Application Start");
                  AreaRegistration.RegisterAllAreas();
                  GlobalConfiguration.Configure(WebApiConfig.Register);
                  FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
                  RouteConfig.RegisterRoutes(RouteTable.Routes);
                  BundleConfig.RegisterBundles(BundleTable.Bundles);
  
                 //GlobalConfiguration.Configuration.MessageHandlers.Add(new CorsHandler());
              }
  
              //protected void Application_BeginRequest(object sender, EventArgs e)
              //{
              //    HttpContext.Current.Response.AddHeader("Access-Control-Allow-Origin", "*");
              //    //if (HttpContext.Current.Request.HttpMethod == "OPTIONS")
              //    //{
              //        HttpContext.Current.Response.AddHeader("Access-Control-Allow-Methods", "POST, PUT, DELETE");
  
              //        HttpContext.Current.Response.AddHeader("Access-Control-Allow-Headers", "Content-Type, Accept");
              //        HttpContext.Current.Response.AddHeader("Access-Control-Max-Age", "1728000");
              //        HttpContext.Current.Response.End();
              // //   }
              //}
  
              private void Application_Error(object sender, EventArgs e)
              {
  
                  var lastException = Server.GetLastError();
  
                  NLog.LogManager.GetCurrentClassLogger().Error(lastException);
  
              }
  
  
          }
  }
  </code></pre>
  
  <p>and Web.Config:</p>
  
  <pre><code>      &lt;system.web&gt;
      &lt;authentication mode="None" /&gt;
      &lt;compilation debug="true" targetFramework="4.5.2" /&gt;
      &lt;httpRuntime targetFramework="4.5.2" /&gt;
      &lt;httpModules&gt;
        &lt;add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" /&gt;
      &lt;/httpModules&gt;
    &lt;/system.web&gt;
    &lt;system.webServer&gt;
      &lt;modules runAllManagedModulesForAllRequests="true"&gt;
        &lt;remove name="WebDAVModule" /&gt;
      &lt;/modules&gt;
      &lt;handlers&gt;
        &lt;remove name="WebDAV" /&gt;
        &lt;remove name="ExtensionlessUrlHandler-Integrated-4.0" /&gt;
        &lt;add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT" type="System.Web.Handlers.TransferRequestHandler" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv4.0" /&gt;
      &lt;/handlers&gt;
  </code></pre>
  
  <p>Any suggestions what might be wrong?</p>