簡體   English   中英

Spring-boot RestAPI發布org.springframework.http.converter.HttpMessageNotReadableException

[英]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.HttpMessageNotReadableEx‌​ception", "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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM