如何使用简单的 HTTP 刷新 Google OAuth 访问令牌?

How do you refresh a Google OAuth access token using simple HTTP?

我正在使用 Python 开始使用 Google OAuth 系统。我查看了官方文档和 SO,所以我知道 'refresh' 令牌是他们对长期访问的解决方案。

但是,我无法在任何地方找到有关使用刷新令牌的端点或方法的指南。我通常使用基本的 HTTP 请求而不是专有库,所以我只想知道我需要发送的端点和参数。

提前致谢。

using a refresh token 中所述,特定的 HTTP URL 是 https://www.googleapis.com/oauth2/v3/token。示例请求如下所示:

POST /oauth2/v3/token HTTP/1.1
Host: www.googleapis.com
Content-Type: application/x-www-form-urlencoded

client_id=8819981768.apps.googleusercontent.com&
client_secret={client_secret}&
refresh_token=1/6BMfW9j53gdGImsiyUH5kU5RsR4zwI9lUVX-tqf8JXQ&
grant_type=refresh_token