@RequestMapping("poster/add")
@ResponseBody
public ResultVo addPoster(Long categoryKey, Long typeId, String typeValue, @RequestBody List<ActivityPosterImageVo> imgList, HttpServletRequest request,
HttpServletResponse response){
dosomething()
}
前臺(tái)傳輸數(shù)據(jù)
{categoryKey: 1, typeId: "1", typeValue: "學(xué)習(xí)", imgList: [{imgId: "87",…}]}
為什么顯示400 (Bad Request)
3 回答

至尊寶的傳說
TA貢獻(xiàn)1789條經(jīng)驗(yàn) 獲得超10個(gè)贊
@RequestMapping("poster/add")
@ResponseBody
public ResultVo addPoster(@RequestBody PosterRequest req, HttpServletRequest request,
HttpServletResponse response){
dosomething()
}
class PosterRequest {
Long categoryKey; Long typeId; String typeValue; List<ActivityPosterImageVo> imgList
/// getter setter methods
}

慕森卡
TA貢獻(xiàn)1806條經(jīng)驗(yàn) 獲得超8個(gè)贊
可能就是 ccfish 說的問題
建議你這邊下載一個(gè)postman,然后通過postman發(fā)送請(qǐng)求,像此類問題,最好把請(qǐng)求的方式和數(shù)據(jù)截一個(gè)圖
添加回答
舉報(bào)
0/150
提交
取消