Всё делаю как в доках
https://tinypng.com/developers/reference
let img = fs.readFileSync('public/img/logo.jpg');
var options = {
body: img,
headers: {
Authorization: `Basic ${new Buffer.from(`api:<my API>`).toString('base64')}`,
},
method: 'POST',
hostname: 'api.tinify.com',
path: '/shrink'
};
https.request(options, function(res,req){
var data = '';
res.on('data', function(chunk){
data += chunk;
});
res.on('end', function(e){
console.log(data);
});
}).end();
Консоль пишет: {"error":"InputMissing","message":"Input file is empty"}