public void BuscarSet(string set) { var rota = "https://api.scryfall.com/"; //var rest = $"sets/{set}"; var rest = "sets/"; var resultado = ApiConsume.Get(rota, rest).Result; try { var sets = JsonConvert.DeserializeObject <Rootobject>(resultado); foreach (var item in sets.data) { Console.WriteLine(item.name); } //return sets; } catch (System.Exception e) { Console.WriteLine(e.ToString()); //return null; } }
public DataCard[] BuscarCard() { var rota = "https://api.scryfall.com"; //var rest = $"sets/{set}"; var rest = "/cards/collection"; var resultado = ApiConsume.Post(rota, rest, "war", "2").Result; try { var sets = JsonConvert.DeserializeObject <MTGCardDTO>(resultado); return(sets.data); } catch (System.Exception e) { Console.WriteLine(e.ToString()); return(null); } }