public static OKServiceRequest Put(string path, RequestParams parameters, RequestHandler handler) { OKServiceRequest req = new OKServiceRequest(path, parameters, OKRestVerb.Put); req.Perform(handler); return(req); }
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); }
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); }
public static OKServiceRequest Put(string path, RequestParams parameters, RequestHandler handler) { OKServiceRequest req = new OKServiceRequest(path, parameters, OKRestVerb.Put); req.Perform(handler); return req; }
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; }