如何使用 alamofire 请求访问令牌?

时间:2021-01-18 08:32:56

标签: swift curl alamofire

我想使用 alamofire 尝试 blizzard API。

但是,很难找到示例。

下面的代码是使用暴雪官网提供的curl请求访问令牌的方法。

curl -u {client_id}:{client_secret} -d grant_type=client_credentials https://us.battle.net/oauth/token

对此的示例响应如下。

{"access_token": "...", "token_type": "bearer", "expires_in": 86399, "scope": "example.scope"}

如上,

如何使用 alamofire(快速)请求访问令牌?

*我已经知道 client_id 和 client_secret。

0 个答案:

没有答案