python - python博主获取token
问题描述
我有 google 密钥、client_id 和 client_secret,我需要 google 令牌,但我阅读了 google 文档, https ://developers.google.com/blogger/docs/3.0/using#auth https://github.com/googleapis/google -api-python-client/blob/master/docs/oauth.md 我找不到如何获取令牌
code = input('Enter the authorization code: ')
flow.fetch_token(code=code)
我不明白如何获得令牌。搜索谷歌,我知道如何获得令牌
import requests
url = "https://oauth2.googleapis.com/token"
data = {
"client_secret": "xx",
"client_id": "xx",
"project_id": "seventh-ripsaw-315203",
"grant_type" : "authorization_code",
}
response=requests.post(url,data,timeout=5)
print(response.status_code,response.json())
但是提示 Missing required parameter: code,如何获取代码
解决方案
推荐阅读
- java - 将日志记录添加到独立 Java 应用程序
- python-3.5 - 在 python 中创建范围对象
- excel - 如何在 MS Access 中为 Excel 电子表格导入提供错误处理
- python - R readBin 与 Python 结构
- python - 用于部署 python 机器学习模型的通用 Web 服务器/框架?
- sql - 旧数据库格式迁移
- android - Qt android 电子邮件
- java - 打印二维阵列的方法
- android - 从活动转到主要活动并再次返回活动后,音高检测 (TarsosDSP) 不起作用
- ios - 如何在 Xcode 的 Storyboard 中保持高分辨率图像而不使其像素化?