Make A Web Request With Httprequest

[Solved] Make A Web Request With Httprequest | Vb - Code Explorer | yomemimo.com
Question : c# post get request

Answered by : theguy920

using System.Net.Http;
HttpClient client = new HttpClient();
/// POST ///
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();
/// GET ///
var responseString = await client.GetStringAsync("http://www.example.com/recepticle.aspx");

Source : https://stackoverflow.com/questions/4015324/how-to-make-an-http-post-web-request | Last Update : Sun, 07 Feb 21

Answers related to make a web request with httprequest

Code Explorer Popular Question For Vb