Answer by yojimbo87 for Where is the body in a nodejs http.get response?
http.request docs contains example how to receive body of the response through handling data event:var options = { host: 'www.google.com', port: 80, path: '/upload', method: 'POST'};var req =...
View ArticleAnswer by mikemaccana for Where is the body in a nodejs http.get response?
Edit: replying to self 6 years laterThe await keyword is the best way to get a response from an HTTP request, avoiding callbacks and .then()You'll also need to use an HTTP client that returns...
View ArticleAnswer by Skomski for Where is the body in a nodejs http.get response?
You need to add a listener to the request because node.js works asynchronous like that:request.on('response', function (response) { response.on('data', function (chunk) { console.log('BODY: '+ chunk);...
View ArticleWhere is the body in a nodejs http.get response?
I'm reading the docs at http://nodejs.org/docs/v0.4.0/api/http.html#http.request, but for some reason, I can't seem to to actually find the body/data attribute on the returned, finished response...
View Article