티스토리 뷰
때때로 응답이
String
.
JSON
객체 에서 구문 분석 한 다음 사용하십시오.
request({
url: 'http://custom-url',
method: 'GET'
}, function(err, response, body) {
if (body && typeof body == "string") {
body = JSON.parse(body);
}
console.log("Got Response : " + respnose.statusCode);
console.log("Body : " + body);
console.log("name is " + body.name);
})
출처
https://stackoverflow.com/questions/39917019
댓글