Uber代币交换-返回的无效请求

时间:2018-11-23 12:06:50

标签: uber-api

我正在尝试通过使用令牌交换端点来获取承载令牌。它破坏了{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);
});

0 个答案:

没有答案