3
node.js에서 https로 게임하는 동안 응답 데이터를 읽지 못했습니다. 다음은 https 요청에 대한 코드입니다.node.js의 https 응답 데이터 디코딩
https.get(options, function(resp) {
console.log(resp.headers) //working fine
resp.on('data', function(d) {
console.log(d) // buffered data; like <Buffer 7b 22 69...
process.stdout.write(d); // working fine(prints decoded data in console)
var decoded_data=??? });
}).on('error', function(e) {
console.error(e);
});
하지만, 응답 데이터를 디코딩 할 수있는 방법 & 변수로 쓰기?
d.toString()이 마법을 실행했습니다. 감사합니다 ... – Vivek