I got a solution:
tell axios to return a blob instead of a json
use FileReader object to convert blob to DataURL
jConfig = {
headers: { authorization: 'Bearer ' + _sIdmToken },
responseType: 'blob',
}
jResp = await axios.get(`${sMgr}/packages/${AppsID}/icon`, jConfig)
blob2DataURL(jResp.data, setImg, img)
function blob2DataURL(blob, callback, img) {
let fr = new FileReader()
fr.onload = function (e) {
callback(e.target.result, img)
}
fr.readAsDataURL(blob)
}
function setImg(dataURL, img) {
img.src=dataURL
}
... View more