[英]Unable to send large data in Jquery ajax call
嗨,我正在開發MVC4應用程序。 我正在將值保存到數據庫。 我收到了以下錯誤。
The request filtering module is configured to deny a request where the query string is too long.
我正在進行ajax調用並以Json的形式發送數據,如下所示。
$.ajax({
type: "POST",
cache: false,
url: '/UploadDocument/SubmitDoc?JsonValue=' + JSON.stringify(SaveUpload) + '&gridData=' + strOrderArr,
contentType: "application/json; charset=utf-8",
dataType: "json",
headers: {
'VerificationToken': forgeryId
},
success: function (response) {}
});
Web.config文件
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="1073741824" />
</requestFiltering>
</security>
我是否知道在向數據庫發布大量數據時,我是否采用了良好的方法來處理上述情況? 提前致謝。
這是一個POST請求,但你在Query字符串中傳遞數據!
在Data
參數中傳遞數據:
$.ajax({
type: "POST",
cache: false,
url: '/UploadDocument/SubmitDoc',
data: JSON.stringify({ JsonValue: SaveUpload, gridData:strOrderArr }),
contentType: "application/json; charset=utf-8",
dataType: "json",
headers: {
'VerificationToken': forgeryId
},
success: function (response) {}
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.