Starting from Node.js v18 the fetch API is available on the global scope by default. So we don’t have to install the node-fetch or other packages to make HTTP requests. The new global fetch
is based on the undici package.
Example:
const res = await fetch('https://gorest.co.in/public/v2/users');
if (res.ok) {
const data = await res.json();
console.log(data);
}
I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.