DEV Community

Discussion on: How to get token passed in header?

Collapse
 
sylvainmetayer profile image
Sylvain METAYER

See this SO answer, header can be accessed from the response class : stackoverflow.com/a/44292610

http.get('/path/to/resource')
  .subscribe((res:Response) => {
    console.log(res.headers);
    // you can assign the value to any variable here
  });
Collapse
 
dreamcatcher8055 profile image
Akhil Ashok

sorry bro i didnt get the answer in this way