title: Angular2-Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource
body: <p>I am calling a http post in Angular 2. This is working fine in post man but when I implement this API call in Angular 2 I get No 'Access-Control-Allow' error. Here is my code</p>
  
  <pre><code>getInspections(): Observable&lt;IInspection[]&gt; {
          if (!this.inspections) {
              let body =JSON.stringify({"Statuses":["Submitted", "Opened"]});
              let headers = new Headers({ 'Content-Type': 'application/json' });
  
              headers.append('Access-Control-Allow-Origin','*');
              let options = new RequestOptions({ headers: headers });
  
              return this.http.post(this._baseUrl + '/api/Inspect/ListI',body,options)
                  .map((res: Response) =&gt; {
                      this.inspections = res.json();
                      return this.inspections;
                  })
                  .catch(this.handleError);
          }
          else {
              //return cached data
              return this.createObservable(this.inspections);
          }
      }
  </code></pre>
  
  <p>Or can I do this? Just pass header instead of options</p>
  
  <pre><code>getInspections(): Observable&lt;IInspection[]&gt; {
          if (!this.inspections) {
              let body =JSON.stringify({"Statuses":["Submitted", "Opened"]});
              let headers = new Headers({ 'Content-Type': 'application/json' });
  
              //headers.append('Access-Control-Allow-Origin','*');
            //  let options = new RequestOptions({ headers:headers });
  
              return this.http.post(this._baseUrl + '/api/Inspect/ListI',body,headers)
                  .map((res: Response) =&gt; {
                      this.inspections = res.json();
                      return this.inspections;
                  })
                  .catch(this.handleError);
          }
          else {
              //return cached data
              return this.createObservable(this.inspections);
          }
      }
  </code></pre>