I think I am stuck in a similar problem and the neebz solution worked, but I had to put it in the right place.
var req = http.request(options, function(res) { console.log("statusCode: ", res.statusCode); console.log("headers: ", res.headers); **res.setEncoding(encoding='utf8');** res.on('data', function(d) { console.log(d); }); });
In the document node.js, it is documented as request.setEncoding (), which may be an error because it must be called on the res object created by the request.
source share