title: How to read Token from header of a response in angularjs
body: <p>I am implementing authentication where I added a token in response from server side.
  <a href="https://i.stack.imgur.com/2eAPz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2eAPz.png" alt="enter image description here"></a></p>
  
  <p>I am trying to read this header value returned from server in angularjs however I don't see this header value present. Here is my javascript console.
  <a href="https://i.stack.imgur.com/lZek0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lZek0.png" alt="enter image description here"></a></p>
  
  <p><strong>EDIT:</strong></p>
  
  <pre><code>return base.SendAsync(request, cancellationToken).ContinueWith(task =&gt;
              {
                  var response = task.Result;
                  if (response.RequestMessage.Headers.Contains(TOKEN_NAME))
                  {
                      string token = response.RequestMessage.Headers.GetValues(TOKEN_NAME).FirstOrDefault();
                      response.Headers.Add("Access-Control-Expose-Headers", TOKEN_NAME);
                      response.Headers.Add(TOKEN_NAME, token);
                  }
  
                  return response;
              });
  </code></pre>