title: CORS preflight channel did not succeed - client - server
body: <p>I'm building an application and was using the below test code to test out angular http.Post()</p>
  
  <p>But I am receiving a strange error that my preflight is not succeeding.</p>
  
  <p>The client code is below</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"&gt;&lt;/script&gt;
  &lt;body&gt;
  
  &lt;div ng-app="myApp" ng-controller="customersCtrl"&gt; 
  
  &lt;ul&gt;
      {{ names }}
  &lt;/ul&gt;
  
  &lt;/div&gt;
  
  &lt;script&gt;
  var app = angular.module('myApp', []);
  
  
  app.controller('customersCtrl', function($scope, $http) {
    $http.post("http://ec2-52-3-54-45.compute-1.amazonaws.com/api/user/dogs",{id:'hello word!'})
    .success(function (response) {
      $scope.names = response});
  });
  &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The .htaccess file on the other end is below</p>
  
  <pre><code>  Header set Access-Control-Allow-Methods "POST"
    Header set Access-Control-Allow-Origin "*"
  RewriteEngine On
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php [QSA,L]
  </code></pre>
  
  <p>And the PHP which should be handling this is</p>
  
  <pre><code>&lt;?php
  header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept');
  header( ‘Access-Control-Allow-Headers: Authorization, Content-Type’ );
  header("Access-Control-Allow-Origin: *");
  </code></pre>
  
  <p>I'm not sure why I am getting this error or what exactly I am doing wrong. Any help or insight is very much appreciated.</p>