I want to download a file from an url with got library, this is my current code:
var data
try
{
var stream = got.stream (url)
stream.on ('data', d => data += d)
stream.end ()
}
catch (error)
{
console.error (error)
}
But i'm getting this error:
TypeError: The payload has been already provided