Skip to content

Instantly share code, notes, and snippets.

@srkirkland
Created July 15, 2015 05:48
Show Gist options
  • Save srkirkland/ac50c18660f96ab0478e to your computer and use it in GitHub Desktop.
Save srkirkland/ac50c18660f96ab0478e to your computer and use it in GitHub Desktop.
factual query using httpclient and oauth util
const string placeQuery = "http://api.v3.factual.com/t/places?geo={\"$point\":[38.544401,-121.742229]}";
using (var client = new HttpClient())
{
var header = OAuthUtil.GenerateHeader(new Uri(placeQuery), "KEY",
"SECRET", null, null, "GET");
client.DefaultRequestHeaders.Add("Authorization", header);
var res = client.GetAsync(placeQuery).Result;
res.EnsureSuccessStatusCode();
var content = res.Content.ReadAsStringAsync().Result;
var factualResponse = JsonConvert.DeserializeObject<FactualPlaceResponseContainer>(content);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment