Node.js HTTP Module

 


Node.js HTTP Module :
--------------------

Node.js has a built-in module called HTTP, which allows Node.js to transfer data over 
the Hyper Text Transfer Protocol (HTTP).This module is used to create the server in 
node js. 


To include the HTTP module, use the require() method:

var http = require('http');

some methods use :
----------------
createServer() --- method to create an HTTP server
res.writeHead() ---- specifies the header or content type
res.write('content') ----  print the content 
res.end() ---  need to end() to run the server . This is must.
listen('port_number') --- specify the port number

Comments