title: No 'Access-Control-Allow-Origin' header error for an api from an external server in angular
body: <p>I want to have an API with an external server. When I do with postman program, it's easy to answer. But when I do this in Angular code, it response following error:</p>
  
  <pre><code>Access to XMLHttpRequest at 'https://api.smartship.io/ship/rates' from origin 'http://127.0.0.1:4200' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
  </code></pre>
  
  <p>MY service:</p>
  
  <pre><code>let api_url = this.api_url_flagship + '/con';
  let headers = new HttpHeaders({
    'x-smartship-token': this.token_flagship,
    'Content-Type': 'application/json'
  });
  
  const httpOptions = {
      headers
  };
  
  
  return this.httpClient.post(api_url, data, httpOptions)    
    .map(
      (response: Response) =&gt; {
        const data = response.json();
        return data;
      }
    )
    .catch(
      (error: Response) =&gt; {
      let rr = error.json();
      return Observable.throw(rr);
    }
  );
  </code></pre>