我想在Java中使用JSON创建一个简单的HTTP Post。
我们说网址为https://authserver.mojang.com
并且它包含值{"用户名":"用户名","密码":"密码"}
我将如何创建POST的语法?
顺便说一下,这是一个自定义的Minecraft客户端(此方法用于登录)
这将如何添加此Payload
{
"agent": { // defaults to Minecraft
"name": "Minecraft", // For Mojang's other game Scrolls, "Scrolls" should be used
"version": 1 // This number might be increased
// by the vanilla client in the future
},
"username": "mojang account name", // Can be an email address or player name for
// unmigrated accounts
"password": "mojang account password",
"clientToken": "client identifier", // optional
"requestUser": true // optional; default: false; true adds the user object to the response
}