当你的才华不能撑起你的野心时,就是你该选择学习的时候了!

Request body too large. The max request body size is 30000000 bytes.

调用 .Net Core 6.0 Web API 报错:Request body too large. The max request body size is 30000000 bytes.

Startup.cs增加如下内容:

            services.Configure<KestrelServerOptions>(options =>
            {
                options.Limits.MaxRequestBodySize = int.MaxValue;
            });

            services.Configure<FormOptions>(options =>
            {
                options.ValueLengthLimit = int.MaxValue;
                options.MultipartBodyLengthLimit = int.MaxValue;
            });

 

posted @ 2023-09-18 17:50  hofmann  阅读(206)  评论(0编辑  收藏  举报