Ejemplo n.º 1
0
        public async Task<string> GetAnonymousToken()
        {
            try
            {
                ProxyClientCore client = new ProxyClientCore(_token);
                Dictionary<string, string> uriParams = new Dictionary<string, string>();
                string result = await client.SendRequest(HttpMethodType.Get, controllerName,
                "getAnonymousToken", null, uriParams);

                if (!string.IsNullOrEmpty(result))
                    return JsonConvert.DeserializeObject<string>(result);

                return null;
            }
            catch (Exception ex)
            {
                return null;
            }
        }
Ejemplo n.º 2
0
        public async Task<LoginData> Login(User user)
        {
            try
            {
                ProxyClientCore client = new ProxyClientCore(_token);
                Dictionary<string, string> uriParams = new Dictionary<string, string>();
                string result = await client.SendRequest(HttpMethodType.Post, controllerName,
                "login", user, uriParams);

                if (!string.IsNullOrEmpty(result))
                    return JsonConvert.DeserializeObject<LoginData>(result);

                return null;
            }
            catch (Exception ex)
            {
                return null;
            }
        }