FluentHttpClient 5.0.0-rc3

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

FluentHttpClient

FluentHttpClient brings a modern, chainable API to HttpClient, turning verbose request setup into clean, expressive fluency. It handles headers, options, cookies, query parameters, conditional configurators, buffering, and both JSON/XML serialization and deserialization, along with success and failure handlers, all with minimal ceremony. It multitargets from .NET Standard 2.0 all the way up through .NET 10, giving you broad compatibility across older runtimes and the latest platforms, with full Native AOT compatibility and strong-named assemblies.

Compatibility Matrix

FluentHttpClient is optimized for .NET 10 and the newest .NET releases, while also supporting older platforms through .NET Standard 2.1 and 2.0 for teams maintaining long-lived or legacy applications. It includes full Native AOT compatibility and provides strong-named assemblies for environments that require them.

Target Supported Notes
.NET Standard 2.0 ✔️ Broadest compatibility target
.NET Standard 2.1 ✔️ Improved modern API surface
.NET Framework 4.6.1+ ✔️ Via netstandard2.0
.NET 6 ✔️ LTS
.NET 7 ✔️
.NET 8 ✔️ LTS
.NET 9 ✔️
.NET 10 ✔️ LTS

.NETStandard Consumers

Projects targeting .NETStandard 2.0 or .NETStandard 2.1 do not include System.Text.Json in the framework. FluentHttpClient uses System.Text.Json internally for its JSON extensions, but the package is not referenced transitively.

If you are building against netstandard2.0 or netstandard2.1, or any TFM that does not ship System.Text.Json, you will need to add an explicit package reference with a minimum version of 6.0.10 (a higher version is always recommended):

<PackageReference Include="System.Text.Json" Version="6.0.10" />

Apps targeting modern TFMs (such as .NET 5 and later) already include System.Text.Json and do not require this step.

When to Use FluentHttpClient

While HttpClient is a powerful and flexible tool, building HTTP requests with it often involves repetitive boilerplate, manual serialization, and scattered configuration logic. FluentHttpClient addresses these pain points by providing a fluent, chainable API that reduces cognitive load and improves code readability.

Common HttpClient Challenges

Repetitive Configuration
Every request requires manually setting headers, query parameters, and content, often scattered across multiple lines. This makes it easy to miss required headers or forget encoding rules.

Manual Serialization
Converting objects to JSON, setting the correct Content-Type, and deserializing responses requires multiple steps and imports. Error-prone encoding and parsing logic often needs to be duplicated across your codebase.

Inconsistent Error Handling
Without a unified approach to handling success and failure responses, status code checks and logging logic tend to be duplicated or omitted entirely.

Lifetime and Reuse Concerns
Properly managing HttpClient lifetime, avoiding socket exhaustion, and reusing instances while still configuring per-request state requires careful planning and often leads to awkward patterns.

How FluentHttpClient Helps

FluentHttpClient wraps HttpClient (you still manage the lifetime) and provides extension methods that let you configure requests in a single, readable chain:

  • Fluent Configuration: Add headers, query parameters, cookies, and authentication in a natural, discoverable flow
  • Automatic Serialization: Built-in JSON and XML serialization/deserialization with support for System.Text.Json, Native AOT, and custom options
  • Response Handlers: Attach success and failure callbacks directly in the request chain without breaking fluency
  • Reduced Boilerplate: Express the entire request lifecycle—configuration, sending, and deserialization—in a single expression

FluentHttpClient can expresses the same logic in fewer lines, with better readability and no loss of functionality. All configuration, sending, error handling, and deserialization happen in a single fluent chain.

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  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.
  • net5.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