title: Access-Control-Allow-Origin error while
body: <p>I build a angular 4 application and back with REST API. 
  I have send http get request to get json data using API, but I faced following error:</p>
  
  <p>Failed to load <a href="http://localhost:50979/api/workflow" rel="nofollow noreferrer">http://localhost:50979/api/workflow</a>: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '<a href="http://localhost:4200" rel="nofollow noreferrer">http://localhost:4200</a>' is therefore not allowed access.</p>
  
  <p>When I added headers as per the following code :</p>
  
  <pre><code>let headers = new Headers({ 'Content-Type': 'application/json',crossDomain: true});
  let options = new RequestOptions({ headers: headers });
  return this.http.get(this.url, options)
             .subscribe(
              res =&gt;this.extractData,
              err =&gt; this.handleErrorObservable
            );
  </code></pre>
  
  <p>I have got following error :</p>
  
  <p>url : string = "<a href="http://rpa.commandcenter.com/api/workflow" rel="nofollow noreferrer">http://rpa.commandcenter.com/api/workflow</a>";
   let data = JSON.stringify(this.EditForm.value);            </p>
  
  <pre><code>let headers = new Headers({ 'Content-Type': 'application/json',crossDomain: true});
  let options = new RequestOptions({ headers: headers });
  return this.http.get(this.url, options)
             .subscribe(
              res =&gt;this.extractData,
              err =&gt; this.handleErrorObservable
            );
  </code></pre>
  
  <p>I can't recognize the problem.</p>