【发布时间】:2021-05-13 13:06:20
【问题描述】:
nodejs有问题,https.request返回
const checkStatus = await https
.request(
{
method: 'HEAD',
host: 'host',
path: 'path',
},
(response) => {
const { statusCode } = response;
// idk
},
)
.on('error', (e) => {
if (e) {
throw new Error();
}
})
.end();
我可以在 checkStatus 变量中以某种方式返回 statusCode 而不是
【问题讨论】:
标签: javascript node.js https