【发布时间】:2016-07-05 08:54:07
【问题描述】:
我想将 REST 响应复制到 blob 中,但我无法执行某些操作,因为 blob() 和 arrayBuffer() 尚未在响应对象中实现。响应正文是一个私有变量。
...
return this.http.get(url, {params: params, headers: headers})
.map(res => {
// can't access _body because it is private
// no method appears to exist to get to the _body without modification
new Blob([res._body], {type: res.headers.get('Content-Type')});
})
.catch(this.log);
...
在这些方法实施之前,我有什么可以使用的解决方案吗?
【问题讨论】:
标签: rest angular blob httpresponse angular2-http