0
我构建了一个REST API,它返回一个图像,并且我通过PostMan代理成功获取其响应。 在我的阵营代码,我有这样的:ReactJS:无法从REST API响应在UI中呈现图像
return fetch(url, sInit)
.then((response) => {
let blb = new Blob([response.body], { type: 'image/jpeg' });
let fileUrl = (window.URL || window.webkitURL).createObjectURL(blb);
window.open(fileUrl);
})
产生的不具有图像团块网址。我错过了什么?
你的答案是有很大帮助的,但是这并不在IE 8至11 –
没有工作你包含['fetch' polyfill](https://github.com/github/fetch)?这些浏览器的[fetch] [不支持](http://caniuse.com/#feat=fetch)。 –
请检查文档,在IE10及更高版本中支持'fetch',但任何版本的Internet Explorer都不支持'blob()'。 –