Skip to content

Instantly share code, notes, and snippets.

View Aleph-y's full-sized avatar

Aleph Mora Aleph-y

  • 01:51 (UTC -06:00)
View GitHub Profile
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');