Skip to content

Instantly share code, notes, and snippets.

@SibeeshVenu
Created August 15, 2021 14:39
Show Gist options
  • Save SibeeshVenu/79b3004ee97c61d112100e8324a0e7fb to your computer and use it in GitHub Desktop.
Save SibeeshVenu/79b3004ee97c61d112100e8324a0e7fb to your computer and use it in GitHub Desktop.
static async Task MyAPIGet(HttpClient cons)
{
using (cons)
{
HttpResponseMessage res = await cons.GetAsync("api/tblTags/2");
res.EnsureSuccessStatusCode();
if (res.IsSuccessStatusCode)
{
tblTag tag = await res.Content.ReadAsAsync<tblTag>();
Console.WriteLine("\n");
Console.WriteLine("---------------------Calling Get Operation------------------------");
Console.WriteLine("\n");
Console.WriteLine("tagId tagName tagDescription");
Console.WriteLine("-----------------------------------------------------------");
Console.WriteLine("{0}\t{1}\t\t{2}", tag.tagId, tag.tagName, tag.tagDescription);
Console.ReadLine();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment