Hi,
I am calling an api and this is the return data.
Could you please help me to loop through the JSON data?
The JSON string -
My Classes -
Code -
Thanks,
I am calling an api and this is the return data.
Could you please help me to loop through the JSON data?
The JSON string -
JavaScript:
{
"Outputdata": {
"@xmlns": "[URL]http://xmlns.oracle.com/apps/pa/[/URL].......",
"@xmlns:xsi": "[URL]http://www.w3.org/2001/XMLSchema-instance[/URL]",
"TASK_0": {
"TASK_O_ITEM": [
{
"CODE": "123",
"TASK_NAME": "abc"
},
{
"CODE": "456",
"TASK_NAME": "def"
}, {
"CODE": "789",
"TASK_NAME": "ghi"
}
]
},
"ERROR_O": null
}
}
C#:
public class Outputdata
{
public TASK_O TASK_O{ get; set; }
public string ERROR_O { get; set; }
}
public class TASK_O
{
public List<TASK_O_ITEM> TASK_O{ get; set; }
}
public class TASK_O_ITEM
{
public string CODE { get; set; }
public string NAME { get; set; }
}
C#:
var responseBody = streamReader.ReadToEnd();
var result = JsonConvert.DeserializeObject<OutputParameters>(responseBody);
Last edited by a moderator: