Skip to content

Add option to pass a HttpMessageHandler to the HttpClient#74

Open
mwinkler wants to merge 2 commits intoSplunkGlobalDevs:masterfrom
mwinkler:master
Open

Add option to pass a HttpMessageHandler to the HttpClient#74
mwinkler wants to merge 2 commits intoSplunkGlobalDevs:masterfrom
mwinkler:master

Conversation

@mwinkler
Copy link

@mwinkler mwinkler commented Sep 5, 2022

This change allow to optionally pass a HttpMessageHandler to the used HttpClient inside the logger.
Example:

var config = builder.Configuration.GetSection("Splunk").Get<SplunkLoggerConfiguration>();
var handler = new HttpClientHandler
{
     Proxy = new WebProxy("http://localhost:8080")
};
builder.Logging.AddProvider(new SplunkHECJsonLoggerProvider(config, null, handler));

To control, how the http client behaves and allows different use cases like adding a proxy, config ssl validation, ....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant