Form key or value length limit 2048 exceeded

前端 未结 3 654
北荒
北荒 2020-12-16 23:20

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\")]
              


        
3条回答
  •  [愿得一人]
    2020-12-17 00:12

    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
        }
    

提交回复
热议问题