I'm using ASP.NET Core 7. I have an update form which results in an http 400 error for large dataset updates. It works fine when the data being updated is smaller. The error I get is
This page isn't working. If the problem continues, contact the site owner. HTTP ERROR 400
The update method on the controller is set to HTTP POST.
For large data set edits, the POST method is not hit at all. If I run a Chrome debug console, I see the failed to load resource error which points to chrome-error://chromewebdata/. I have tried installing Postman Interceptor and capturing the request. It captures it successfully and does not show any issues. I am able to browse the data.
The data seems to be sent as x-www-form-ulrencoded. Is this my issue? Is there a limit to POST data size? Is there a way to increase this limit?
My controller code looks like this
[Authorize]
public async Task<IActionResult> Edit(int id)
{
// . . .
[Authorize]
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Edit(ReticleSetEntity entity)
{
if (ModelState.IsValid)
{
// . . .
}
// ....
}
}
The HTML looks like this
<form id="reticleset-form" asp-action="Edit" >
<div class="card mt-4">
. . .
Many thanks for any help
The specifics about the request contents and size could help. Also, limits could be added by your hosting environment (e.g. IIS).
But here you can find few options to change the limits: https://www.textcontrol.com/blog/2019/12/20/documentviewer-configuring-aspnet-for-larger-requests/.
Updated
Form value count limit could be configured via
FormOptions.ValueCountLimit. You can do it while configuring services: