Skip to content
Youssof Khawaja edited this page Sep 9, 2021 · 6 revisions

When constructing an interface from an interface factory, you can provide an instance to your own HttpClient. This allows you to maintain the lifetime of your HttpClient instances, use a single HttpClient across multiple interfaces, and provide customization unique to your scenarios.

If you don't provide your own HttpClient, the library will create a new one on each request.

HttpClient client = new HttpClient();
var steamUserInterface = webInterfaceFactory.CreateSteamWebInterface<SteamUser>(client);
var playerServiceInterface = webInterfaceFactory.CreateSteamWebInterface<PlayerService>(client);
var csGoServerInterface = webInterfaceFactory.CreateSteamWebInterface<CSGOServers>(client);
Clone this wiki locally