I need to download a .jpg image from a remote server and convert it into a base64 format. I\'m using axios as my HTTP client. I\'ve tried issuing a git request to the server
This is what works for me (with Buffer.from) -
Buffer.from
axios .get(externalUrl, { responseType: 'arraybuffer' }) .then(response => { const buffer = Buffer.from(response.data, 'base64'); }) .catch(ex => { console.error(ex); });