title: ASP.NET Web API Route Controller Not Found
body: <p>I am trying to post to the following Web API: </p>
  
  <pre><code>http://localhost:8543/api/login/authenticate
  </code></pre>
  
  <p><strong>LoginApi (Web API) is defined below:</strong> </p>
  
  <pre><code>[RoutePrefix("login")]
  public class LoginApi : ApiController
  {
      [HttpPost]
      [Route("authenticate")]
      public string Authenticate(LoginViewModel loginViewModel)
      {  
          return "Hello World"; 
      }
  }
  </code></pre>
  
  <p><strong>WebApiConfig.cs:</strong> </p>
  
  <pre><code>public static void Register(HttpConfiguration config)
  {
      // Web API configuration and services
  
      // Web API routes
      config.MapHttpAttributeRoutes();
  
      config.Routes.MapHttpRoute(
          name: "DefaultApi",
          routeTemplate: "api/{controller}/{id}",
          defaults: new { id = RouteParameter.Optional }
      );
  }
  </code></pre>
  
  <p>Here is the error I get: </p>
  
  <pre><code>Request URL:http://localhost:8543/api/login/authenticate
  Request Method:POST
  Status Code:404 Not Found
  Remote Address:[::1]:8543
  </code></pre>