I want to access an image from a remote URL and pass it into another API request as request body. I am using got stream API library to stream the data from the external url.

const url = "https://media0.giphy.com/media/4SS0kfzRqfBf2/giphy.gif";

got.stream(url).pipe(createWriteStream('image.gif'));

const response= await axsios.post('post_url',fs.createReadStream('image.gif');

The download operation is working as expected, but I don't want write the data to the local system.Instead, I woud like pass the response from the got stream API to another API as a request body.

0

There are 0 best solutions below