[英]org.springframework.http.converter.HttpMessageNotReadableException when sending a POST request
[英]Spring-boot RestAPI post org.springframework.http.converter.HttpMessageNotReadableException
我的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/" }
看起來您發送的是用戶數組JSON,而不是一個用戶。
從您發送的JSON中刪除[
和]
,然后再試一次
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.