SpringBoot http post请求数据大小设置

背景:

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

    @RequestMapping(value = "/rcv",method = RequestMethod.POST)
    public ResInfo 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

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

你可能感兴趣的:(spring,boot,post,数据,限制,Spring,Boot,java)