Skip to content
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

DefaultHttpClient { get; set; } = new HttpClient(); can cause problems #38

Open
Meister1977 opened this issue Feb 17, 2020 · 0 comments

Comments

@Meister1977
Copy link

Hi,

I see, your code should run with different .net versions, but adding a static default HttpClient is not a good idea in .Net Core, because of this:

https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests

I may use the HttpClientFactory and because in .Net core if somebody uses DI, and register the class as Singleton, you should implement
public static GoCardlessClient Create(string accessToken, Environment environment, HttpClientFactory httpClientFactory)
too.

Thanks,
Lőrinc

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

No branches or pull requests

1 participant