title: Response for preflight has invalid http status code 404 in my angular project while consuming web api
body: <p>I know that it's CORS problem. I have enabled cors in web api server side. Get method is working fine but while dealing with post method I am facing problem . Please some one answer me with very simple post example both on web api and client side. With explanation of how to deal with preflight, options etc..</p>
  
  <p>Console</p>
  
  <p>1) zone.js:2935 OPTIONS <a href="http://localhost:49975/api/Add_Client_/postgoals" rel="nofollow noreferrer">http://localhost:49975/api/Add_Client_/postgoals</a> 404 (Not Found)</p>
  
  <p>2) Failed to load <a href="http://localhost:49975/api/Add_Client_/postgoals" rel="nofollow noreferrer">http://localhost:49975/api/Add_Client_/postgoals</a>: Response for preflight has invalid HTTP status code 404.</p>
  
  <p>web.config</p>
  
  <pre><code>&lt;httpProtocol&gt;
    &lt;customHeaders&gt;
      &lt;add name="Access-Control-Allow-Origin" value="*"/&gt;
      &lt;add name="Access-Control-Allow-Headers" value="Origin, Content-Type, X-Auth-Token"/&gt;
      &lt;add name="Access-Control-Allow-Methods" value="GET, POST, PUT, DELETE, OPTIONS" /&gt;
      &lt;add name="Content-Type" value="application/json"/&gt;
  
      &lt;add name="Access-Control-Allow-Credentials" value="true" /&gt;
    &lt;/customHeaders&gt;
  &lt;/httpProtocol&gt;
  </code></pre>
  
  <p>Angular Post method</p>
  
  <pre><code>    save_Goals(){
  
    let headers : Headers= new Headers();
    //headers.append('Content-Type','application/x-www-form-urlencoded');
    //headers.append("Access-Control-Allow-Origin","true");
    headers.append('Content-Type', 'application/json');
  
    headers.append('Access-Control-Allow-Origin','*');
    headers.append('Access-Control-Allow-Methods','GET,PUT,POST,DELETE');
    headers.append('Access-Control-Allow-Headers','Content-Type');
  
    let options = new RequestOptions({ headers: headers });
  
      return this._http.post('http://localhost:49975/api/Add_Client_/postgoals', {goal:'foo'},options)
     .map(res =&gt;  res.json());
    }
  </code></pre>
  
  <p>Thank you!</p>