Beispiel #1
0
        public async Task <FluentHttpResponse> Send(HttpRequestMessage request)
        {
            if (request == null)
            {
                throw new ArgumentNullException(nameof(request));
            }

            var requestId = request.AddRequestId();
            await RawHttpClient.SendAsync(request);

            var executionContext = _requestTracker.Pop(requestId);

            return(executionContext.Response);
        }
        public async Task <FluentHttpResponse> Send(HttpRequestMessage request)
        {
            if (request == null)
            {
                throw new ArgumentNullException(nameof(request));
            }

            var requestId = request.AddRequestId();
            await RawHttpClient.SendAsync(request);

            request.Dispose();             // todo: since consumer is passing request message leave it up to him or not? or make global config ShouldDisposeMessageOnSend or so
            var executionContext = _requestTracker.Pop(requestId);

            return(executionContext.Response);
        }