title: Angular HTTP POST request give me a CORS error, but the Status Code is 200 and I can see the JSON in Chrome Network tab
body: <p>I need to get data from a third part server. They gave me the URL and params (provider &amp; token). I made a simple HTTP POST request but I don't get the JSON. I tried with an online API Client and it works. Then tried with POSTMAN and it works too. The problem is with my Angular App. I get a CORS error, but when I go to the Network Tab, the Status Code is 200 and I can see the JSON response in the Preview and Response tabs.</p>
  
  <p>What could I have forgotten?</p>
  
  <p>I've tried with ReqBin (online HTTP/REST/SOAP API client) and POSTMAN... both worked! </p>
  
  <p>I'm serving the app in <em>HTTPS</em> localhost</p>
  
  <p><strong>* SERVICE *</strong></p>
  
  <pre><code>  getBookings(): Observable&lt;any&gt; {
      const url = 'https://myprovider.com/api/bookings/';
      const params = 'provider=999&amp;token=c56fgfgb5443rffhu5677';
      const options = { headers: new HttpHeaders({
        'Content-type': 'application/x-www-form-urlencoded',
      })};
      return this._http.post(url, params, options)
        .pipe(
          tap(_ =&gt; console.log('Bookings loaded')),
          map((value) =&gt; value),
          catchError(this.handleError('Error = ', []))
        );
    }
  </code></pre>
  
  <p><strong>* COMPONENT *</strong></p>
  
  <pre><code>  getDataFromServer(): void {
      this.bookingService.getBookings().subscribe(
        response =&gt; {
          this.bookings = response;
          console.log(this.bookings);
        }
      );
    }
  </code></pre>