Skip to content

Support for IHttpClientFactory and named HttpClients #156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Matti-Koopa
Copy link

I added support for IHttpClientFactory and named HttpClients. If configured, the used HttpClient will instead be created from the factory.
This enables (for example) configuring a proxy or sending client certificates over SSL to authenticate on the server.
I also included a README-addition on how to include your IServiceProvider to the NLog dependency injection method.

Because this feature requires System.Net.Http.IHttpClientFactory, which isn't part of .NET Standard 1.3 and is provided with the NuGet package Microsoft.Extensions.Http which only support .NET Standard 2.0 and up, I added .NET Standard 2.0 target support to this project. All changes will only apply to this target.

@dustinchilson
Copy link
Owner

Looks good other than it looks like some of the examples break on the new dependency, dependabot already has the fixes for that so I can see If I can get those merged in

@dustinchilson
Copy link
Owner

@Matti-Koopa Sorry it took me so long to get back to this, if you merge main into your branch I'll merge your PR in.

@jardakosulic
Copy link

Hello, could this pull request be merged? We need to use client certificate for request authorization and it works pretty well with this version.

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.

4 participants