title: ajax DELETE method not allowed
body: <p>I am trying to delete user with scim service. </p>
  
  <p>When I call it through SoapUI and curl it works but when I create ajax call it returns 405 method not allowed</p>
  
  <p><strong>SOAPUI5</strong></p>
  
  <p><em>IP:</em>
  <a href="https://localhost:9447//wso2/scim/Users/token_of_user_to_be_deleted" rel="nofollow noreferrer">https://localhost:9447//wso2/scim/Users/token_of_user_to_be_deleted</a> </p>
  
  <p><em>OAUTH2 token:</em> my_token_for_oauth</p>
  
  <p><em>Media type:</em> application/json</p>
  
  <p><strong>CURL</strong> </p>
  
  <p>curl -v -k --user admin:admin -X DELETE <a href="https://localhost:9447/wso2/scim/Users/b228b59d-db19-4064-b637-d33c31209fae" rel="nofollow noreferrer">https://localhost:9447/wso2/scim/Users/b228b59d-db19-4064-b637-d33c31209fae</a> -H "Accept: application/json"</p>
  
  <p>This both worked and deleted the user.</p>
  
  <p><strong>AJAX DOESNT WORK FOR ME</strong></p>
  
  <pre><code>$.ajax({
      url: 'https://localhost:9447/wso2/scim/Users/token_of_user_to_be_deleted',
      type: 'DELETE',
      headers: { 'Content-Type':'application/json'},
      xhrFields: {
          withCredentials: true
      },
  
      beforeSend: function (request) {
              request.setRequestHeader('Authorization', 'Bearer ' + that.oauth2.loadToken().access_token);
      },
  
  
      success: function() {
          console.log("success")                        
      },
      error: function () {
          console.log("error")
      }
  });
  </code></pre>
  
  <p><strong>ERROR:</strong>
  Cross-Origin Resource Sharing (CORS) Filter: Unsupported HTTP method: DELETE</p>