Пример #1
0
 public AuthenticatedUser GetMe()
 {
     var request = _webAgent.CreateGet(MeUrl);
     var response = (HttpWebResponse)request.GetResponse();
     var result = _webAgent.GetResponseString(response.GetResponseStream());
     var json = JObject.Parse(result);
     User = new AuthenticatedUser(this, json, _webAgent);
     return User;
 }
Пример #2
0
        /// <summary>
        /// Initializes the User property if it's null,
        /// otherwise replaces the existing user object
        /// with a new one fetched from reddit servers.
        /// </summary>
        public void InitOrUpdateUser()
        {
            var json = _webAgent.CreateAndExecuteRequest(string.IsNullOrEmpty(_webAgent.AccessToken) ? MeUrl : OAuthMeUrl);

            User = new AuthenticatedUser(this, json, _webAgent);
        }