/// <inheritdoc />
        public async Task <FluentHttpResponse> Send(FluentHttpRequest request)
        {
            if (request == null)
            {
                throw new ArgumentNullException(nameof(request));
            }

            var response = await _middlewareRunner.Run(request, async() =>
            {
                var result = await RawHttpClient.SendAsync(request.Message, request.CancellationToken)
                             .ConfigureAwait(false);
                return(ToFluentResponse(result, request.Items));
            }).ConfigureAwait(false);


            if (HasSuccessStatusOrThrow && !request.HasSuccessStatusOrThrow.HasValue)
            {
                response.EnsureSuccessStatusCode();
            }

            if (request.HasSuccessStatusOrThrow.HasValue && request.HasSuccessStatusOrThrow.Value)
            {
                response.EnsureSuccessStatusCode();
            }

            return(response);
        }
        protected override async Task <HttpResponseMessage> SendAsync(
            HttpRequestMessage request,
            CancellationToken cancellationToken
            )
        {
            FluentlyExecutionContext context = null;
            var requestId = request.GetRequestId();

            if (requestId != null)
            {
                _requestTracker.TryPeek(requestId, out context);
            }

            var fluentlyRequest = context?.Request ?? request.ToFluentHttpRequest(_httpClient);

            var fluentlyResponse = await _middlewareRunner.Run(
                fluentlyRequest,
                async() =>
            {
                var response = await base.SendAsync(request, cancellationToken);
                return(response.ToFluentHttpResponse(fluentlyRequest.Items));
            });

            if (context != null)
            {
                _requestTracker.Push(requestId, fluentlyResponse);
            }

            return(fluentlyResponse?.Message);
        }