Open Steffx115 opened 2 weeks ago
If you're using DI to register the Binance clients (services.AddBinance(..);
) then the http client will be internally registered as a typed client like this
services.AddHttpClient<IBinanceRestClient, BinanceRestClient>(options =>
{
options.Timeout = restOptions.RequestTimeout;
})
If you're not using DI you can pass an http client in the BinanceRestClient constructor:
var client = new BinanceRestClient(httpClientInstance, loggerFactory, options =>{});
Is a different HttpClient used for each request if none is set?
A single HttpClient is used per client. So if you're re-using the same client the same HttpClient is used, but if you're constructing clients each time then a new HttpClient is used each time
I am currently trying to read bulk data from BinanceApi into a DB, but cant modify the default httpclient as i assume it would interfere with other libraries using the default client.
Is it possible to set a specific httpclient(factory) to use?