title: get headers from get Http request in Angular
body: <p>I'm making a call to an API that gets blob data.</p>
  
  <p>back end sends to me also file name in header.</p>
  
  <p>My actual problem is that I can't get header from the api.</p>
  
  <p>Here's my <strong>service.ts</strong></p>
  
  <pre><code>public openFile(path) {
    let url='/download/';
    let pathFile= new HttpParams().set('pathFile', path);
    return this.httpClient.get(url,{params:pathFile, responseType: 'blob' });
  </code></pre>
  
  <p>and in <strong>component.ts</strong> I call the service. when I try to print the <code>res.headers</code> I get undefined in console.</p>
  
  <pre><code>openFile(path){
    this.creditPoliciesService.openFile(path).toPromise().then (data =&gt; {
      console.log("dataaaaaa",data.headers); // undefined
      var blob = new Blob([data], {type: 'application/pdf'}); 
      if (window.navigator &amp;&amp; window.navigator.msSaveOrOpenBlob) {
        window.navigator.msSaveOrOpenBlob(blob);
      }
      else {
        var fileURL = URL.createObjectURL(blob); 
        window.open(fileURL);
      }
    });
  }
  </code></pre>
  
  <p>In the dev tool admin I get informations in response header but I'm not able to find them in the response variable.</p>