/// <summary> /// Build HttpClient with custom message if specified /// </summary> /// <param name="builder">builder</param> private void CreateHttpClient(RestClientConfigurationBuilder builder) { var handlers = new List <DelegatingHandler>(builder.Handlers.Select(x => x())) .ToArray(); if (builder.HttpMessageHandler != null) { HttpClient = HttpClientFactory.Create(builder.HttpMessageHandler, handlers); } else { HttpClient = HttpClientFactory.Create(handlers); } }
public RestClientConfiguration(RestClientConfigurationBuilder builder) { CreateHttpClient(builder); Properties = builder.Properties.ToDictionary(x => x.Key, x => x.Value, StringComparer.OrdinalIgnoreCase); }