1
我想打電話給USA Today api使用此調用播放:播放[2.2] websocket今日美國api錯誤com.fasterxml.jackson.core.JsonParseException:意外字符('<'(code 60)):預計有效值
public static Promise<Result> feedZilla() {
final Promise<Result> resultPromise = WS.url("http://api.usatoday.com/open/articles/topnews/home?count=10&days=0&page=0&encoding=json&api_key=(My Key).get().map(
new Function<WS.Response, Result>() {
public Result apply(WS.Response response) {
JsonNode json = response.asJson();
return ok(json);
}
}
);
return resultPromise;
}
但我不斷收到此錯誤信息:
error com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value
我敢肯定的代碼和URL是有效的。這個代碼在我使用FeedZilla的api之前就工作過了,並且這個url在Postman中工作。不知道發生了什麼事。任何幫助表示讚賞。謝謝
它看起來像是響應中的語法錯誤,您可以打印響應文本以查看從服務器返回的內容。 (無關:url字符串沒有關閉'「') – Diego
感謝您的回覆。我不小心刪除了「當我在發佈之前刪除我的密鑰時,回覆播放得到的結果是
開發人員無效
。不知道這是什麼,因爲該網址在Postman中工作。 – MattH