Пример #1
0
 public JObject PostFaultySessionCommand(string command, object payload)
 {
     return(CallApi(() =>
     {
         using (var resp = SimpleWebClient.PostJson(_endpoint + "session/" + _sessionId + "/" + command, payload))
         {
             string json;
             using (System.IO.StreamReader sr =
                        new System.IO.StreamReader(resp.GetResponseStream()))
             {
                 json = sr.ReadToEnd().Trim();
             }
             var obj = JObject.Parse(json);
             return obj;
         }
     }, (json) => JObject.Parse(json)));
 }
Пример #2
0
 public void Session(string program, string _args)
 {
     CallApi(() =>
     {
         var obj = new
         {
             sessionId    = _sessionId,
             capabilities = new
             {
                 app  = program,
                 args = _args
             }
         };
         using (var res = SimpleWebClient.PostJson(_endpoint + "session", obj)) {
             return(0);
         }
     }, null);
 }