title: How to get the response header of a HttpClient.Post request in Angular
body: <p>I am using angular 7 and i need to get "Response Header" from the given API in service file without using "subscribe". please help me in this</p>
  
  <p>i have tried by using many google answers but none of them worked.I am not able use subscribe in service.ts file because i am getting error in component.ts file as we can t use subscribe two times</p>
  
  <pre><code>login(email: string, password: string ) {
  this.email = email;
  this.password = password;
  
  
  return this.http.post&lt;any&gt;(`this.url/auth/login`, { email, password})
  .pipe(map(user =&gt; {
  var currentuser:any = { user: user.user, token: user.token};
  if (currentuser &amp;&amp; user.token) {
  localStorage.setItem('currentUser', JSON.stringify(currentuser));
  this.currentUserSubject.next(currentuser);
   }
  return user;
   }));
  </code></pre>
  
  <p>}</p>
  
  <p>Expected result :</p>
  
  <p>need to get ""response header for the above api ..
  <strong>Note</strong> : "Response header" means -- content length , token ,Content-Type , Etag, etcc</p>
  
  <p>Actual result :</p>
  
  <p>I am getting only the body for this not headers</p>