亚马逊Alexa说我的json无效,我不知道如何解决它

问题描述 投票:0回答:1

我正在制作Alexa flash简报技巧,需要从我的URL返回json。我的家用控制器中有以下内容

[HttpGet]
public ActionResult Feed(string id)
{
    Helper.TodaysWord help = new Helper.TodaysWord();
    return Content(help.jsonBuilder(id), "application/json");
}

转到URL给我以下json。

{"uid":"7a257633-4032-4593-a1be-a354a395aced","updateDate":"2/28/2018 12:00:00 AM","titleText":"Today's Japanese","mainText":"Test, put word and definition here","redirectionUrl":"HTTP://www.LostDutchmanSoftware.com"}

我收到“错误:解析Feed时出错。请确保Feed是有效的JSON或RSS。”当亚马逊尝试验证来源时。我真的很新,请帮忙。

c# json asp.net-mvc alexa
1个回答
1
投票

您的JSON有效。您的问题可能与日期格式有关。

尝试使用非常常见的ISO 8601日期格式。

“updateDate”:“2018-02-28T12:00:00.0Z”

© www.soinside.com 2019 - 2024. All rights reserved.