1const https = require('https')
2const options = {
3 hostname: 'whatever.com',
4 port: 443,
5 path: '/todos',
6 method: 'GET'
7}
8
9const req = https.request(options, res => {
10 console.log(`statusCode: ${res.statusCode}`)
11
12 res.on('data', d => {
13 process.stdout.write(d)
14 })
15})
16
17req.on('error', error => {
18 console.error(error)
19})
20
21req.end()