Reputation: 54
I want to call this API in C#, same parameter will be passed.
It's working fine on POSTMAN; I just want to call from asp.net Web Form
Upvotes: 0
Views: 1546
Reputation: 1084
Use that :
var values = new Dictionary<string, string>
{
{ "thing1", "hello" },
{ "thing2", "world" }
};
var content = new FormUrlEncodedContent(values);
var response = await client.PostAsync("http://www.example.com/recepticle.aspx", content);
var responseString = await response.Content.ReadAsStringAsync();
Upvotes: 1