The problem of springmvc receiving list

    @RequestMapping("poster/add")
    @ResponseBody
    public ResultVo addPoster(Long categoryKey, Long typeId, String typeValue, @RequestBody List<ActivityPosterImageVo> imgList, HttpServletRequest request,
                              HttpServletResponse response){
     dosomething()
    }

data transfer at the foreground

{categoryKey: 1, typeId: "1", typeValue: "", imgList: [{imgId: "87",}]}

Why 400 (Bad Request) is displayed

Mar.01,2021

400: the syntax format is incorrect and the server cannot understand this request.
how is the foreground request written?


 

may be the problem mentioned by ccfish

it is recommended that you download a postman, here and then send the request through postman. For questions like this, it is best to take a picture of the method and data of the request

Menu