Hey how do i parse this return Json string.
to get only the Data I tried this approach
Model:
public class InstagramProfile
{
public string username { get; set; }
public string bio { get; set; }
public string website { get; set; }
public string profile_picture { get; set; }
public string full_name { get; set; }
public Counts counts { get; set; }
public string id { get; set; }
}
for my Service
public class InstagramService
{
public async Task<InstagramProfile> GetInstagramProfile(string accessToken)
{
var httpClient = new HttpClient();
var userJson = await httpClient.GetStringAsync(Constant.InstagramAu + accessToken);
var instagramProfile = JsonConvert.DeserializeObject<InstagramProfile>(userJson);
return instagramProfile;
}
}
To test
private async Task ExcLog()
{
var intg = new InstagramService();
var token = "MyToken";
var que = await intg.GetInstagramProfile(token);
await DisplayAlert(PageKeys.Tags, que.full_name, "OK");
}
How do I get the Data?