1
我使用Meteor的內置HTTP.post向Google OAuth2 API發送授權碼以獲取令牌。Google OAuth2的Meteor HTTP.post - 缺少必需的參數:grant_type
但是我收到錯誤:Required parameter is missing: grant_type
。猜測這是一個編碼問題?
HTTP.post('https://accounts.google.com/o/oauth2/token', {data: {
code: 'XXXXXXXXXXX',
client_id : 'XXXXXXX.apps.googleusercontent.com',
client_secret: 'XXXXXXXXXXXXXXXXXXXXXXX',
grant_type : 'authorization_code'
}}, function(error, response){
if (error) {
console.log(error);
} else {
console.log(response);
}
});