Esempio n. 1
0
        public static async Task <T> GetData <T>(string callPath)
        {
            INEResponse <T> parse = new INEResponse <T>();

            if (Auth != null)
            {
                HttpContent response = await Auth.GetData(BaseURL + callPath);

                parse = await response.ReadAsAsync <INEResponse <T> >();
            }

            return(parse.body);
        }
Esempio n. 2
0
        public static async Task <T> PostData <T>(string callPath, object data)
        {
            T      responseData = default(T);
            string json         = JsonConvert.SerializeObject(data, Formatting.None);

            HttpContent res = await Auth.PostData(BaseURL + callPath, json);

            if (res != null)
            {
                INEResponse <T> parse = await res.ReadAsAsync <INEResponse <T> >();

                //string resJson = await res.ReadAsStringAsync();
                //Debug.Log( string.Format( "returned: {0}", resJson ) );
                responseData = parse.body;
            }

            return(responseData);
        }