I have this code, which downloads a string from this api, and then deserializes it. I have figured out how to access the "word" and "phonetic" objects, but how would I access the "audio" object inside of the "phonetics" array, or some of the objects inside of "meanings"? 1
private void Button1_Click(object sender, EventArgs e)
{
string result = "";
string link = ($"https://api.dictionaryapi.dev/api/v2/entries/en/hello");
var json = new WebClient().DownloadString(link);
var jsonDes = JsonConvert.DeserializeObject<List<DictionaryAPIResultData>>(json);
foreach (var data in jsonDes)
{
Console.WriteLine( data.phonetics);
}
}
public class DictionaryAPIResultData
{
[JsonProperty("word")]
internal string word { get; set; }
[JsonProperty("phonetics")]
internal List<string> phonetics { get; set; }
}
Hope someone can help!