public IEnumerator GetArray <T>(Action <IRestResponse <T[]> > callback = null, string path = null) { var request = new ZumoRequest(ApiUrl(path), Method.GET, false, client.User); if (!string.IsNullOrEmpty(key)) { request.AddQueryParam(PARAM_CODE, key, true); } yield return(request.Request.Send()); request.ParseJsonArray <T>(callback); }
private IEnumerator InvokeApiArray <B, T>(B body, Method httpMethod = Method.POST, Action <IRestResponse <T[]> > callback = null, string path = null, QueryParams query = null) { var request = new ZumoRequest(ApiUrl(path), httpMethod, false, client.User); if (!string.IsNullOrEmpty(key)) { request.AddQueryParam(PARAM_CODE, key, true); } if (body != null) { request.AddBody(body); } yield return(request.Request.Send()); request.ParseJsonArray <T>(callback); }
public IEnumerator Post <B, T>(B body, Action <IRestResponse <T> > callback = null) { var request = new ZumoRequest(ApiUrl(), Method.POST, false, client.User); if (!string.IsNullOrEmpty(key)) { request.AddQueryParam(PARAM_CODE, key, true); } request.AddBody(body); yield return(request.Request.Send()); if (typeof(T) == typeof(string)) { request.GetText(callback); } else { request.ParseJson <T>(callback); } }
private IEnumerator InvokeApi <T>(Method httpMethod = Method.GET, Action <IRestResponse <T> > callback = null, string path = null, QueryParams query = null) { var request = new ZumoRequest(ApiUrl(path), httpMethod, false, client.User); request.SetQueryParams(query); if (!string.IsNullOrEmpty(key)) { request.AddQueryParam(PARAM_CODE, key, true); } yield return(request.Request.Send()); if (typeof(T) == typeof(string)) { request.GetText(callback); } else { request.ParseJson <T>(callback); } }