static async Task RunAsync() { client.BaseAddress = new Uri("http://localhost:7916/"); client.DefaultRequestHeaders.Accept.Clear(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); //make pet MockPet pat = new MockPet { Color = "blu", NickName = "init", merchantAbility = 0, PwrLvl = 0, Species = "client" }; ShowPet(pat); Console.WriteLine(" New nickname: "); //get pet api url pat.NickName = GetPetAsync().Result; ShowPet(pat); Console.ReadLine(); }
static void ShowPet(MockPet pet) { Console.WriteLine($"Name: {pet.NickName}"); }