title: Angular4 app with PHP Api CORS request issue
body: <p>I am trying to POST in Angular4 Ionic application, i have read all of the stack overflow posts and done what they say. In my PHP i have added </p>
  
  <pre><code>header ("Access-Control-Allow-Origin: *");
  header ("Access-Control-Expose-Headers: Content-Length, X-JSON");
  header ("Access-Control-Allow-Methods: GET, POST, PATCH, PUT, DELETE, OPTIONS");
  header ("Access-Control-Allow-Headers: *");
  </code></pre>
  
  <p>I am able to do the post from POSTMAN successfully but from debugging app in android i get <code>...from origin 'http://localhost:8100' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.</code></p>
  
  <p>I'm just trying a simple post in angular4 ionic app..</p>
  
  <pre><code>getImages() {
         this.http.post(url, {
        title: 'foo',
        body: 'bar',
        userId: 1
      })
        .subscribe(
          res =&gt; {
            console.log(res);
          },
          err =&gt; {
            console.log("Error occured");
          }
        );
      }
  </code></pre>