springboot2.0中PUT请求接收不到参数解决

本来可以用HttpPutFormContentFilter这个类去解决的,但是在springboot2中 这类是deprecated 过期的。

经查询,被替代的类是FormContentFilter

所以解决办法如下:

@Configuration
@Slf4j
public class WebConfig extends WebMvcConfigurationSupport {


    @Bean
    public FormContentFilter formContentFilter() {
        return new FormContentFilter();
    }
}
复制代码

经过上面的配置,就可以解决问题。