Skip to content
Justin Skiles edited this page Apr 17, 2020 · 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<CSGOServer>client);
Clone this wiki locally