Skip to content

Instantly share code, notes, and snippets.

@MACastro987
Created February 9, 2017 23:23
Show Gist options
  • Save MACastro987/8fd95de946db4458ac8f9ff4eda99058 to your computer and use it in GitHub Desktop.
Save MACastro987/8fd95de946db4458ac8f9ff4eda99058 to your computer and use it in GitHub Desktop.
Http Request to Weather Underground
const string url = @"http://api.wunderground.com/api/72002fc4632c2927/conditions/q/27519.json";
async static void RetrieveData()
{
try
{
string contents;
string Url = String.Format(url);
HttpClient client = new HttpClient();
contents = await client.GetStringAsync(url);
System.Diagnostics.Debug.WriteLine(contents);
}
catch (System.Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment