<https://authserver.mojang.com/authenticate> 是否有特定的负载格式?
is there a specific payload format for <https://authserver.mojang.com/authenticate>?
我目前正在尝试编写代码以找出对 Minecraft 迁移帐户的身份验证发生了什么变化,这是我的代码。
import requests
from uuid import uuid4
uuid = uuid4().hex #used as client token
payload = {
"agent": {
"name": "Minecraft",
"version": 1
},
"username": "AGmailAccount@gmail.com",
"password": "APasswordToTheAccount",
"clientToken": uuid,
"requestUser": True
}
print(requests.post("https://authserver.mojang.com/authenticate", headers = {"content-type":"application/json"}, data = payload))
每次我 运行 它得到一个 400 错误代码,我应该得到一个适当的非 200 HTTP 状态代码或一个 JSON 编码的字典。
my resources are
<https://wiki.vg/Mojang_API> ,
<https://wiki.vg/Authentication> ,
and the mojangapi library <https://pypi.org/project/mojang-api/>
改用这一行:
print(requests.post("https://authserver.mojang.com/authenticate", json=payload))
您发送 JSON 的方式不正确。
我目前正在尝试编写代码以找出对 Minecraft 迁移帐户的身份验证发生了什么变化,这是我的代码。
import requests
from uuid import uuid4
uuid = uuid4().hex #used as client token
payload = {
"agent": {
"name": "Minecraft",
"version": 1
},
"username": "AGmailAccount@gmail.com",
"password": "APasswordToTheAccount",
"clientToken": uuid,
"requestUser": True
}
print(requests.post("https://authserver.mojang.com/authenticate", headers = {"content-type":"application/json"}, data = payload))
每次我 运行 它得到一个 400 错误代码,我应该得到一个适当的非 200 HTTP 状态代码或一个 JSON 编码的字典。
my resources are
<https://wiki.vg/Mojang_API> ,
<https://wiki.vg/Authentication> ,
and the mojangapi library <https://pypi.org/project/mojang-api/>
改用这一行:
print(requests.post("https://authserver.mojang.com/authenticate", json=payload))
您发送 JSON 的方式不正确。