In the asp.net core project, I want to send a list to the controller with ajax. It's working when my list size is between 10-15, but when I try to send more than 99, I get the error net::ERR_HTTP2_PROTOCOL_ERROR
View:
for.....
var items = {
ProductId: productId,
ColorId: colorId,
ShippigId: shippingId,
Count: colorCount
}
shippingArray.push(items);
var json = JSON.stringify(shippingArray);
var url = '@Url.Action("XXXX","XXXXX")';
$.ajax({
url: url,
traditional: true,
datatype: "JSON",
async: true,
data: {
"body": json
},
success: function () {
}
});
(99) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}........ ] vendor.bundle.base.js:2
GET https://localhost:5001/xxxxx/xxxxx?body=[{"ProductId":"35","ColorId":"1","ShippigId":"324"%2ne
t::ERR_HTTP2_PROTOCOL_ERROR
Controller:
public async Task<bool> ShippingFinishDeleteItem(String body)
Does anyone have a suggestion?
CodePudding user response:
In the asp.net core project, I want to send a list to the controller with ajax. It's working when my list size is between 10-15, but when I try to send more than 99, I get the error net::ERR_HTTP2_PROTOCOL_ERROR
What it is: