Reliable.HttpClient 1.0.0-alpha1

This is a prerelease version of Reliable.HttpClient.
There is a newer version of this package available.
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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Reliable.HttpClient" Version="1.0.0-alpha1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Reliable.HttpClient" Version="1.0.0-alpha1" />
                    
Directory.Packages.props
<PackageReference Include="Reliable.HttpClient" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Reliable.HttpClient --version 1.0.0-alpha1
                    
#r "nuget: Reliable.HttpClient, 1.0.0-alpha1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Reliable.HttpClient@1.0.0-alpha1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Reliable.HttpClient&version=1.0.0-alpha1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Reliable.HttpClient&version=1.0.0-alpha1&prerelease
                    
Install as a Cake Tool

Reliable.HttpClient

NuGet Version NuGet Downloads Build Status License

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:

PlanFact

Documentation

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.