hmu332233 / tips

https://tips.minung.dev
1 stars 0 forks source link

image request를 base64로 가져오기 #4

Open hmu332233 opened 4 years ago

hmu332233 commented 4 years ago
function getBase64(url) {
  return axios
    .get(url, {
      responseType: 'arraybuffer'
    })
    .then(response => Buffer.from(response.data, 'binary').toString('base64'))
}