HTTP错误414.请求URL太长

ash*_*raz 8 html javascript ajax jquery

我正在使用ckeditor格式化我的内部数据 textarea

<textarea id="editorAbout" rows="70" cols="80" name="editorAbout"></textarea>
Run Code Online (Sandbox Code Playgroud)

现在,当我尝试使用jQuery.ajax这样的方式发布此数据时,

var about=escape( $("#editorAbout").text());
            $.ajax({
             type: "POST",
             url: "../Allcammand.aspx?cmd=EditAboutCompany&about="+about,
             type:"post",
                async: false ,
                   success: function(response){                                       

                    },
                    error:function(xhr, ajaxOptions, thrownError){alert(xhr.responseText); }
            });
Run Code Online (Sandbox Code Playgroud)

我收到了错误

HTTP错误414.请求URL太长.

我在这里收到错误:http://iranfairco.com/example/errorLongUrl.aspx
尝试单击该页面左下角的" 编辑文本"按钮.

为什么会这样?我该如何解决?

aln*_*h29 20

根据这个问题,URL的最大实际长度是2000个字符.这无法像您尝试发送的那样持有大量的维基百科文章.

您应该将它放在POST请求的正文中,而不是将数据放在URL上.您需要为data要传递给ajax函数调用的对象添加值.像这样:

function editAbout(){

    var about=escape( $("#editorAbout").text());
    $.ajax({
        url: "Allcammand.aspx?cmd=EditAboutCompany&idCompany="+getParam("idCompany"),
        type:"post",
        async: false,
        data: {
            about: about
        },
        success: function(response){                                       
        },
        error:function(xhr, ajaxOptions, thrownError){alert(xhr.responseText); ShowMessage("??? ?? ?????? ??????? ????","fail");}
    });
}
Run Code Online (Sandbox Code Playgroud)