jQuery Ajax删除404错误

I've been trying to do a 'DELETE' call on an API for a while and it never worked. I can access the URI and see the JSON. And I've tried other web services which properly make the DELETE call. On my local machine and on Heroku, I can't get it to work. Any idea what's wrong here?

I've tried adding headers and such.

$.ajax({
      url : url,
      type : 'DELETE',
      beforeSend : function(xhr) {
            xhr.setRequestHeader("Content-Type", "text/html");
            xhr.setRequestHeader("Accept", "*/*");
          },
      crossDomain: true,
      success : function(data) {
        console.log("gone");
      },
      error : function(){
        console.log("ohcrap");
      }
    });

It turned out to be CORS problem from the server. It didn't have preflight setup so Ajax wasn't allowed to make the request, but anything from the server was fine.