title: Web API 404 Error
body: <p>I am getting 404 Error while calling web api method...</p>
  
  <p>below is my code</p>
  
  <p>Web API Controller:</p>
  
  <pre><code>[EnableCors(origins: "*", headers: "*", methods: "*")]
  public class HomeController : ApiController
  {
      private  HomeDataProvider homeDataProvider = new HomeDataProvider();
  
      // GET api/&lt;controller&gt;
      [AllowAnonymous]
      public IEnumerable&lt;string&gt; Get()
      {
          return new string[] { "value1", "value2" };
      }
  
  [AllowAnonymous]
      [HttpPost]
      //[Authorization]
      public List&lt;User&gt; Test_API(HomeSearch searchParam)
      {
          List&lt;User&gt; Test_User = null;
          try
          {
              Test_User = homeDataProvider.Test_DataProvider(searchParam);
          }
          catch (Exception ex)
          {
              throw ex;
          }
          finally
          {
  
          }
          return Test_User;
      }
  </code></pre>
  
  <p>Web API Config</p>
  
  <pre><code>        // Web API configuration and services
  
          // Web API routes
          config.MapHttpAttributeRoutes();
  
          config.Routes.MapHttpRoute(
              name: "API Default",
              routeTemplate: "webapi/{controller}/{id}",
              defaults: new { id = RouteParameter.Optional }
          );
      }
  }
  </code></pre>
  
  <p>Web API Web.config</p>
  
  <pre><code>      &lt;appSettings&gt;&lt;/appSettings&gt;
    &lt;system.web&gt;
      &lt;compilation debug="true" targetFramework="4.5.2" /&gt;
      &lt;httpRuntime targetFramework="4.5.2" /&gt;
          &lt;roleManager enabled="false" /&gt;
      &lt;!--&lt;roleManager defaultProvider="AspNetWindowsTokenRoleProvider" 
  enabled="true" /&gt;--&gt;
    &lt;/system.web&gt;
    &lt;system.webServer&gt;
    &lt;validation validateIntegratedModeConfiguration="false" /&gt;
    &lt;modules runAllManagedModulesForAllRequests="true"&gt;
  &lt;/modules&gt;
    &lt;handlers&gt;
     &lt;/handlers&gt;
  
        &lt;/system.webServer&gt;
  
  I am using windows 10, vs 2015, iis 10
  url i am calling
  http://localhost/webapi/home/get
  Error: 404, static handler error
  </code></pre>
  
  <p>I searched and tried all options on stackoverflow and other sources but all in vain</p>