示例#1
0
        /// <inheritdoc />
        public virtual HttpClient CreateClient(string baseUrl, ILogger?logger = null)
        {
            var builder = new HttpClientBuilder().WithBaseUrl(baseUrl);

            if (logger != null)
            {
                builder.WithLogger(logger);
            }

            return(builder.Build());
        }
示例#2
0
        /// <inheritdoc />
        public virtual HttpClient CreateAuthClient(
            string baseUrl,
            ISessionContext sessionContext,
            ILogger?logger = null)
        {
            var builder = new HttpClientBuilder().WithBaseUrl(baseUrl);

            if (logger != null)
            {
                builder.WithLogger(logger);
            }

            builder.WithSessionContext(sessionContext);

            return(builder.Build());
        }