title: Web API CORS Delete
body: <p>I am using Angular JS + CORS + Web API. I am able to make an HTTP request for GET, POST and PUT. However i am getting an error while making a request for "DELETE".</p>
  
  <p>"The requested resource does not support http method 'DELETE'."
  my web api code is:</p>
  
  <pre><code>public void Delete(int id)
          {
              //code to remove data from DB.
          }
  </code></pre>
  
  <p>and my WebApiConfig class has the following settings</p>
  
  <pre><code>public static void Register(HttpConfiguration config)
      {
          config.EnableCors(new EnableCorsAttribute("*", "*", "*"));
  
          config.Routes.MapHttpRoute(
              name: "DefaultApi",
              routeTemplate: "api/{controller}/{id}",
              defaults: new { id = RouteParameter.Optional }
          );
      }
  
  public IEnumerable&lt;Entity&gt; Get()
      {
          return &lt;List&lt;Entity&gt;&gt;;
      }
  </code></pre>
  
  <p>my client code is :</p>
  
  <pre><code>   $http({
          method: 'DELETE',
          url: 'http://example.com/api/&lt;controller&gt;/',
          data: {id :uId}
      }).success(function (data, status) {
          aleert('success');
      }).error(function (data, status) {
          alert('error');
      });
  
      $http({
          method: 'GET',
          url: 'http://example.com/api/&lt;controller&gt;'
      }).success(function (data, status) {
          alert('success');
      }).error(function (data, status) {
          alert('error');
      });
  </code></pre>
  
  <p>What am i missing? Any help is highly appreciated.</p>