There are three HTTP methods in NodeJS. They are:

  • http.createServer(): This is used to create a new instance of the http.server class.
  • http.request(): This is used for making an HTTP request to the server by creating an instance of the http.ClientRequest class.
  • http.get(): It is very much similar to the http.request() method, but it automatically sets the HTTP method to GET and calls the req.end().

Suggest An Answer

No suggestions Available!