title: MVC Web API posting JSON data gives me a 404
body: <p>I have a Web API in MVC4. I'm getting a 404 when posting data using ajax and I don't understand why.</p>
  
  <p>LanguageController:</p>
  
  <pre><code>[AcceptVerbs("POST")]
  public void Delete(string id)
  {
      Guid guid = Guid.Parse(id);
  
      Language language = db.Languages.Find(guid);
      db.Languages.Remove(language);
      db.SaveChanges();
  
  }
  </code></pre>
  
  <p>Routing:</p>
  
  <pre><code>public static class WebApiConfig
  {
      public static void Register(HttpConfiguration config)
      {
          config.Routes.MapHttpRoute(
              name: "DefaultActionApi",
              routeTemplate: "api/{controller}/{action}/{id}",
              defaults: new { id = RouteParameter.Optional }
          );
  
          config.Routes.MapHttpRoute(
              name: "DefaultApi",
              routeTemplate: "api/{controller}/{id}",
              defaults: new { id = RouteParameter.Optional }
          );
  
          var appXmlType = config.Formatters.XmlFormatter.SupportedMediaTypes.FirstOrDefault(t =&gt; t.MediaType == "application/xml");
          config.Formatters.XmlFormatter.SupportedMediaTypes.Remove(appXmlType);
      }
  }
  </code></pre>
  
  <p>And javascript (using AngularJS):</p>
  
  <pre><code>this.delete = function (lang) {
      $http({
          method: "POST",
          url: "/api/language/delete",
          data: JSON.stringify({ id: lang.id })
      })
      .success(function (response) {
          return true;
      })
      .error(function (response) {
          return false;
      });
  };
  </code></pre>
  
  <p>I get this error message:</p>
  
  <pre><code>**{"Message":"No HTTP resource was found that matches the request URI 'http://localhost:32166/api/language/delete'.","MessageDetail":"No action was found on the controller 'Language' that matches the request."}**
  </code></pre>
  
  <p>I just don't understand why, it looks like it should work. I feel like I'm missing a piece of vital information.</p>