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

Re-use HttpClient instance instead of creating new one on each request #49

Closed
mattherman opened this issue Mar 24, 2018 · 1 comment
Closed
Labels

Comments

@mattherman
Copy link
Owner

The HttpClient type is a shared object and shouldn't be disposed of each time it is used (even though the IDisposable interface would leave you to believe that...).

Instead, the MountebankRequestProxy should maintain a static reference to it and re-use it between requests.

See this blog post for more details.

@mattherman
Copy link
Owner Author

An official recommendation in the Microsoft docs as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant