【发布时间】:2018-12-05 14:00:18
【问题描述】:
我在从响应中读取状态代码时遇到了一些问题。
我在服务中调用api,
return this.http.get<string>( this.remoteServer + '/google.com/open', httpOptions);
在我的控制器中,
open() {
this.openService.open(this.selected.qrCode)
.subscribe(
data => {
console.log(data);
this.toastService.showSuccess('Unlock Successfull', 'success');
}
);
}
现在我想阅读http状态文本,
我从上述调用中得到的示例 http 响应是。
HttpErrorResponse {headers: HttpHeaders, status: 200, statusText: “好的”,网址: “https://google.com/open”,好的: 错误,...}
如何读取控制器中的状态文本。
请帮帮我
【问题讨论】:
标签: angular http-headers httpresponse angular-httpclient