我正在尝试通过使用令牌交换端点来获取承载令牌。它破坏了{error:invalid_request}
POST https://login.uber.com/oauth/v2/token
以下代码是用节点js编写的
var options = {
url: " https://login.uber.com/oauth/v2/token",
headers: {
"client_secret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"client_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"grant_type": "authorization_code",
"redirect_uri": "http://localhost:3000/requests/estimate",
'code': "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" // the code returned in the authorization end point
}
};
request.post(options, function (error, response, body) {
var result = JSON.parse(body);
});