我想通過他們的API獲取Facebook用戶的名字。 這是我的代碼Nodejs,請求和點符號
var user = request("https://graph.facebook.com/v2.6/"+psid+"?fields=first_name,last_name&access_token="+token, function(err, res, body) {
console.log("name: " + body.first_name);
console.log("body: " + body);
});
這是結果:
name: undefined
body: {"first_name":"Anton","last_name":"Rosato"}
爲什麼名字是不確定的?
什麼'的console.log( 「體型:」 + typeof運算體)'給你? – Quentin