type user struct { Username string `form:"username"` Password string `form:"password"` } func (this *LoginController) Login() { u := new(user) json.Unmarshal(this.Ctx.Input.RequestBody, &u) this.Ctx.WriteString(u.Username + "--" + u.Password) }
示例: