FluentHttpClient 5.0.2

dotnet add package FluentHttpClient --version 5.0.2
                    
NuGet\Install-Package FluentHttpClient -Version 5.0.2
                    
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="FluentHttpClient" Version="5.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FluentHttpClient" Version="5.0.2" />
                    
Directory.Packages.props
<PackageReference Include="FluentHttpClient" />
                    
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 FluentHttpClient --version 5.0.2
                    
#r "nuget: FluentHttpClient, 5.0.2"
                    
#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 FluentHttpClient@5.0.2
                    
#: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=FluentHttpClient&version=5.0.2
                    
Install as a Cake Addin
#tool nuget:?package=FluentHttpClient&version=5.0.2
                    
Install as a Cake Tool

FluentHttpClient

FluentHttpClient adds a chainable API on top of HttpClient. You configure a request, send it, and read the response in one expression, instead of building an HttpRequestMessage, checking the status code, and deserializing by hand every time.

It works with the HttpClient you already have rather than replacing it. Each request is built on its own without changing the client or its shared configuration, so your existing setup, including IHttpClientFactory and typed clients, is unaffected.

What You Get

  • Fluent configuration of headers, query parameters, cookies, authentication, options, content, and content buffering, all in one readable chain.
  • JSON and XML serialization and deserialization, with JsonTypeInfo<T> overloads for trim-safe and Native AOT scenarios.
  • Conditional configuration that applies immediately or defers until the request is built, so you can branch without breaking the chain.
  • Response handlers that attach success and failure callbacks inline, without interrupting the chain.
  • Extensible by subclassing: derive from HttpRequestBuilder to create a custom builder shaped for a specific API or concern. Your methods chain alongside the built-in ones, and an override of SendAsync applies your logic to every request, since every other member on the class feeds into it.

Side-by-Side

The same request, written with raw HttpClient and with FluentHttpClient. Both deserialize the response into the same model:

public class Post
{
    public int Id { get; set; }
    public string? Title { get; set; }
    public string? Body { get; set; }
}

Raw HttpClient

using System.Net.Http.Json;

var client = new HttpClient
{
    BaseAddress = new Uri("https://jsonplaceholder.typicode.com")
};

var request = new HttpRequestMessage(HttpMethod.Get, "/posts/1");
request.Headers.Add("X-Correlation-Id", correlationId);

var response = await client.SendAsync(request);

Post? post = null;
if (response.IsSuccessStatusCode)
{
    post = await response.Content.ReadFromJsonAsync<Post>();
    Console.WriteLine($"Success: {response.StatusCode}");
}
else
{
    Console.WriteLine($"Failed: {response.StatusCode}");
}

FluentHttpClient

using FluentHttpClient;

var client = new HttpClient
{
    BaseAddress = new Uri("https://jsonplaceholder.typicode.com")
};

var post = await client
    .UsingRoute("/posts/1")
    .WithHeader("X-Correlation-Id", correlationId)
    .GetAsync()
    .OnSuccess(r => Console.WriteLine($"Success: {r.StatusCode}"))
    .OnFailure(r => Console.WriteLine($"Failed: {r.StatusCode}"))
    .ReadJsonAsync<Post>();

The FluentHttpClient version expresses the same logic in fewer lines, and keeps configuration, sending, error handling, and deserialization together in one chain.

Target Frameworks

FluentHttpClient multitargets .NET Standard 2.0 and 2.1, and .NET 6, 7, 8, 9, and 10. Through .NET Standard 2.0 it also runs on .NET Framework 4.6.1 and later. The assemblies are strong-named, and the package is Native AOT compatible when you use the JsonTypeInfo<T> JSON overloads.

.NET Standard Consumers

.NET Standard 2.0 and 2.1 do not ship System.Text.Json, and FluentHttpClient does not bring it in transitively. If you target either one, or any other framework that does not include System.Text.Json, add an explicit package reference: at least 4.6.0 for netstandard2.0 or 6.0.10 for netstandard2.1. A newer version is always preferable. Apps on .NET 5 and later already include it and need no extra step.

Documentation

Full documentation, including how to create custom builders, is at https://scottoffen.github.io/fluenthttpclient.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  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 is compatible.  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 is compatible.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.
  • .NETStandard 2.1

    • No dependencies.
  • net10.0

    • No dependencies.
  • net6.0

    • No dependencies.
  • net7.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on FluentHttpClient:

Repository Stars
scottoffen/grapevine
Fast, unopinionated, embeddable, minimalist web framework for .NET
Version Downloads Last Updated
5.0.2 65 6/4/2026
5.0.1 1,438 12/4/2025
5.0.0 149 11/29/2025
5.0.0-rc4 99 11/29/2025
5.0.0-rc3 156 11/28/2025
5.0.0-rc2 208 11/22/2025
5.0.0-rc1 242 11/22/2025
4.2.3 14,897 6/21/2024
4.2.1 306 6/1/2024
4.2.0 1,879 5/21/2024
4.1.0 275 5/21/2024
4.0.0 3,724 3/31/2024
3.0.6 335 3/31/2024 3.0.6 is deprecated because it is no longer maintained.
3.0.5 759 3/1/2024 3.0.5 is deprecated because it is no longer maintained.
3.0.4 499 2/15/2024 3.0.4 is deprecated because it is no longer maintained.
3.0.3 3,340 1/10/2024 3.0.3 is deprecated because it is no longer maintained.
Loading failed