Example #1
0
 public OAuthRequest WithToken(string token, string tokenSecret)
 {
     Token = new OAuthToken(token, tokenSecret);
     return this;
 }
Example #2
0
 public OAuthRequest WithToken(OAuthToken token)
 {
     Token = token;
     Parameters.Add(OAuthParameters.OAuthToken, token.Value);
     return this;
 }
Example #3
0
        public OAuthToken RequestToken()
        {
            var response = MakeRequest();
            using (var sr = new StreamReader(response.GetResponseStream())) {
                var content = sr.ReadToEnd();
                var values = content.Split(new[] {'&'});

                var token = new OAuthToken {Value = values.Where(x => x.StartsWith("oauth_token=")).First().Split('=')[1], Secret = values.Where(x => x.StartsWith("oauth_token_secret=")).First().Split('=')[1]};

                token.Value = HttpEncoder.UrlDecode(token.Value);
                token.Secret = HttpEncoder.UrlDecode(token.Secret);
                return token;
            }
        }