public ConnectionStatus PostSync(string path, string data) { var restRequest = new RestRequest(); restRequest.Method = Method.POST; restRequest.Uri = path; if (!string.IsNullOrEmpty(data)) { restRequest.Body = Encoding.UTF8.GetBytes(data); } restRequest.Headers = new Dictionary<string, string>(); restRequest.Headers.Add("Content-Type", "application/json"); RestResponse result = GetClient().execute(restRequest); return new ConnectionStatus(DecodeStr(result.Body)); }
public void Get(string path, Action<ConnectionStatus> callback) { var restRequest = new RestRequest(); restRequest.Method = Method.GET; restRequest.Uri = path; restRequest.Headers = new Dictionary<string, string>(); restRequest.Headers.Add("Content-Type", "application/json"); GetClient().execute(restRequest); }
public void Post(string path, string data, Action<ConnectionStatus> callback) { var restRequest = new RestRequest(); restRequest.Method = Method.POST; restRequest.Uri = path; if (!string.IsNullOrEmpty(data)) { restRequest.Body = Encoding.UTF8.GetBytes(data); } restRequest.Headers = new Dictionary<string, string>(); restRequest.Headers.Add("Content-Type", "application/json"); GetClient().execute(restRequest); }
public ConnectionStatus GetSync(string path) { var restRequest = new RestRequest(); restRequest.Method = Method.POST; restRequest.Uri = path; restRequest.Headers = new Dictionary<string, string>(); restRequest.Headers.Add("Content-Type", "application/json"); RestResponse result = GetClient().execute(restRequest); return new ConnectionStatus(DecodeStr(result.Body)); }
public RestResponse execute(RestRequest request) { send_execute(request); return recv_execute(); }
public void Read(TProtocol iprot) { TField field; iprot.ReadStructBegin(); while (true) { field = iprot.ReadFieldBegin(); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 1: if (field.Type == TType.Struct) { request = new RestRequest(); request.Read(iprot); __isset.request = true; } else { TProtocolUtil.Skip(iprot, field.Type); } break; default: TProtocolUtil.Skip(iprot, field.Type); break; } iprot.ReadFieldEnd(); } iprot.ReadStructEnd(); }
public void send_execute(RestRequest request) { oprot_.WriteMessageBegin(new TMessage("execute", TMessageType.Call, seqid_)); var args = new execute_args(); args.Request = request; args.Write(oprot_); oprot_.WriteMessageEnd(); oprot_.Transport.Flush(); }