开发者

Sending large data to server

开发者 https://www.devze.com 2023-04-01 02:58 出处:网络
Is it possible to send large amount of data (grid content for example) in $.ajax, to controller? Are there workarounds of \"URI too long\" thing?

Is it possible to send large amount of data (grid content for example) in $.ajax, to controller? Are there workarounds of "URI too long" thing? I know it's probably not the best practice, instead I should probably send each row one by one, but still is it possi开发者_运维知识库ble?


Are there workarounds of "URI too long" thing?

Use a POST HTTP verb instead of GET:

$.ajax({
    url: '/foo',
    type: 'POST',
    data: { value: someVariableThatCouldBeHuge },
    success: function(result) {
        // TODO: process the results
    }
});

or the equivalent:

$.post('/foo', { value: someVariableThatCouldBeHuge }, function(result) {
    // TODO: process the results
});
0

精彩评论

暂无评论...
验证码 换一张
取 消