axios get image
const { data } = await axios.get<any, AxiosResponse<ArrayBuffer>>(imageUrl, { responseType: "arraybuffer", }); const imageBuffer = Buffer.from(data);
axios imgbb
uploadImage(img) { let body = new FormData() body.set('key', 'an_api_key') body.append('image', img) return axios({ method: 'post', url: 'https://api.imgbb.com/1/upload', data: body }) }
Source: stackoverflow.com