首页 > 解决方案 > 你如何调用rest方法powershell来获取访问令牌

问题描述

我正在尝试创建一个小的 powershell 脚本来调用 rest 方法来获取访问令牌。我能够弄清楚如何使用迅雷客户端在获取请求中获取我需要的数据,但不知道如何将该信息转换为 powershell 命令。

在迅雷客户端生成新令牌的信息如下:

Grant Type: Client Credentials
Token URL: {{token_url}}
clientID: {clinet_ID}}
clientSecret: {client_secret}}
scope: {{scope}}
send Auth: As Auth Header

在PowerShell中?

标签: powershellrest

解决方案


您好我是迅雷客户端的创建者,由于您已经在使用该扩展,您可以使用代码片段功能生成 PowerShell 代码

在基本身份验证选项卡中输入客户端 ID、客户端密码,并输入其他值,如下图所示。

Thunder Client Powershell 代码片段


推荐阅读