const https = require('https');

const options = {
  hostname: 'ad.yunmainiu.com',
  port: 443,
  path: '/api/cattle-data',
  method: 'GET',
  headers: {
    'Host': 'ad.yunmainiu.com',
    'Referer': 'https://ad.yunmainiu.com/',
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'
  }
};

const req = https.request(options, (res) => {
  console.log('StatusCode:', res.statusCode);
  console.log('Headers:', res.headers);

  let data = '';
  res.on('data', (chunk) => {
    data += chunk;
  });

  res.on('end', () => {
    console.log('Body Length:', data.length);
    console.log('Body Preview:', data.substring(0, 500));
  });
});

req.on('error', (e) => {
  console.error(e);
});

req.end();