HTTP错误414。请求URL太长

浏览:35日期:2024-02-15
如何解决HTTP错误414。请求URL太长?

根据这个问题,URL的最大实际长度是2000个字符。就像您要发送的那样,这将无法保存大量的Wikipedia文章。

不应将数据放在URL上,而应将其放在POST请求的正文中。您需要为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');} });}解决方法

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

<textarea rows='70' cols='80' name='editorAbout'></textarea>

现在,当我尝试使用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); } });

我得到错误

HTTP错误414。请求URL太长。

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

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

相关文章: