title: How to call a WebApi controller method?
body: <p>I've just created asp.net mvc 4 app and added default webapi controller</p>
  
  <pre><code>public class UserApiController : ApiController
  {
      // GET api/default1
      public IEnumerable&lt;string&gt; Get()
      {
          return new string[] { "value1", "value2" };
      }
  
      // GET api/default1/5
      public string Get(int id)
      {
          return "value";
      }
  
      // POST api/default1
      public void Post(string value)
      {
      }
  
      // PUT api/default1/5
      public void Put(int id, string value)
      {
      }
  
      // DELETE api/default1/5
      public void Delete(int id)
      {
      }
  }
  </code></pre>
  
  <p>Then i was trying to call method get() by typing <code>http://localhost:51416/api/get</code> in the browser but getting error:</p>
  
  <pre><code>&lt;Error&gt;
  &lt;Message&gt;
  No HTTP resource was found that matches the request URI 'http://localhost:51416/api/get'.
  &lt;/Message&gt;
  &lt;MessageDetail&gt;
  No type was found that matches the controller named 'get'.
  &lt;/MessageDetail&gt;
  &lt;/Error&gt;
  </code></pre>
  
  <p>my route config:</p>
  
  <pre><code>public static void RegisterRoutes(RouteCollection routes)
          {
              routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  
              routes.MapHttpRoute(
                  name: "DefaultApi",
                  routeTemplate: "api/{controller}/{id}",
                  //defaults: new { controller = "UserApiController", id = RouteParameter.Optional }
                  defaults: new { id = RouteParameter.Optional }
              );
  
              routes.MapRoute(
                  name: "Default",
                  url: "{controller}/{action}/{id}",
                  defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
              );
          }
  </code></pre>
  
  <p>Why it is not working by default?
  What can i do in order to fix that?</p>