Resilient HTTP client wrapper with built-in Polly retry policies, exponential backoff, circuit breaker patterns, and Avro serialization support. Simplifies external API integration with production-ready resilience patterns.
License
—
Deps
8
Install Size
—
Vulns
✓ 0
Published
Dec 10, 2025
$ dotnet add package SolTechnology.Core.ApiClientThe SolTechnology.Core.ApiClient library provides minimum functionality needed for API calls over HTTP. It handles needed services registration and configuration and a result provides HttpClients.
For installing the library, reference SolTechnology.Core.ApiClient nuget package and invoke AddApiClient<IApiClient, ApiClient>("http-client-name") service collection extension method:
services.AddApiClient<IFootballDataApiClient, FootballDataApiClient>("football-data"); //has to match the name from configuration
"Configuration": {
"ApiClients": {
"football-data": {
"BaseAddress": "http://api.football-data.org",
"Headers": [
{
"Name": "X-Auth-Token",
"Value": ""
}
]
},
"api-football": {
"BaseAddress": "https://api-football-v1.p.rapidapi.com",
"Headers": [
{
"Name": "x-rapidapi-host",
"Value": ""
},
{
"Name": "x-rapidapi-key",
"Value": ""
}
]
}
}
}
var footballDataApiConfiguration = new ApiClientConfiguration
{
BaseAddress = "http://api.football-data.org",
Name = "football-data",
Headers = new List<Header>
{
new Header
{
Name = "X-Auth-Token",
Value = ""
}
}
};
services.AddApiClient<IFootballDataApiClient, FootballDataApiClient>("football-data", footballDataApiConfiguration); //has to match the name from configuration
public FootballDataApiClient(HttpClient httpClient)
{
_httpClient = httpClient;
}
var apiResult = await _httpClient.GetAsync<MatchModel>($"v2/matches/{matchApiId}");