title: Bearer Token working on Postman but not on localhost
body: <p>I am trying to make a request in Angular with authorization with a bearer token. If I make the request in <a href="https://www.getpostman.com/" rel="nofollow noreferrer">Postman</a>, it works. But if I make it from Angular, it gives me the <a href="https://www.rfc-editor.org/rfc/rfc7235#section-3.1" rel="nofollow noreferrer"><code>401 Unauthorized</code></a> http error.</p>
  <p>I am sure that the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Storage/getItem" rel="nofollow noreferrer"><code>localstorage.getItem('auth_token')</code></a> is returning the right token, because I have logged it before to check.</p>
  <pre><code>const httpOptions = {
    headers: new HttpHeaders(
      { 'Content-Type': 'application/json' ,
      Authorization: 'Bearer '+ localStorage.getItem('auth_token')})
    };
  </code></pre>
  <p>This is the request I am trying to make that works on postman :</p>
  <pre><code> getProducts(): Observable&lt;string[]&gt; {
      console.log(localStorage.getItem('auth_token'));
      return this.http.get&lt;string[]&gt;(this.productsURL)
        .pipe(
          tap(_ =&gt; this.log('fetched products')),
          catchError(this.handleError('getProducts', []))
        );
    }
  </code></pre>