【发布时间】:2016-09-30 18:32:35
【问题描述】:
我有以下代码,但我的 json 结果无法解析。我不知道为什么它不解析。请帮助我,类属性与 json 转换为 c# 相同
using (WebClient client = new WebClient())
{
client.Headers.Add("API-Version: 5.0");
client.Headers.Add("Content-Type","application/json");
ss= client.UploadString(baseAddress + "/api/Jobs/MakePayment", json);
}
try
{
// rtn = rtn.Replace("\", " ").Trim();
ResponseJudo objCls = Newtonsoft.Json.JsonConvert.DeserializeObject<ResponseJudo>(ss);
}
我的响应 json 是这样的:
{\"receiptId\":\"5443635\",\"yourPaymentReference\":\"Test1964\",\"type\":\"Payment\",\"createdAt\":\"2016-09-30T07:46:50.9991+01:00\",\"result\":\"Success\",\"message\":\"AuthCode: 830476\",\"judoId\":100109768,\"merchantName\":\"\Khan\",\"appearsOnStatementAs\":\"APL/khn\",\"originalAmount\":\"11.10\",\"netAmount\":\"11.10\",\"amount\":\"11.10\",\"currency\":\"GBP\",\"cardDetails\":{\"cardLastfour\":\"3436\",\"endDate\":\"1220\",\"cardToken\":\""\",\"cardType\":1},\"consumer\":{\"consumerToken\":\"uToaxZzXSJngo0iL\",\"yourConsumerReference\":\"TestPayment2111\"},\"risks\":{\"postCodeCheck\":\"UNKNOWN\"}}"
【问题讨论】:
-
ResponseJudo的错误和类布局是什么
-
请发送 ResponseJudo 课程?
标签: c# json asp.net-web-api