Reliable.HttpClient 1.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Reliable.HttpClient --version 1.1.0
                    
NuGet\Install-Package Reliable.HttpClient -Version 1.1.0
                    
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.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Reliable.HttpClient" Version="1.1.0" />
                    
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.1.0
                    
#r "nuget: Reliable.HttpClient, 1.1.0"
                    
#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.1.0
                    
#: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.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Reliable.HttpClient&version=1.1.0
                    
Install as a Cake Tool

Reliable.HttpClient

Core Package

NuGet Version NuGet Downloads

Caching Extension

NuGet Version NuGet Downloads

Project Status

Build Status codecov .NET License

A comprehensive resilience and caching ecosystem for HttpClient with built-in retry policies, circuit breakers, and intelligent response caching. Based on Polly but with zero configuration required.

🎯 Choose Your Approach

Not sure which approach to use? → Read our Choosing Guide

Your Use Case Recommended Approach Documentation
Single API with 1-2 entity types Traditional Generic Getting Started
REST API with 5+ entity types Universal Handlers Common Scenarios - Universal REST API
Need HttpClient substitution IHttpClientAdapter HttpClient Substitution
Custom serialization/error handling Custom Response Handler Advanced Usage

Packages

Package Purpose Version
Reliable.HttpClient Core resilience (retry + circuit breaker) dotnet add package Reliable.HttpClient
Reliable.HttpClient.Caching HTTP response caching extension dotnet add package Reliable.HttpClient.Caching

Why Choose This Ecosystem?

  • Zero Configuration: Works out of the box with sensible defaults
  • Complete Solution: Resilience + Caching in one ecosystem
  • Lightweight: Minimal overhead, maximum reliability
  • Production Ready: Used by companies in production environments
  • Easy Integration: One line of code to add resilience, two lines for caching
  • Secure: SHA256-based cache keys prevent collisions and attacks
  • Flexible: Use core resilience alone or add caching as needed

Quick Start

dotnet add package Reliable.HttpClient
// Add to your Program.cs
builder.Services.AddHttpClient<ApiClient>(c => c.BaseAddress = new Uri("https://api.example.com"))
    .AddResilience(); // That's it! ✨

// Use anywhere
public class ApiClient(HttpClient client)
{
    public async Task<Data> GetDataAsync() =>
        await client.GetFromJsonAsync<Data>("/endpoint");
}

You now have: Automatic retries + Circuit breaker + Smart error handling

🚀 Need details? See Getting Started Guide for step-by-step setup 🆕 Building REST APIs? Check Universal Response Handlers 🔄 Need substitution patterns? See HttpClient Substitution Guide

Key Features

Zero Configuration - Works out of the box ✅ Resilience - Retry + Circuit breaker ✅ Caching - Intelligent HTTP response caching ✅ Universal Handlers - Non-generic response handling for REST APIs ✅ HttpClient Substitution - Switch between cached/non-cached implementations ✅ Production Ready - Used by companies in production

📖 Full Feature List: Documentation

Need Customization?

// Custom settings
.AddResilience(options => options.Retry.MaxRetries = 5);

// Ready-made presets
.AddResilience(HttpClientPresets.SlowExternalApi());

📖 Full Configuration: Configuration Guide

Trusted By

Organizations using Reliable.HttpClient in production:

PlanFact

Documentation

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,760 9/22/2025
1.2.0 346 9/18/2025
1.1.0 366 9/18/2025
1.0.0 1,346 8/29/2025
1.0.0-alpha1 263 8/29/2025

🎉 v1.1.0 Release - RFC #1: Universal Response Handlers & HttpClient
     Substitution

     ✨ Major New Features:
     • Universal IHttpResponseHandler interface (non-generic) for multi-entity REST APIs
     • HttpClient Substitution Pattern via IHttpClientAdapter interface
     • DefaultHttpResponseHandler with automatic JSON deserialization
     • Extension methods for universal response handling
     • ServiceCollection extensions for seamless DI integration
     • Support for both regular and cached HttpClient implementations

     🔧 API Improvements:
     • C# 12 modernization with primary constructors and file-scoped namespaces
     • Enhanced type safety with class constraints
     • Improved ConfigureAwait(false) usage throughout
     • Zero breaking changes - fully backward compatible

     🎯 Use Cases:
     • REST APIs with 5+ entity types → Universal Response Handlers
     • HttpClient substitution scenarios → IHttpClientAdapter
     • Legacy code migration → Drop-in replacement patterns
     • Custom serialization needs → Extensible handler architecture

     🚀 Quick Start:
     services.AddHttpClientAdapter(); // Universal interface
     services.AddHttpClientWithAdapter(); // With configuration

     See full documentation at: https://github.com/akrisanov/Reliable.HttpClient