📜  https 请求 - CSS 代码示例

📅  最后修改于: 2022-03-11 14:47:43.827000             🧑  作者: Mango

代码示例2
JScopieddoneconst https = require('https')const options = {  hostname: 'example.com',  port: 443,  path: '/todos',  method: 'GET'}
const req = https.request(options, res => {  console.log(`statusCode: ${res.statusCode}`)
  res.on('data', d => {    process.stdout.write(d)  })})
req.on('error', error => {  console.error(error)})
req.end()