import https from 'https';

const url = 'https://prova.patachina.it/photos/';

// 🔥 METTI QUI IL TUO TOKEN
const token = "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoicHJvdmFtaSIsImlhdCI6MTc3NTg1Nzk2MCwiZXhwIjoxODA3MzkzOTYwfQ.Jysn-9bhDNREZAOfeZa7OkTtSVZYPGE0UYVRYvmajBM";

const options = {
  method: 'GET',
  headers: {
    'Authorization': token
  }
};

console.log('Requesting:', url);
console.log('Headers:', options.headers);

https.get(url, options, (res) => {
  console.log('STATUS:', res.statusCode);
  console.log('HEADERS:', res.headers);

  let data = '';
  res.on('data', chunk => data += chunk);
  res.on('end', () => {
    console.log('BODY (first 300 chars):');
    console.log(data.slice(0, 300));
  });
}).on('error', (err) => {
  console.error('ERROR:', err);
});
