-
-
Save stephensmitchell/4bb45cfb42417d504b6fbfe565f9e513 to your computer and use it in GitHub Desktop.
Simple LinqPad example to hit an endpoint #LINQPad
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Needs System.Net; | |
// Prefer HttpClient for real situations other than testing | |
void Main() | |
{ | |
while(true) { | |
try { | |
var url = "http://example.com/sub/dir/page.aspx?a=1234&b=something"; | |
var request = (System.Net.HttpWebRequest) System.Net.WebRequest.Create (url); | |
var response = (System.Net.HttpWebResponse)request.GetResponse (); | |
Console.WriteLine("Finished"); | |
} catch(Exception ex) { | |
Console.WriteLine(ex); | |
} | |
Console.WriteLine("Looping"); | |
System.Threading.Thread.Sleep(TimeSpan.FromSeconds(1)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment