title: API http call returns 401 Unauthorized with httpClient in Angular 5
body: <pre><code>return this.http.get&lt;any&gt;('https://test.p-44.com/api/v3/tl/shipments/'+id+'/statuses?includeMapUrl=true', {
        headers:
          new HttpHeaders()
            .append('Accept', 'application/json')
            .append('Content-Type', 'application/json')
            .append('Authorization', 'Basic ' + btoa("xxxxx:xxx"))
        , responseType: 'json'
      })
      .map((response: Response) =&gt; &lt;any&gt;response)
  </code></pre>
  
  <p>Here is my service call of the Api, this will return an error :</p>
  
  <p>Failed to load <a href="https://test.p-44.com/api/v3/tl/shipments/1252/statuses?includeMapUrl=true" rel="nofollow noreferrer">https://test.p-44.com/api/v3/tl/shipments/1252/statuses?includeMapUrl=true</a>: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '<a href="https://dev.18th-avenue.com" rel="nofollow noreferrer">https://dev.18th-avenue.com</a>' is therefore not allowed access. The response had HTTP status code 401.</p>
  
  <p>But this call will work perfectly fine on my locahost when I use a proxy config as :</p>
  
  <pre><code>const PROXY_CONFIG = [
    {
        context: [
            "/44",
        ],
        target: "https://test.p-44.com",
        secure: false,
        changeOrigin: true,
        pathRewrite: {"^/44" : ""}
  
    }
  ]
  module.exports = PROXY_CONFIG;
  
  
  return this.http.get&lt;any&gt;('/44/api/v3/tl/shipments/'+id+'/statuses?includeMapUrl=true', {
        headers:
          new HttpHeaders()
            .append('Accept', 'application/json')
            .append('Content-Type', 'application/json')
            .append('Authorization', 'Basic ' + btoa("pmorin@18th-avenue.com:Action18!"))
        , responseType: 'json'
      })
      .map((response: Response) =&gt; &lt;any&gt;response)
  </code></pre>
  
  <p>Do you have any idea why this proxy call works but the one without does not? I use IIS server, do I need to add a config there or something? When I will build my application on my server, I won't be able to use that proxy</p>
  
  <p>Thank you</p>