url变量在Haxe项目中不工作



你好吗?我希望一切顺利。

所以我试图发送一个urlRequest,我不能通过url传递参数,所以我试图使用URLVariable,但无论我尝试什么,我的php总是得到null。

        var request:URLRequest = new URLRequest(SITE_DOMAIN + "/check_login.php");
        request.method = URLRequestMethod.POST; 
        var variables:URLVariables = new URLVariables();
        variables.login = emailInput.text;
        variables.password = senhaInput.text;
        variables.gotogame = "BURACO";
        Reflect.setField(variables, "login", emailInput.text);
        Reflect.setField(variables, "password", senhaInput.text);
        Reflect.setField(variables, "gotogame", "BURACO");
        request.data = variables;
        request.method = URLRequestMethod.POST;
        openfl.Lib.getURL(request);

正如你们所看到的,我试图以两种方式设置变量,但它们都不起作用,我有点不知道该怎么做了,请帮助。

我用这个没有问题:

    var request:Http = new Http(SERVER + "actions/layout-builder?random=" + Math.random());
    request.addParameter("action", "retrieve");
    request.addParameter("layoutId", layoutId);
    request.onError = function(msg) {
        showSimplePopup("Problem loading layout:nn" + msg);
    }
    request.onStatus = function(status:Int) {
    }
    request.onData = function(response) {
        response = StringTools.replace(response, "rn", "n");
        layoutCode.text = response;
    }
    request.request(false);

相关内容

  • 没有找到相关文章

最新更新