c# make http request
private static readonly HttpClient client = new HttpClient();
var responseString = await client.GetStringAsync("http://www.example.com/recepticle.aspx");
c# make http request
private static readonly HttpClient client = new HttpClient();
var responseString = await client.GetStringAsync("http://www.example.com/recepticle.aspx");
how to make a webrequest in c#
Uri ourUri = new Uri(url);
// Create a 'WebRequest' object with the specified url.
WebRequest myWebRequest = WebRequest.Create(url);
// Send the 'WebRequest' and wait for response.
WebResponse myWebResponse = myWebRequest.GetResponse();
// Use "ResponseUri" property to get the actual Uri from where the response was attained.
if (ourUri.Equals(myWebResponse.ResponseUri))
Console.WriteLine("nRequest Url : {0} was not redirected",url);
else
Console.WriteLine("nRequest Url : {0} was redirected to {1}",url,myWebResponse.ResponseUri);
// Release resources of response object.
myWebResponse.Close();
// IGNORE - RC
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us