title: How to enable CORS when sending http post request from Angular2 app
body: <p>When I tried to send http request, I got this error about CORS.</p>
  
  <pre><code>XMLHttpRequest cannot load 'sever-domain'. 
  Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. 
  Origin 'my-firebsase-hosted-app-domain' is therefore not allowed access.
  </code></pre>
  
  <p>Then I set headers to my http request like this.</p>
  
  <pre><code>let headers = new Headers(
    {
      'Access-Control-Allow-Origin': '*',
      'Content-Type': 'application/x-www-form-urlencoded'
     }
  );
  let options = new RequestOptions({ headers: headers });
  this.postRequestSub = this._http.post(this.url, body, options);
  </code></pre>
  
  <p>But I still have the same error, isn't this a correct way to solve it?</p>