Canonical
How can I make an HTTP request and send some data using thePOST
method?
If you like a fluent API you can use Tiny.RestClient. It's available at NuGet.
var client = new TinyRestClient(new HttpClient(), "http://MyAPI.com/api");
// POST
var city = new City() { Name = "Paris", Country = "France" };
// With content
var response = await client.PostRequest("City", city)
.ExecuteAsync();