【发布时间】:2018-08-01 06:03:15
【问题描述】:
使用Http 时,我们从@angular/http 库中获得Response 的响应类型,类似地使用res.json() 转换为JSON
但是通过使用来自@angular/common/http 的HttpClient,我们得到直接的JSON 或HttpResponse 通过使用observe
是否有任何解决方法可以将类型从 Response 转换为 HttpResponse 或以任何其他方式从 HtpClient 获得响应,以便 .json() 可以工作?
【问题讨论】:
标签: angular http angular5 httpclient angular-httpclient