Skip to content

Instantly share code, notes, and snippets.

@SibeeshVenu
Created August 15, 2021 14:40
Show Gist options
  • Save SibeeshVenu/84ff6853fec53f7b93345170be8050bd to your computer and use it in GitHub Desktop.
Save SibeeshVenu/84ff6853fec53f7b93345170be8050bd to your computer and use it in GitHub Desktop.
async Task MyAPIDelete(HttpClient cons)
{
using (cons)
{
HttpResponseMessage res = await cons.GetAsync("api/tblTags/2");
res.EnsureSuccessStatusCode();
if (res.IsSuccessStatusCode)
{
res = await cons.DeleteAsync("api/tblTags/2");
Console.WriteLine("\n");
Console.WriteLine("\n");
Console.WriteLine("-----------------------------------------------------------");
Console.WriteLine("------------------Calling Delete Operation--------------------");
Console.WriteLine("------------------Deleted-------------------");
Console.ReadLine();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment