python - 如何在 python 中为 auth.gg api 正确地 request.post()
问题描述
Auth.gg 示例 API
POST /v1 HTTP/1.1
Host: api.auth.gg
Content-Type: application/x-www-form-urlencoded
Content-Length: 123
type=register&aid=demo&apikey=demo&secret=demo&username=demo&password=demo&hwid=demo&license=demo&email=demo
我正在尝试使用的代码(我已经填写了演示项目)
register = "type=register&aid=demo&apikey=demo&secret=demo&username=demo&password=demo&hwid=demo&license=demo&email=demo"
get_auth = requests.post(url, data=raw_data)
pprint(get_auth.json())
但是此代码返回 {'message': 'Invalid type', 'result': 'failed'}
我将如何根据他们的通用示例格式化这个 request.post() ?
解决方案
许多人试图找出如何使用这个伟大的新身份验证系统,这可能会让初学者感到沮丧。
这是 Github 上的一些代码,可以帮助您轻松地将 Auth.GG 添加到您的 Python 应用程序中。
推荐阅读
- reactjs - ReactJs 无法在“历史”上执行“pushState”:
- c# - 如何分别获取其中包含的url和产品代码
- django - Django 卷曲请求
- c++ - QWT 轴强制主刻度为零
- android - 我怎样才能打开whatsapp聊天设置页面?
- javascript - 使用 vue js 将 js 变量显示为 html
- ios - 参数标签 '(_:, heightForRowAt:)' 不匹配任何可用的重载
- c# - 如何在sql中的另一个表中插入已删除的行
- angular - 同一级别的另一个组件的访问按钮
- recursion - 如何求解递归关系 T(n)=T(n^1/2)+n