首页 > 解决方案 > 如何在 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() ?

标签: pythonpostrequest

解决方案


许多人试图找出如何使用这个伟大的新身份验证系统,这可能会让初学者感到沮丧。

这是 Github 上的一些代码,可以帮助您轻松地将 Auth.GG 添加到您的 Python 应用程序中。

https://github.com/robert169/Auth.GG-Python


推荐阅读