Skip to content

Instantly share code, notes, and snippets.

@NicoVermeir
Last active February 29, 2016 14:18
Show Gist options
  • Save NicoVermeir/5e899755969f678b5b5e to your computer and use it in GitHub Desktop.
Save NicoVermeir/5e899755969f678b5b5e to your computer and use it in GitHub Desktop.
private async Task FetchData()
{
var service = new ResourcesService();
var result = await service.FetchAllResources();
//textblock is bound against Json
Json = result
}
public class ResourcesService
{
public async Task<string> FetchAllResources()
{
var client = RestClient.GetClientInstance();
var result = await client.GetAsync(Constants.ApiCallUrl).ConfigureAwait(false);
string json = await result.Content.ReadAsStringAsync().ConfigureAwait(false);
return json;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment