Cant get headers of response in angular 5

前端 未结 3 1396
深忆病人
深忆病人 2021-01-14 13:44

I make a post request to a server which responds with two headers that are important for the client: username and access-token. The Network Tab of the Chrome debug tool disp

3条回答
  •  花落未央
    2021-01-14 14:04

    normally the response is just the 'body', while you want the 'headers'. on the res you could use:

    this.header = res.headers.get('header-name');
    

提交回复
热议问题