我尝试调用一个接受列表的 url。
发送的数据是
{"contactAvailableIdList":["1"],"contactIdList":["2","3"]}
Method on the server
@RequestMapping(value = "/lodgers/{lodgerId}/associate/dissociate/contact", method = RequestMethod.PUT)
public void associateLodgerAndContact(@PathVariable("lodgerId") Long lodgerId, @RequestBody @Valid final List<Long> contactIdList, @RequestBody @Valid final List<Long> contactAvailableIdList) {
lodgerService.associateDissociateLodgerAndContact(lodgerId, contactIdList, contactAvailableIdList);
}
"{"timestamp":1445958336633,"status":400,"error":"Bad Request","exception":"org.springframework.http.converter.HttpMessageNotReadableException","message":"无法读取文档:可以不在 [Source: java.io.PushbackInputStream@5a1edae4; 的 START_OBJECT 令牌中反序列化 java.util.ArrayList 的实例;行:1,列:1];嵌套异常是 com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize an instance of java.util.ArrayList out of START_OBJECT token\n at [Source: java.io.PushbackInputStream@5a1edae4; 行:1,列:1]","路径":"/rest/lodgers/1/associate/dissociate/contact"}"