Cross Domain POST request not Working
<p>Cross Domain POST request not Working,</p>

<p>AngularJS POST request to Drupal is not working</p>

<p><em>Error: OPTIONS details : 405 Method Not Allowed</em></p>

<p>My AngularJS code:</p>

<pre><code>  var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://d8v3.local/user/data",
    "method": "POST",
    "headers": {
      "content-type": "*",
      "authorization": "Basic "+authdata,
      "cache-control": "no-cache",
    }
  }

    $.ajax(settings).done(function (response) {          
      // my func
    });
</code></pre>

<p>My Request Header:</p>

<pre><code>OPTIONS /user/data HTTP/1.1
Host: d8v3.local
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Access-Control-Request-Method: POST
Access-Control-Request-Headers: authorization,cache-control,content-type
Origin: http://headless.local
Connection: keep-alive
</code></pre>

<p>Response Header:</p>

<pre><code>HTTP/1.1 405 Method Not Allowed
Date: Thu, 04 Feb 2016 13:45:33 GMT
Server: Apache/2.4.17 (Win64) PHP/7.0.0
x-content-type-options: nosniff, nosniff
x-powered-by: PHP/7.0.0
Cache-Control: must-revalidate, no-cache, post-check=0, pre-check=0, private
Allow: GET, POST
x-ua-compatible: IE=edge
Content-Language: en
X-Frame-Options: SAMEORIGIN
Expires: Sun, 19 Nov 1978 05:00:00 GMT
X-Generator: Drupal 8 (https://www.drupal.org)
Access-Control-Allow-Origin: *
access-control-allow-credentials: true
access-control-allow-methods: GET, PUT, POST, DELETE, OPTIONS
Access-Control-Allow-Headers: DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type
Content-Length: 68
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=UTF-8
</code></pre>