Exemple #1
0
        /// <summary>
        /// Use timer middleware which measures how long the request takes.
        /// </summary>
        /// <param name="builder">Builder instance</param>
        /// <param name="configure">Action to configure timer options.</param>
        public static FluentHttpClientBuilder UseTimer(this FluentHttpClientBuilder builder, Action <TimerHttpMiddlewareOptions>?configure)
        {
            var options = new TimerHttpMiddlewareOptions();

            configure?.Invoke(options);
            return(builder.UseTimer(options));
        }
 /// <summary>
 /// Use timer middleware which measures how long the request takes.
 /// </summary>
 /// <param name="builder">Builder instance</param>
 /// <param name="options">Options to specify for the timer options.</param>
 public static FluentHttpClientBuilder UseTimer(this FluentHttpClientBuilder builder, TimerHttpMiddlewareOptions options = null)
 => builder.UseMiddleware <TimerHttpMiddleware>(options ?? new TimerHttpMiddlewareOptions());