Reliable.HttpClient
1.0.0-alpha1
See the version list below for details.
dotnet add package Reliable.HttpClient --version 1.0.0-alpha1
NuGet\Install-Package Reliable.HttpClient -Version 1.0.0-alpha1
<PackageReference Include="Reliable.HttpClient" Version="1.0.0-alpha1" />
<PackageVersion Include="Reliable.HttpClient" Version="1.0.0-alpha1" />
<PackageReference Include="Reliable.HttpClient" />
paket add Reliable.HttpClient --version 1.0.0-alpha1
#r "nuget: Reliable.HttpClient, 1.0.0-alpha1"
#:package Reliable.HttpClient@1.0.0-alpha1
#addin nuget:?package=Reliable.HttpClient&version=1.0.0-alpha1&prerelease
#tool nuget:?package=Reliable.HttpClient&version=1.0.0-alpha1&prerelease
Reliable.HttpClient
A lightweight, easy-to-use resilience library for HttpClient with built-in retry policies and circuit breakers. Based on Polly but with zero configuration required.
Why Reliable.HttpClient?
- Zero Configuration: Works out of the box with sensible defaults
- Lightweight: Minimal overhead, maximum reliability
- Production Ready: Used by companies in production environments
- Easy Integration: One line of code to add resilience
- Flexible: Customize only what you need
Installation & Quick Start
dotnet add package Reliable.HttpClient
// Add resilience with zero configuration
builder.Services.AddHttpClient("myapi", c =>
{
c.BaseAddress = new Uri("https://api.example.com");
})
.AddResilience(); // That's it! 🎉
What You Get
Your HttpClient automatically gains:
- Retry Policy: 3 attempts with exponential backoff + jitter
- Circuit Breaker: Opens after 5 failures, stays open for 1 minute
- Smart Error Handling: Retries on 5xx, 408, 429, and network errors
- Zero Overhead: Only activates when needed
Custom Configuration (Optional)
builder.Services.AddHttpClient<WeatherApiClient>()
.AddResilience(options =>
{
options.Retry.MaxRetries = 5;
options.CircuitBreaker.FailuresBeforeOpen = 10;
// All other settings use sensible defaults
});
Trusted By
Organizations using Reliable.HttpClient in production:
Documentation
- 📚 Getting Started Guide - Quick setup and basic usage
- ⚙️ Configuration Reference - Complete options reference
- 🚀 Advanced Usage - Advanced patterns and techniques
- 💡 Common Scenarios - Real-world examples
Key Features
| Feature | Description | Default |
|---|---|---|
| Retry Policy | Exponential backoff with jitter | 3 retries, 1s base delay |
| Circuit Breaker | Prevents cascading failures | Opens after 5 failures |
| Error Handling | Smart retry decisions | 5xx, 408, 429, network errors |
| Configuration Validation | Prevents invalid settings | Automatic validation |
| Multi-targeting | .NET 6.0, 8.0, 9.0 support | Latest frameworks |
Simple Example
public class WeatherService
{
private readonly HttpClient _httpClient;
public WeatherService(IHttpClientFactory httpClientFactory)
{
_httpClient = httpClientFactory.CreateClient("weather");
}
public async Task<WeatherData> GetWeatherAsync(string city)
{
// This call automatically retries on failures and respects circuit breaker
var response = await _httpClient.GetAsync($"/weather?city={city}");
response.EnsureSuccessStatusCode();
return await response.Content.ReadFromJsonAsync<WeatherData>();
}
}
// Registration
builder.Services.AddHttpClient<WeatherService>("weather", c =>
{
c.BaseAddress = new Uri("https://api.weather.com");
})
.AddResilience(); // Adds retry + circuit breaker
Contributing
Contributions are welcome! Please read our Contributing Guide for details.
License
This project is licensed under the MIT License - see the LICENSE file for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net6.0
- Microsoft.Extensions.Http.Polly (>= 9.0.8)
- Polly (>= 8.6.3)
-
net8.0
- Microsoft.Extensions.Http.Polly (>= 9.0.8)
- Polly (>= 8.6.3)
-
net9.0
- Microsoft.Extensions.Http.Polly (>= 9.0.8)
- Polly (>= 8.6.3)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Reliable.HttpClient:
| Package | Downloads |
|---|---|
|
Reliable.HttpClient.Caching
Intelligent HTTP response caching for Reliable.HttpClient with comprehensive custom headers support. Features two distinct approaches: Generic type-safe caching (CachedHttpClient<T>) for specific response types and Universal caching (HttpClientWithCache) for multi-type scenarios. Includes DefaultHeaders configuration, per-request header support, intelligent cache key generation with header isolation, preset-based configuration, automatic memory management, and zero-setup convenience methods. |
|
|
Planfact.AmoCrm.Client
Идиоматичный и типобезопасный .NET-клиент для интеграции с amoCRM API v4. |
|
|
Planfact.KodySu.Client
Идиоматичный и типобезопасный клиент для API kody.su v2.1 (поиск информации по телефонным номерам) с поддержкой отказоустойчивых соединений и кеширования. |
|
|
Planfact.Yandex.SmartCaptcha
Идиоматичный и типобезопасный .NET-клиент для Yandex SmartCaptcha с поддержкой различных типов аутентификации и встроенными resilience patterns. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.3.0 | 3,759 | 9/22/2025 |
| 1.2.0 | 345 | 9/18/2025 |
| 1.1.0 | 364 | 9/18/2025 |
| 1.0.0 | 1,345 | 8/29/2025 |
| 1.0.0-alpha1 | 262 | 8/29/2025 |
Initial alpha release of Reliable.HttpClient (renamed from
HttpClient.Resilience).
Features: retry with exponential backoff and jitter, circuit breaker, and HTTP response
handling.