title: Angular 4 Http POST not working
body: <p>I hope everyone is doing great. I've recently started working with angular 4.4, i've been trying to post data to my api server, but unfortunately it's not working. I've spent like 2 days on it but still no success. And have already tried 6-7 article even from <a href="https://angular.io" rel="noreferrer">angular.io</a>. 
  I've tried both <a href="https://angular.io/api/http/Http" rel="noreferrer"><strong>Http</strong></a> and <a href="https://angular.io/guide/http" rel="noreferrer"><strong>Httpclient</strong></a> modules
  but nothing seems to be working.</p>
  
  <p>The problem is, whenever i try to post data to my server, Angular makes http <strong>OPTIONS</strong> type request instead of  <strong>POST</strong>.</p>
  
  <pre><code>this.http.post('http://myapiserver.com', {email: 'adam@example.com'}).subscribe(
      res =&gt; {
          const response = res.text();
      }
  );
  </code></pre>
  
  <p>And i've also tried to send custom options with the request but still no success.</p>
  
  <pre><code>const headers = new Headers({ 'Content-Type': 'x-www-form-urlencoded' });
  const options = new RequestOptions({ headers: headers });
  options.method = RequestMethod.Post;
  options.body = {name: 'Adam Smith'};
  //options.body = JSON.stringify({name: 'Adam Smith'}); // i also tried this
  //options.body = 'param1=something&amp;param2=somethingelse'; // i also tried this
  </code></pre>
  
  <p>I was using ASP.NET core 2.0, but since it wasn't working i also tried simple php code, Here is the server side code for php. And it's also not working.</p>
  
  <pre><code>&lt;?php
  print_r($_POST);
  ?&gt;
  </code></pre>
  
  <p>Note: Cors are also enabled on server. Plus I also tried simple get request and its working perfectly fine.</p>
  
  <p>I'll really appreciate some help.</p>
  
  <p>Thanks in advance</p>