我有 C# WebClient 返回的以下 JSON:
"\n\n\n{\n \"resultCount\":1,\n \"results\": [\n{\"wrapperType\":\"artist\", \"artistType\":\"Artist\", \"artistName\":\"Jack Johnson\", \"artistLinkUrl\":\"http://itunes.apple.com/us/artist/jack-johnson/id909253?uo=4\", \"artistId\":909253, \"amgArtistId\":468749, \"primaryGenreName\":\"Rock\", \"primaryGenreId\":21}]\n}\n\n\n"
或者,更清楚地说:
{
"resultCount ":1,
"results ":[
{
"wrapperType ":"artist ",
"artistType ":"Artist ",
"artistName ":"Jack Johnson ",
"artistLinkUrl ":"http://itunes.apple.com/us/artist/jack-johnson/id909253?uo=4 ",
"artistId ":909253,
"amgArtistId ":468749,
"primaryGenreName ":"Rock ",
"primaryGenreId ":21
}
]
}
我尝试将其反序列化为一个类,如下所示:
thejsonresult = JsonConvert.DeserializeObject<JsonResult>(WebRequest.Json);
但收到以下错误:
读取字符串时出错。意外标记:StartObject。第 7 行,位置 2。
我很迷茫,找不到任何关于此的文档。有人有线索吗?