This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function getImageData() { | |
try { | |
const response = await axios.get('https://tu-endpoint.com', { | |
headers: { | |
'Authorization': 'Bearer tu_token_de_autorizacion' | |
}, | |
responseType: 'arraybuffer' // Especifica el tipo de respuesta como un arraybuffer | |
}); | |
const imgData = Buffer.from(response.data, 'binary').toString('base64'); |