let dataFile = new Blob([response.data], {type: 'application/json'});
Within the response.data
is a JSON file. My goal is to extract the contents of this file and set them as a JSON string to a variable in JavaScript.
I've experimented with different methods like FileReader.readAsText(dataFile)
but I'm struggling to convert it into a simple JSON string.
On a side note, the response.data
is in arraybuffer format. So, if there is a more direct conversion method available without having to create a Blob object, that would also resolve the issue.