I have API url, that send me in response an image. When i try to console.log my response i see something like that:
Please tell me what is the best way to display that raw-data in my page? What format of raw-data is it? I can not even google it, because I really don`t know what format is it.
const img = document.createElement('img');
document.body.appendChild(img);
const src = 'https://upload.wikimedia.org/wikipedia/commons/thumb/4/47/PNG_transparency_demonstration_1.png/280px-PNG_transparency_demonstration_1.png';
fetch(src)
.then(resp => resp.blob())
.then(blob => URL.createObjectURL(blob))
.then(uri => (img.src = uri));
<!-- Polyfill for older browsers -->
<script src="https://cdn.rawgit.com/github/fetch/master/fetch.js"></script>