Correctly use HttpClient instances across the entire framework #20
Description
HttpClient is intended to be reused as much as possible throughout the entire application.
Internally, it uses an object of type HttpClientHandler, which actually makes the HTTP requests. By default, even when disposed, the underlying socket will not be immediately released, keeping them with the TIME_WAIT state. When in TIME_WAIT, the socket cannot be reused, and under heavy loading it can cause a socket exhaustion, preventing the system from making more requests (for a limited amount of time).
LightAPI uses an instance of HttpClient under the hood, obviously using one instance for each LightAPI instance.
As it doesn't change the default implementation of HttpClientHandler, we will inevitably face the problem above.
To fix this problem, Microsoft created a library called HttpClientFactory, which managed the creation of HttpClient instances and their HttpClientHandler's.
The Liquid Framework should use this library by default when dealing with HttpClient-based requests.