I am trying to send a image from the internet to an API using multipart/form-data
.
I was able to do this by saving the image in a temp folder using request.pipe(fs.createWriteStream)
and upload using fs.createReadStream
But how can i do this without saving it in a temp folder?
I tried creating a new request
and sending the body as a new Buffer
but didn't work.
Extra information:
I am implementing the Telegram Bot API method sendPhoto: https://core.telegram.org/bots/api#sendphoto
I am using the request module for the integration: https://github.com/request/request
Thanks.