Problems when deserializing Json in Xamarin


Hello, I have a problem when it comes to consuming data from an api rest. I have the following class:

public partial class Assignee
    public Uri Self { get; set; }

    public string Name { get; set; }

    public string Key { get; set; }

    public string AccountId { get; set; }

    public string EmailAddress { get; set; }

    public Urls AvatarUrls { get; set; }

    public string DisplayName { get; set; }

    public bool Active { get; set; }

    public TimeZone TimeZone { get; set; }

And as soon as I start, I want you to return the email, for example, and I try like this:

private const string Url = "";
    protected override void OnAppearing()
        var client = new RestClient(Url);
        var request = new RestRequest(Method.GET);
        request.AddHeader("Postman-Token", "683c-b7567-42c-8dea-f90f567");
        request.AddHeader("cache-control", "no-cache");
        request.AddHeader("Authorization", "Basic Yyryrty56456JG");
        request.AddHeader("Content-Type", "application/json");
        request.AddHeader("Accept", "application/json");
        IRestResponse response = client.Execute(request);

        var content = JsonConvert.DeserializeObject<Assignee>(response.Content); 

        LblText.Text = content.EmailAddress;

I think I'm not very clear on the issue of Deserializar un json, Visual Studio does not return any error, but it does not show me anything on the screen, does anyone know what I'm failing? Thanks.

asked by Fran Pino 20.12.2018 в 16:32

0 answers