Пример #1
0
        public static OKServiceRequest Put(string path, RequestParams parameters, RequestHandler handler)
        {
            OKServiceRequest req = new OKServiceRequest(path, parameters, OKRestVerb.Put);

            req.Perform(handler);
            return(req);
        }
Пример #2
0
        public static OKServiceRequest MultipartPost(string path, RequestParams parameters, OKUploadBuffer upload, RequestHandler handler)
        {
            OKServiceRequest req = new OKServiceRequest(path, parameters, OKRestVerb.Post);

            req.Upload = upload;
            req.Perform(handler);
            return(req);
        }
Пример #3
0
        static public void Main()
        {
            Console.WriteLine(CommandHelp);
            while (true)
            {
                Console.Write(">> ");
                string line = Console.ReadLine();
                switch (line)
                {
                case "l":
                    OKServiceRequest.Get("/leaderboards", null, response => {
                        OKLog.Info("Response Json Object: " + response.Obj);
                    });
                    break;

                case "h":
                    Console.WriteLine(CommandHelp);
                    break;

                case "sh":
                    Console.Write("Enter the new host (e.g. api.openkit.io): ");
                    string h = Console.ReadLine();
                    var    u = new Uri(String.Format("http://{0}", h));
                    OKServiceRequest.Host = u.Host;
                    OKServiceRequest.Port = u.Port;
                    break;

                case "sa":
                    Console.Write("Enter the new app key: ");
                    string a = Console.ReadLine();
                    OKServiceRequest.AppKey = a;
                    break;

                case "ss":
                    Console.Write("Enter the new secret key: ");
                    string s = Console.ReadLine();
                    OKServiceRequest.SecretKey = s;
                    break;

                case "p":
                    Console.WriteLine("Not implemented");
                    break;
                }
            }
//			System.Threading.Thread.Sleep(Timeout.Infinite);
        }
Пример #4
0
 public static OKServiceRequest Put(string path, RequestParams parameters, RequestHandler handler)
 {
     OKServiceRequest req = new OKServiceRequest(path, parameters, OKRestVerb.Put);
     req.Perform(handler);
     return req;
 }
Пример #5
0
 public static OKServiceRequest MultipartPost(string path, RequestParams parameters, OKUploadBuffer upload, RequestHandler handler)
 {
     OKServiceRequest req = new OKServiceRequest(path, parameters, OKRestVerb.Post);
     req.Upload = upload;
     req.Perform(handler);
     return req;
 }