-
-
Notifications
You must be signed in to change notification settings - Fork 381
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
Reuse HttpClient #459
Comments
Hello @gtoombs-microsaas , Thank you for reporting, you are right. However, there is also some customization in the However, we will look at if we can re-use it when none of those setting are configured which is pretty much the case probably 99% of the time. Best Regards, Jon |
@JonathanMagnan Good news! The specific line you referenced: client.DefaultRequestHeaders.Add("User-Agent", UserAgent); is fairly easy to convert to a per-request setting of headers. There are many convenient ways to do this, including holding those headers in a member variable and applying them en-masse to a request. Said another way: even for the 1% of requests that require customisation, it should still not be necessary to have a separate |
Hello @gtoombs-microsaas , The v1.11.40 has been released. The same Let me know if everything works as expected. Best Regards, Jon |
Amazing, thanks! I'll check it out. |
Currently,
HtmlWeb
does not reuse a client, and spins one up on every call:This is in contravention of the recommendations from .NET:
The text was updated successfully, but these errors were encountered: