Ejemplo n.º 1
0
        private IRestRequest CreateRequest(string resource, FilterBase filters)
        {
            var request = new RestRequest();
            if (filters != null)
            {
                filters.Validate();

                foreach (var param in filters.ToDictionary())
                {
                    request.AddParameter(param.Key, param.Value);
                }
            }

            request.DateFormat = _options.DateFormat ?? "yyyy-MM-dd HH:mm:ss";
            request.Resource = resource;
            request.RequestFormat = DataFormat.Json;

            return request;
        }