Created
August 15, 2021 14:41
-
-
Save SibeeshVenu/b52bb82946ad305c5fa95bc1ccbe6ae8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static async Task MyAPIPost(HttpClient cons) | |
{ | |
using (cons) | |
{ | |
var tag = new tblTag { tagName = "jQuery", tagDescription = "This tag is all about jQuery" }; | |
HttpResponseMessage res = await cons.PostAsJsonAsync("api/tblTags", tag); | |
res.EnsureSuccessStatusCode(); | |
if (res.IsSuccessStatusCode) | |
{ | |
Console.WriteLine("\n"); | |
Console.WriteLine("\n"); | |
Console.WriteLine("-----------------------------------------------------------"); | |
Console.WriteLine("------------------Calling Post Operation--------------------"); | |
Console.WriteLine("------------------Created Successfully--------------------"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment