Created
July 15, 2015 05:48
-
-
Save srkirkland/ac50c18660f96ab0478e to your computer and use it in GitHub Desktop.
factual query using httpclient and oauth util
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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