当调用一个Invoke-RestMethod
使用 Powershell,例如:
Invoke-RestMethod -Method Get -Uri "https://google.com/api/GetData" -Headers $headers
and $headers
being
$headers = @{
Authorization="Secret $username $password"
Content='application/json'
}
参数的预期格式是什么$username
and $password
?
据我所知,您必须在请求标头中发送 OAuth2 令牌。
$headers = @{
Authorization="Bearer $token"
}
也许下面的博客文章可以让您了解如何做到这一点。https://lazyadmin.nl/it/connect-to-google-api-with-powershell/ https://lazyadmin.nl/it/connect-to-google-api-with-powershell/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)