Skip to content

Instantly share code, notes, and snippets.

@xdumaine
Created March 31, 2014 19:31
Show Gist options
  • Select an option

  • Save xdumaine/9900349 to your computer and use it in GitHub Desktop.

Select an option

Save xdumaine/9900349 to your computer and use it in GitHub Desktop.
public string GetUsername()
{
var url = new Uri(API_URL_BASE);
var client = new HttpClient() { BaseAddress = url };
var response = client.GetAsync(url).Result;
response.EnsureSuccessStatusCode();
return response.Content.ReadAsStringAsync().Result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment