【问题标题】:DHTMLX dhtmlxForm.send() Throws HTTP Status 400 - "The request sent by the client was syntactically incorrect."DHTMLX dhtmlxForm.send() 抛出 HTTP 状态 400 -“客户端发送的请求在语法上不正确。”
【发布时间】:2015-01-28 22:53:56
【问题描述】:

这一切都是从我们迁移到 DHTMLX v4.0.3 开始的。 dhtmlxForm.send() 函数现在抛出 HTTP 状态 400 -“客户端发送的请求在语法上不正确。”我没有看到 POST 有任何问题。我确实注意到他们现在包含一个随机生成的项目“dhxr1422484613542”,它没有值。知道为什么现在会抛出 HTTP 400 吗?谢谢!

标题标签: 预览标签: JavaScript:

dhtmlxEvent(window,"load",function(){
    var dhxLayout = new dhtmlXLayoutObject(document.body, '1C');

    var f = dhxLayout.cells("a").attachForm([
        {type:"settings", position:"label-left", labelAlign:"right", labelWidth:150, inputWidth:150},
        {type:"hidden", name:"method", value:"getJson"},
        {type:"hidden", name:"proc", value:"c3.chgpwd"},
        {type:"password", name:"oldpwd", label:"Current Password", required:true},
        {type:"password", id:"newpwd", name:"newpwd", label:"New Password", required:true},
        {type:"password", name:"confirmpwd", label:"New Password (Again)", required:true},
        {type:"button", name:"submit", width:50, offsetLeft:150, value:"Submit"}
    ]);
    f.attachEvent("onButtonClick", function(name){
        /* Here is the POST that used to work, but since v4.0.3 it throws a HTTP 400 */
        f.send("lib.cfc?method=getJson&proc=c3.chgpwd","post",function(loader, response){
            console.log(response);  /*This is never reached, see attachments for the error reported during the POST*/
        });
    });
});

【问题讨论】:

    标签: javascript apache http-headers dhtmlx http-status-code-400


    【解决方案1】:

    我发现当名称后面缺少等号时,apache无法处理url参数。

    所以一个url比如:

     http://domain.com?x=22&y 
    

    apache 无法理解。

    我猜 dhtmlx 团队不使用 apache。

    【讨论】:

    • 但我正在做一个 POST。不是 GET。我更新到 DHTMLX 4.1.2,问题就消失了。
    • Apache 在 GET 和 POST 中都期望 name=value。在 4.1.2 中,您可能正在使用 window.dhx4.ajax.cache = false; 关闭缓存
    猜你喜欢
    • 1970-01-01
    • 2015-12-22
    • 1970-01-01
    • 1970-01-01
    • 2017-01-22
    • 1970-01-01
    • 1970-01-01
    • 2015-12-02
    • 1970-01-01
    相关资源
    最近更新 更多