如何检索从angularjs Ajax调用的响应报头中的授权令牌?报头、令牌、angularjs、Ajax

由网友(浅墨惜晨)分享简介:基本上标题描述了一切。我发送一个API调用,得到响应,以授权的头,我想是因为它是需要subsuquent API调用从标题检索此授权令牌。我应该如何得到这个信息?Basically the title has described everything. I send an api call, get a respon...

基本上标题描述了一切。我发送一个API调用,得到响应,以授权的头,我想是因为它是需要subsuquent API调用从标题检索此授权令牌。我应该如何得到这个信息?

Basically the title has described everything. I send an api call, get a response, with Authorization in the header, and I want to retrieve this authorization token from the header because it is needed for subsuquent api calls. How should I get this info?

推荐答案

您应该看看这里:的 https://docs.angularjs.org/api/ng/service/$http

$http.get('yourUrl').
  success(function(data, status, headers, config) {
    console.log(headers);
  })
阅读全文

相关推荐

最新文章