繁体   English   中英

读取 Angular 中状态为 302 时的响应 header

[英]Read the response header when the status is 302 in Angular

我如何读取 Angular (v8+) 中$http调用的XHR的响应 header,因为它的状态是 302 并且它被浏览器重定向? 在我的情况下,由于重定向 url 具有不同的来源,我只从下面的代码中得到一个未知错误:

return this.http.get('/oauth2/authorization/keycloak').pipe(
        map(res => {
          // never called
          console.log(res);
          return res;
        }),
        tap( res => {
          // never called
          console.log(res);
        }),
        catchError(err => {
          // prints "Unknown Error"
          console.log(err);
          return err;
        })
      );

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM