I am using asp.net core to build API. I have a request that allow user to upload profile image using this code
[HttpPost(\"{company_id}/updateLogo\")]
For may case adding [DisableRequestSizeLimit]
attribute solved error; this can be helpful when you are not sure about maximum count of request. This is formal documentation.
[HttpPost("bulk")]
[ProducesResponseType(typeof(IEnumerable), (int)HttpStatusCode.Created)]
[ProducesResponseType((int)HttpStatusCode.BadRequest)]
[ProducesResponseType((int)HttpStatusCode.InternalServerError)]
[DisableRequestSizeLimit]
public async Task BulkCreateEntry([FromBody] IEnumerable command)
{
// do your work
}