How do I parse below JSon string to get the value of RESULT & ERROR?
{
"RESPONSE": [
{
"DT": "20210317",
"I_NO": "1031021",
"C_NO": "1021",
"RESULT": "E",
"DCODE": "2-B1",
"ERROR": "[AMT] is mandatory."
}
]
}
Create your c# class for deserialization.
public class RESPONSE
{
public string DT { get; set; }
public string I_NO { get; set; }
public string C_NO { get; set; }
public string RESULT { get; set; }
public string DCODE { get; set; }
public string ERROR { get; set; }
}
public class Root
{
public List<RESPONSE> RESPONSE { get; set; }
}
Then Deserialize with Newtonsoft
var response = JsonConvert.DeserializeObject<Root>(jsonString);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.