我的github代码https://github.com/prabhatpankaj/SpringREST_API/
输出
output { "timestamp": 1498443503678, "status": 400, "error": "Bad Request", "exception": "org.springframework.http.converter.HttpMessageNotReadableException", "message": "JSON parse error: Can not deserialize instance of com.exaple.objects.User out of START_ARRAY token; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of com.exaple.objects.User out of START_ARRAY token\n at [Source: java.io.PushbackInputStream@1546ea93; line: 1, column: 1]", "path": "/api/user/" }
答案 0 :(得分:0)
看起来你发送的是用户数组JSON而不是一个用户。
从您发送的JSON中删除[
和]
,然后再试一次