title: Requesting blob images and transforming to base64 with fetch API
body: <p>I have some images that will be displayed in a React app. I perform a GET request to a server, which returns images in BLOB format. Then I transform these images to base64. Finally, i'm setting these base64 strings inside the src attribute of an image tag.</p>
  
  <p>Recently I've started using the Fetch API. I was wondering if there is a way to do the transforming in 'one' go.</p>
  
  <p>Below an example to explain my idea so far and/or if this is even possible with the Fetch API. I haven't found anything online yet.</p>
  
  <pre><code>  let reader = new window.FileReader();
    fetch('http://localhost:3000/whatever')
    .then(response =&gt; response.blob())
    .then(myBlob =&gt; reader.readAsDataURL(myBlob))
    .then(myBase64 =&gt; {
      imagesString = myBase64
    }).catch(error =&gt; {
      //Lalala
    })
  </code></pre>