簡體   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