我想将一个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);
...
有没有一种解决方案可以在这些方法得到实现之前使用?