Reliable.HttpClient 1.3.0

dotnet add package Reliable.HttpClient --version 1.3.0
                    
NuGet\Install-Package Reliable.HttpClient -Version 1.3.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.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Reliable.HttpClient" Version="1.3.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.3.0
                    
#r "nuget: Reliable.HttpClient, 1.3.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.3.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.3.0
                    
Install as a Cake Addin
#tool nuget:?package=Reliable.HttpClient&version=1.3.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 Generic Caching Getting Started
REST API with 5+ entity types Universal Handlers Choosing Guide
Need HttpClient substitution IHttpClientAdapter Substitution Guide
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");
}

// Need custom headers? Use the adapter pattern:
public class AuthApiClient(IHttpClientAdapter client, ITokenProvider tokens)
{
    public async Task<Data> GetDataAsync(string userId)
    {
        var headers = new Dictionary<string, string>
        {
            { "Authorization", $"Bearer {await tokens.GetTokenAsync(userId)}" }
        };
        return await client.GetAsync<Data>("/endpoint", headers);
    }
}

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
  • Custom Headers – Default and per-request header support
  • OAuth/Auth Support – Dynamic token handling per request
  • 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,750 9/22/2025
1.2.0 340 9/18/2025
1.1.0 358 9/18/2025
1.0.0 1,343 8/29/2025
1.0.0-alpha1 257 8/29/2025

🎉 v1.3.0 Release - PATCH Method Support & Enhanced HTTP Operations

     ✨ Major New Features:
     • Complete HTTP PATCH method support in IHttpClientAdapter and HttpClientAdapter
     • Four PATCH method overloads: typed responses, raw HttpResponseMessage, with/without headers
     • Full header support for PATCH operations including OAuth and authentication scenarios
     • Comprehensive JSON serialization support for PATCH request bodies
     • Modern C# 12 implementation with file-scoped namespaces and target-typed new expressions

     🔧 API Enhancements:
     • PatchAsync<TRequest, TResponse>(uri, request) - Typed request/response with response
     handler
     • PatchAsync<TRequest, TResponse>(uri, request, headers) - With custom headers support
     • PatchAsync<TRequest>(uri, request) - Returns raw HttpResponseMessage
     • PatchAsync<TRequest>(uri, request, headers) - Raw response with headers
     • Consistent API patterns matching existing GET, POST, PUT, DELETE methods
     • Full integration with existing retry policies and circuit breakers

     🎯 Key Use Cases:
     • RESTful API updates with partial resource modification
     • JSON Merge Patch and JSON Patch operations
     • Incremental data updates with authentication headers
     • Resource versioning and conditional updates
     • Microservice communication with PATCH semantics

     🚀 Quick Start:
     // Typed PATCH with response handling
     var updated = await client.PatchAsync<UpdateRequest, UserResponse>("/users/123",
     request);

     // PATCH with custom headers
     await client.PatchAsync("/api/resource", data, headers);

     🔄 Previous Features (v1.2.0):
     • Comprehensive custom headers support for OAuth, authentication, and API integration
     • DefaultHeaders property for static headers across all requests
     • Per-request headers via IHttpClientAdapter method overloads
     • Fluent header management in HttpClientOptionsBuilder
     • Enhanced documentation with progressive disclosure structure

     📚 Full documentation: https://github.com/akrisanov/Reliable.HttpClient

     ⚡ Breaking Changes: None - fully backward compatible