private Dictionary <string, object> GetInner(string name, int page, int pageSize, string filter, string sort) { CqlConfig cqlConfig = GetCqlConfig(); RestClient client = new RestClient(cqlConfig.ApiUrl + GetCql(cqlConfig, name, page, pageSize, filter, sort)); RestRequest request = new RestRequest(Method.GET); request.AddHeader("Authorization", cqlConfig.AuthorizationHeader); var response = client.Execute(request); if (response.StatusCode != System.Net.HttpStatusCode.OK) { throw new CqlException(response.ErrorMessage ?? response.Content, response.ErrorException); } try { JavaScriptSerializer jss = new JavaScriptSerializer(); var result = (Dictionary <string, object>)jss.Deserialize <dynamic>(response.Content); return(result); } catch { throw new CqlException(response.Content); } }
private string GetCql(CqlConfig cqlConfig, string name, int page, int pageSize, string filter, string sort) { return(System.Web.HttpContext.Current.Server.UrlEncode(string.Format(cqlConfig.Cqls[name], Maps.Instance.GetMap().AppName, filter, sort, pageSize))); }