HTTP Module in Node Js

HTTP is a module in Node Js. It is installed on our system along with the installation of Node Js. It is basically used to work with HTTP protocol. We can create servers with HTTP and can make the server to listed on the port defined. HTTP module can handle almost all types of HTTP methods like get, post, delete, put, patch etc.

To use it in our projects, we first have to import it.

Creating a server

Using HTTP module we can create a server and make that server listen on the specified port. We can do this using the createServer() method of the HTTP module.

Rendering HTML using HTTP module

Reading the url and sending the Header field

Leave a Reply

Your email address will not be published. Required fields are marked *