To make a https post in Node.js without any third party module, we use fetch.
For instance, we write
const res = await fetch("https://nodejs.org/api/documentation.json");
if (res.ok) {
const data = await res.json();
console.log(data);
}
to call fetch to make a get request to the URL.
We get the JSON response with res.json.
We check if the request works with res.ok.
fetch is built into Node.js since version 18.