Hobsons.WebApiHelpers.EnricherHttpMessageHandler.SendAsync C# (CSharp) Method

SendAsync() protected method

Override default sendAsync.
protected SendAsync ( HttpRequestMessage request, CancellationToken cancellationToken ) : Task
request System.Net.Http.HttpRequestMessage /// The request. ///
cancellationToken System.Threading.CancellationToken /// The cancellation token. ///
return Task
        protected override async Task<HttpResponseMessage> SendAsync(
            HttpRequestMessage request, CancellationToken cancellationToken)
        {
            var response = await base.SendAsync(request, cancellationToken);

            if (this.responseEnrichers == null)
            {
                return response;
            }

            return this.responseEnrichers.Where(e => e.CanEnrich(response))
                       .Aggregate(response, (resp, enricher) => enricher.Enrich(response));
        }
EnricherHttpMessageHandler