title: Angular 7 : Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested
body: <p>I have to implement an angular application with CURD operations. API is already hosted IN AWS, Which is working fine with Postman.</p>
  
  <p>But my angular application getting </p>
  
  <p>Access to XMLHttpRequest at '<a href="https://acp56df5alc.execute-api.us-east-" rel="noreferrer">https://acp56df5alc.execute-api.us-east-</a><strong>1.amazonaws.com/ams/getmember' from origin '<a href="http://localhost:4200" rel="noreferrer">http://localhost:4200</a>' 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.</strong></p>
  
  <p>My code is like below,</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>http_GET(actionUrl: string): Observable&lt;any&gt; {
          const httpOptions = {
              headers: new HttpHeaders({
                  'Content-Type': 'application/json',
                  'Access-Control-Allow-Origin': '*',
                  'Access-Control-Allow-Credentials': 'true',
                  'Access-Control-Allow-Headers': 'Content-Type',
                  'Access-Control-Allow-Methods': 'GET,PUT,POST,DELETE',
                  'key': 'x-api-key',
                  'value': 'NNctr6Tjrw9794gFXf3fi6zWBZ78j6Gv3UCb3y0x',
  
              })
          };
          return this.http.get&lt;any&gt;(this.baseUrl + actionUrl, httpOptions).pipe(
              (response =&gt; {
                  return response;
              }));
      }</code></pre>
  </div>
  </div>
  </p>
  
  <p>I have tried hard to solve this.But need some help</p>