How to pass List in post method using Spring MVC?

前端 未结 3 982
旧时难觅i
旧时难觅i 2020-12-13 13:32

I need to pass a list of values in the request body of POST method but I get 400: Bad Request error.

Below is my sample code:



        
3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-13 14:02

    You can pass input as ["apple","orange"]if you want to leave the method as it is.

    It worked for me with a similar method signature.

提交回复
热议问题