It may be a basic question related to Spring Rest service Post request
Below is my Controller mapping code:
@RequestMapping(value = "test", method = RequestMethod.POST)
@ResponseBody
public String addFruits(@RequestBody RequestWrapper fruits) {
// ...
System.out.println("test");
return null;
}
Below is the RequestWrapper class:
public class RequestWrapper{
List<String> ids;
String languageCode;
...
}
Now if in advanced Chrome rest client, with content-type as application/json if I post the following request :
["ids": [{ "1","2","3","4"}]
,
"languageCode" : "en_US"
]
I get the following error:
Error 400: SRVE0295E: Error reported: 400
Any clue as to where I am going wrong?