and many more. These are all super fantastic libraries which bring in an array of capabilities on how to make HTTP request and handle various responses and errors.
But sometimes, all we need is, a simple HTTP/S request and response handler. This can be easily done with NodeJS’s built-in packages http / https with a very simple, lean piece of code. Lets see it in action.
NOTE: Since Promiseis fancy, so I am gonna use it for this.