Exemplo n.º 1
0
        internal TResponse DoRequest <TRequest, TResponse>(TRequest p, IRequestParameters parameters, Action <IRequestConfiguration> forceConfiguration = null)
            where TRequest : class, IRequest
            where TResponse : class, IElasticsearchResponse, new()
        {
            if (forceConfiguration != null)
            {
                ForceConfiguration(p, forceConfiguration);
            }

            var url = p.GetUrl(ConnectionSettings);
            var b   = (p.HttpMethod == HttpMethod.GET || p.HttpMethod == HttpMethod.HEAD) ? null : new SerializableData <TRequest>(p);

            return(LowLevel.DoRequest <TResponse>(p.HttpMethod, url, b, parameters));
        }