Quantcast
Channel: http.request vs http.createServer - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by Brad for http.request vs http.createServer

http.request() makes a request to another HTTP server. Suppose for some reason I wanted to go download Stack Overflow's home page...http.request('https://stackoverflow.com/', (res) => { //...

View Article



Answer by yodebu for http.request vs http.createServer

Based on the source code of nodejs (extract below), createServer is just a helper method to instantiate a Server.Extract from line 1674 of http.js.exports.Server = Server;exports.createServer =...

View Article

http.request vs http.createServer

What is the difference between the request in this line of code: http.createServer(function(request,response){. . .}and request in http.request()Are both requests done to the server?I am new to node.js...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images