Beispiel #1
0
        public static T GetObject <T>(string serviceName, string method, bool awaitable, params string[] parameters)
        {
            var json = GetJsonResponse(serviceName, method, true, parameters);

            json = JsonServicesHelper.RemoveJsonpSyntax(json);
            return(Deserialize <T>(json));
        }
Beispiel #2
0
        public static T GetObject <T>(string serviceName, string method, params string[] parameters)
        {
            var json = GetJsonResponse(serviceName, method, parameters);

            json = JsonServicesHelper.RemoveJsonpSyntax(json);
            if (json == null)
            {
                return(default(T));
            }
            return(Deserialize <T>(json));
        }
Beispiel #3
0
        public static bool PostFile <T>(string serviceName, string method, string name, Guid authToken, T graph)
        {
            var requestString = GetSerivcePath(serviceName, method).Replace("?&", "?");
            var jsonCode      = SerializeObject <T>(graph);

            using (var client = new WebClient())
            {
                return
                    (Deserialize <bool>(JsonServicesHelper.RemoveJsonpSyntax(
                                            client.DownloadString(requestString + "&" + "authToken=" + authToken + "&" + name + "=" +
                                                                  jsonCode))));
            }
        }