NodeJS Request: How to get the response as a string? NodeJS Request: How to get the response as a string? express express

NodeJS Request: How to get the response as a string?


I would make in a comment, but I can't.

As in the npm page (considering you don't need pipe), you can have the body along with the response in: :

var request = require("request");request(url, function (error, response, body) {  console.log('error:', error);   console.log('statusCode:', response && response.statusCode);   console.log('body:', body); });