📜  https 节点 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:58.182000             🧑  作者: Mango

代码示例1
const https = require('https');

https.get('https://encrypted.google.com/', (res) => {
  console.log('statusCode:', res.statusCode);
  console.log('headers:', res.headers);

  res.on('data', (d) => {
    process.stdout.write(d);
  });

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