产生背景: 易报表系统统计报表:比如根据月份周期来统计2015年至2017年每个月的公司总支出和总收入,这样一个业务场景,即不是新增数据也不是修改数据,所以就用GetMapping注解,但鬼使神差地又用到@RequestBody这样的注解, 异常: org.springframework.http.converter.HttpMessageNotReadableException: Required request body is missing: public com.fishonline.easyreport.common.ResponseVo com.fishonline.easyreport.controller.CustomReportController.getReportStatisticData(com.fishonline.easyreport.dto.ReportStatisticDTO) get请求content-type为application/x-www-form-urlencoded,只支持request parameters方式传递请求数据!所以提示必须的请求体丢失! 解决方案: 改成PutMapping或PostMapping,但感觉怪怪,因为没有新增数据也没有修改数据,只是变相的拉起数据
|
|