1.

What are the different HTTP methods in Node.js?

Answer»

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().
Also READ: What's New for Node.js in 2020


Discussion

No Comment Found