AppHarbor.Client.AppHarborClient.GetUserInformation C# (CSharp) Method

GetUserInformation() public method

public GetUserInformation ( string token ) : User
token string
return User
        public User GetUserInformation(string token)
        {
            WebClient wc = new WebClient();
            wc.Headers.Add("Authorization", "BEARER " + token);
            wc.Headers.Add("Accept", "application/json");
            var str = wc.DownloadString("https://appharbor.com/user");
            dynamic obj = JsonConvert.DeserializeObject(str);
            User ret = new User()
            {
                EmailAddress = obj.email_addresses[0].Value,
                UserName = obj.username,
                UniqueId = obj.id
            };
            return ret;
        }