title: $http.delete throwing error in angularJS
body: <p>I am making an api call to a <code>Delete</code> method like this - </p>
  
  <pre><code>$http.delete('http://localhost:45467/api/v1/proddetails/' + prodId, null )
      .success(function (data, status, headers, config) {
          if(data.status == "200")
          {
              console.log('data deleted');
          }
          deferred.resolve(data);
      })
      .error(function (data, status, headers, config) {
          console.log("some error occurred");
          deferred.reject(data);
      });
  </code></pre>
  
  <p>The delete endpoint looks like this - </p>
  
  <pre><code>[HttpDelete]
  public HttpResponseMessage Delete(int productId)
  </code></pre>
  
  <p>When I run this and look into the Chrome console, I am presented with this error - </p>
  
  <pre><code>OPTIONS http://localhost:45467/api/v1/proddetails/34 
  (index):1 XMLHttpRequest cannot load   
  http://localhost:45467/api/v1/proddetails/34. No 'Access-Control-Allow-  
  Origin' header is present on the requested resource. Origin 
  'http://localhost:5100' is therefore not allowed access. The response had 
  HTTP status code 405.
  </code></pre>
  
  <p>Can't seem to figure out what's wrong here. The other Get and Post requests are working fine. How to fix this?</p>
  
  <p><strong>Note1</strong>: I have CORS already enabled -</p>
  
  <pre><code>[EnableCors(origins: "*", headers: "*", methods: "*")]
  </code></pre>
  
  <p><strong>Note2</strong>: I am making use of <code>interceptors</code> to add an auth token to each request. I am not sure if that is causing any issue.</p>
  
  <p><strong>Note3:</strong> This is how I define route in asp.net webapiconfig file - </p>
  
  <pre><code>config.Routes.MapHttpRoute(
              name: "ProdApi",
              routeTemplate: "api/v1/{controller}/{id}",
              defaults: new { id = RouteParameter.Optional }
          );
  </code></pre>
  
  <p>Thanks in advance.</p>