Skip to content

Instantly share code, notes, and snippets.

@srkirkland
Created July 15, 2015 07:09
Show Gist options
  • Save srkirkland/7c42d2eb7008c89ff219 to your computer and use it in GitHub Desktop.
Save srkirkland/7c42d2eb7008c89ff219 to your computer and use it in GitHub Desktop.
oauth manually using xamarin.auth
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