📜  angular http 获取状态码 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:13.292000             🧑  作者: Mango

代码示例1
import { HttpClient, HttpHeaders, HttpParams, } from '@angular/common/http';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';



sendMsz(obj):Observable { 
 return this.http.get(this.urlSer.url,{responseType:'text', params:params, observe: 'response'}).pipe(map(data => {
      
      console.log("Here will be return response code Ex :200", data.status)
      return data.status
        }));
}