Пример #1
0
 protected HttpJsonRequest CreateHttpJsonRequest(string requestUriString, HttpMethod httpMethod, bool disableRequestCompression = false, bool disableAuthentication = false)
 {
     return(JsonRequestFactory.CreateHttpJsonRequest(new CreateHttpJsonRequestParams(null, requestUriString, httpMethod, Credentials, TimeSeriesConvention)
     {
         DisableRequestCompression = disableRequestCompression,
         DisableAuthentication = disableAuthentication
     }));
 }
Пример #2
0
        public IndexStore(string entityUrl, FindConfiguration config)
        {
            var serviceUrl = config.ServiceUrl.Trim();

            if (serviceUrl.EndsWith("/"))
            {
                serviceUrl = serviceUrl.Remove(serviceUrl.Length - 1);
            }
            var index = config.DefaultIndex;

            BaseUrl           = $"{serviceUrl}/{index}/{entityUrl}";
            ListUrlTemplate   = BaseUrl + "/list?from={0}&size={1}&tags=" + Helpers.SiteIdTag + "{2}," + Helpers.LanguageTag + "{3}";
            GetUrlTemplate    = BaseUrl + "/{0}";
            DeleteUrlTemplate = BaseUrl + "/{0}";
            CreateUrlTemplate = BaseUrl;

            RequestFactory    = new JsonRequestFactory(config.DefaultRequestTimeout);
            DefaultSerializer = Serializer.CreateDefault();
        }