c# - Call JSON Web API and get data
<p>I'm trying to access the individual tags from the Json Web API. if you look at my Debug message you can see that every tag is shown with correct data in "jsonMessage", but when i return "result" every tag is set to null:</p>

<p><a href="https://i.imgur.com/vZT7otf.png" rel="nofollow noreferrer"><img src="https://i.imgur.com/vZT7otf.png" alt="Debug message"></a> </p>

<p>So how to I get all the tags from <code>jsonMessage</code> to return so I can just type for example <code>texblock.text = card.name;</code> and so forth</p>

<pre><code>public async static Task&lt;Card&gt; GetCard()
{
    string url = String.Format("https://api.magicthegathering.io/v1/cards/386616");

    HttpClient client = new HttpClient();
    //client.BaseAddress = new Uri(url);

    var response = await client.GetAsync(url);

    var jsonMessage = await response.Content.ReadAsStringAsync();
    var serializer = new DataContractJsonSerializer(typeof(Card));
    var ms = new MemoryStream(Encoding.UTF8.GetBytes(jsonMessage));

    var result = (Card)serializer.ReadObject(ms);
    return result;
}
</code></pre>

<p>Here's the Cards class:</p>

<pre><code>public class Card
{
    public string name { get; set; }
    public string manaCost { get; set; }
    public int cmc { get; set; }
    public List&lt;string&gt; colors { get; set; }
    public string type { get; set; }
    public List&lt;string&gt; types { get; set; }
    public List&lt;string&gt; subtypes { get; set; }
    public string rarity { get; set; }
    public string set { get; set; }
    public string text { get; set; }
    public string artist { get; set; }
    public string number { get; set; }
    public string power { get; set; }
    public string toughness { get; set; }
    public string layout { get; set; }
    public int multiverseid { get; set; }
    public string imageUrl { get; set; }
    public List&lt;Ruling&gt; rulings { get; set; }
    public List&lt;ForeignName&gt; foreignNames { get; set; }
    public List&lt;string&gt; printings { get; set; }
    public string originalText { get; set; }
    public string originalType { get; set; }
    public List&lt;Legality&gt; legalities { get; set; }
    public string id { get; set; }
}
</code></pre>