c# код: -
var handler = new HttpClientHandler();
HttpClient client = new HttpClient(handler);
string result = await client.GetStringAsync(url);
Console.WriteLine(result);
json respose (результат): -
{
"accountstab": [
{
"LoginType": "r",
"RepId": 3368,
"RepName": "Aachi's M",
"RepUName": "aachis",
"RepPwd": "aachis123",
"WhlId": null,
"RepLocalId": null,
"WhoName": "Aachi's M",
"WhoTin": "32661034",
"WhoEmail": "hanee@gmail.com"
},
{
"LoginType": "r",
"RepId": 3335,
"RepName": "AL-NAJA M",
"RepUName": "alnaja",
"RepPwd": "chemmad",
"WhlId": null,
"RepLocalId": null,
"WhoName": "AL-NAJA",
"WhoTin": "7222075",
"WhoEmail": "abbas@gmail.com"
}
]
}
класс модели:
public class RootObject
{
public List<Accountstab> accountstab { get; set; }
}
public class Accountstab
{
public string LoginType { get; set; }
public int RepId { get; set; }
public string RepName { get; set; }
public string RepUName { get; set; }
public string RepPwd { get; set; }
public int? WhlId { get; set; }
public int? RepLocalId { get; set; }
public string WhoName { get; set; }
public string WhoTin { get; set; }
public string WhoEmail { get; set; }
}