AddHttpClientGitHub
AddHttpClientGitHub is an extension method used in .NET applications to register a preconfigured HttpClient for interacting with the GitHub REST API. It relies on the IHttpClientFactory to manage HttpClient lifetimes, improve reliability, and reduce socket exhaustion.
The extension typically configures the client with the GitHub API base address (https://api.github.com/), and sets essential
Usage involves adding the client to the service collection during startup, for example by calling AddHttpClientGitHub
Advantages include consistent configuration across callers, centralized management of headers and timeouts, and easier testing through
Related concepts include HttpClientFactory, named clients, typed clients, and resilience strategies such as Polly. Overall, AddHttpClientGitHub