SpringBoot http post请求数据大小设置

背景:

使用http post请求方式的接口,使用request.getParameter("XXX");的方法获取参数的值,当数据量超过几百k的时候,接口接收不到数据或者接收为null。

    @RequestMapping(value = "/rcv",method = RequestMethod.POST)
    public ResInfo<String> pullApi(HttpServletRequest request) {
        String channel = request.getParameter("channel");
    }

 

在application.properties里添加:

spring.http.multipart.max-file-size=-1
spring.http.multipart.max-request-size=-1

默认值: private String maxFileSize = "1MB"; private String maxRequestSize = "10MB";

------------------------------------------------------------------------------------------------------------------------------------
server.tomcat.max-http-post-size=-1

这个设置是大小不限制,主要是这个设置。

评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值