Skip to content

Instantly share code, notes, and snippets.

@GrillPhil
Created May 31, 2018 20:02
Show Gist options
  • Save GrillPhil/c1c0babc57f6fba95ba71291885c18c4 to your computer and use it in GitHub Desktop.
Save GrillPhil/c1c0babc57f6fba95ba71291885c18c4 to your computer and use it in GitHub Desktop.
Step 3
var httpClient = new HttpClient();
var tenant = config["Tenant"];
var apiKey = config["ApiKey"];
var baseUrl = config["BaseUrl"];
var requestUrl = string.Format(baseUrl, tenant, "projects.json?", apiKey);
var response = await httpClient.GetStringAsync(requestUrl);
var projects = (JsonConvert.DeserializeObject<IEnumerable<ProjectWrapper>>(response)).Select(wrapper => wrapper.Project);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment