Quantcast
Viewing all articles
Browse latest Browse all 1582

Nodejs https.request head method issue

Have a problem with nodejs, https.request returns <http.ClientRequest>

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();

Can i somehow return statusCode instead <http.ClientRequest> inside checkStatus variable?


Viewing all articles
Browse latest Browse all 1582

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>