Created
July 15, 2015 07:09
-
-
Save srkirkland/7c42d2eb7008c89ff219 to your computer and use it in GitHub Desktop.
oauth manually using xamarin.auth
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 = Xamarin.Auth.OAuth1.GetAuthorizationHeader ("GET", new Uri ("http://api.v3.factual.com/t/places"), new Dictionary<string,string> { {"geo","{\"$point\":[38.544401,-121.742229]}"} }, | |
"key", "secret", string.Empty, string.Empty); | |
client.DefaultRequestHeaders.Add("Authorization", header); | |
var res = client.GetAsync(placeQuery).Result; | |
// res.EnsureSuccessStatusCode(); | |
var content = await res.Content.ReadAsStringAsync(); | |
var clen = content.Length; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment