Put请求无法获取参数对象

SpringBoot中使用RESTful API设计规范,如果Put请求无法将参数转为对象,以下两种配置可选。

@Configuration
public class WebMvcConfig extends WebMvcConfigurationSupport/**
     * 解决put请求无法将参数转为对象
     * @return
     */
    @Bean
    public HttpPutFormContentFilter httpPutFormContentFilter() {
        return new HttpPutFormContentFilter();
    }
}
// 使用:@Component,原理一样,开启:HttpPutFormContentFilter
@Component
public class PutFilter extends HttpPutFormContentFilter {
}
Copyright © blog.wdg.pub 2019 all right reserved,powered by Gitbook该文件修订时间: 2019-03-20 09:09:41

results matching ""

    No results matching ""