Click here to Skip to main content
15,888,521 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how do i do Put and delete requests for web api upon an event(say button click ) from code behind not through ajax
Posted

 
Share this answer
 
Using HttpClient -

C#
var client = new HttpClient();
var dto = new Dto {prop1 = "value"};

var reponse = client.PostAsJsonAsync("api/methodput", dto).Result;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900