Fluent.Client 1.2.0

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

Fluent.Client

Created in Poland by Leszek Pomianowski and open-source community.
A chainable HTTP client wrapper for .NET that reduces the boilerplate around HttpRequestMessage and HttpClient.

NuGet NuGet Downloads GitHub license

Getting started

dotnet add package Fluent.Client

https://www.nuget.org/packages/Fluent.Client

using Fluent.Client;

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

using var response = await client
    .Post("/api/users", new { Name = "John Doe" })
    .SendAsync();

Creating requests

Use the HTTP method extensions on HttpClient to create a FluentHttpRequest:

var request = client.Post("/api/v1/users", new { Name = "John Doe" });
var request = client.Get("/api/v1/users", new { page = 1, limit = 10 });
var request = client.Delete("/api/v1/users/897");
var request = client.Put("/api/v1/users/897", new { Name = "Jane Doe" });
Method Description
.Get(path, query?) GET with optional query parameters
.Post(path, body?) POST with optional JSON body
.Put(path, body?) PUT with optional JSON body
.Delete(path) DELETE
.Patch(path, body?) PATCH with optional JSON body

Configuring requests

// Bearer token (default when token is provided)
client.Authorize(token: "jwt-token-here").Get("/api/protected");

// Basic authentication — credentials are Base64-encoded automatically
client.Authorize(username: "john", password: "secret").Get("/api/protected");

// API key — placed in the api-key header by default
client.Authorize(key: "my-api-key").Get("/api/protected");

// Explicit scheme override
client.Authorize(token: "token", kind: AuthorizationType.OAuth).Post("/api/resource");
client.Authorize(token: "token", kind: AuthorizationType.Negotiate).Get("/api/resource");

// Custom header name
client.Authorize(token: "token", header: "X-Auth-Token").Get("/api/protected");
// Query parameters as anonymous object
client.Get("/api/users", new { page = 1, limit = 10, sortBy = "createdAt" });
// Multiple configurations chained
var request = client
    .Authorize(token: "abc123")
    .Get("/api/v1/basket", new { includeItems = true });

Authorization schemes are defined in Fluent.Client.Authenticate.AuthorizationType. The scheme name is used verbatim as the header token — e.g. Bearer, OAuth, HOBA, Negotiate, VAPID.

Method Description
Authorize(token) Authorization: Bearer {token}
Authorize(token, kind) Authorization: {scheme} {token}
Authorize(username, password) Authorization: Basic {base64(user:pass)}
Authorize(key) api-key: {key}
Authorize(..., header) Uses header as the header name instead of the default
WithHeader(key, value) Adds a custom request header
WithHeaders(dictionary) Adds multiple headers at once
WithTimeout(timespan) Sets the request timeout
WithContentType(mediaType) Sets the Content-Type header
WithAccept(mediaType) Sets the Accept header
WithCulture(culture) Sets the Accept-Language header
WithUserAgent(value) Sets the User-Agent header
WithJsonOptions(options) Overrides the default JsonSerializerOptions

Windows authentication (NTLM / Kerberos)

NTLM and Kerberos are handled by HttpClientHandler, not by Authorization headers. Configure credentials on the handler before creating the client:

using var handler = new HttpClientHandler
{
    Credentials = new NetworkCredential("user", "password", "domain"),
    // or for the current Windows user:
    // Credentials = CredentialCache.DefaultCredentials,
};
using var client = new HttpClient(handler) { BaseAddress = new Uri("https://internal.corp/") };

using var response = await client.Get("/api/data");

Sending requests

// Get HttpResponseMessage
using HttpResponseMessage response = await request.SendAsync();

if (response.IsSuccessStatusCode)
{
    var content = await response.Content.ReadAsStringAsync();
}
// Deserialize response directly
UserCreatedResponse result = await request.Send<UserCreatedResponse>();
// The request is awaitable — SendAsync is optional
using var response = await client
    .Authorize(token: "abc123")
    .Post("/api/users", new { Name = "John" });

Testing

Pair with Fluent.Client.AwesomeAssertions for integration tests:

await client
    .Authorize(token: "abc123")
    .Post("/api/users", new { Name = "John" })
    .Should()
    .Succeed("because valid user data was provided");

License

Fluent.Client is free and open source software licensed under the MIT License. You can use it in private and commercial projects.
Keep in mind that you must include a copy of the license in your project.

Product Compatible and additional computed target framework versions.
.NET 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 was computed.  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 Framework net472 is compatible.  net48 was computed.  net481 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.0 125 6/10/2026
1.1.0 285 3/5/2026
1.0.2 196 2/6/2026
1.0.1 154 1/10/2026
1.0.0 124 1/9/2026
1.0.0-preview.2 107 1/9/2026
1.0.0-preview.1 78 1/9/2026