Ejemplo n.º 1
0
        internal Task <TResponse> DoRequestAsync <TRequest, TResponse>(
            TRequest p,
            IRequestParameters parameters,
            CancellationToken ct,
            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.DoRequestAsync <TResponse>(p.HttpMethod, url, ct, b, parameters));
        }