Fluent.Client 1.1.0

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

<div align="center"> <h1>๐ŸŒŠ Fluent.Client</h1> <h3><em>A fluent HTTP client wrapper for .NET.</em></h3> </div>

<p align="center"> <strong>Build HTTP requests with a clean, chainable API. Less boilerplate, more productivity.</strong> </p>

<p align="center"> <a href="https://www.nuget.org/packages/Fluent.Client"><img src="https://img.shields.io/nuget/v/Fluent.Client.svg" alt="NuGet"/></a> <a href="https://www.nuget.org/packages/Fluent.Client"><img src="https://img.shields.io/nuget/dt/Fluent.Client.svg" alt="NuGet Downloads"/></a> <a href="https://github.com/lepoco/fluent/stargazers"><img src="https://img.shields.io/github/stars/lepoco/fluent?style=social" alt="GitHub stars"/></a> <a href="https://github.com/lepoco/fluent/blob/main/LICENSE"><img src="https://img.shields.io/github/license/lepoco/fluent" alt="License"/></a> </p>

<p align="center"> <a href="https://lepo.co/">Created in Poland by Leszek Pomianowski</a> and <a href="https://github.com/lepoco/fluent/graphs/contributors">open-source community</a>. </p>


Table of Contents


๐Ÿค” Why This Library?

Traditional HttpClient usage requires verbose setup:

// โŒ Traditional approach - verbose and repetitive
var request = new HttpRequestMessage(HttpMethod.Post, "/api/users");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", token);
request.Content = new StringContent(
    JsonSerializer.Serialize(new { Name = "John" }),
    Encoding.UTF8,
    "application/json");
var response = await client.SendAsync(request);

With Fluent.Client, requests become expressive one-liners:

// โœ… Fluent approach - clean and readable
var response = await client
    .Authorize(token: "abc123")
    .Post("/api/users", new { Name = "John" })
    .SendAsync();

โšก Get Started

Install the Package

dotnet add package Fluent.Client

๐Ÿ“ฆ NuGet: https://www.nuget.org/packages/Fluent.Client

Quick Example

using Fluent.Client;

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

// Simple POST with JSON body
var response = await client
    .Post("/api/users", new { Name = "John Doe" })
    .SendAsync();

๐Ÿ“– How to Use

1. Create a Request

Start by creating a request using one of the HTTP method extensions on HttpClient.

using Fluent.Client;

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

// POST with JSON body
var request = client.Post("/api/v1/users", new { Name = "John Doe" });

// GET with query parameters
var request = client.Get("/api/v1/users", new { page = 1, limit = 10 });

// DELETE
var request = client.Delete("/api/v1/users/897");

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

2. Configure the Request

Chain configuration methods to add headers, authorization, and more.

Authorization
// Bearer token
client.Authorize(token: "jwt-token-here").Get("/api/protected");

// Basic authentication
client.Authorize(username: "john", password: "secret").Get("/api/protected");
Query Parameters
// Pass as anonymous object
client.Get("/api/users", new 
{ 
    page = 1, 
    limit = 10, 
    sortBy = "createdAt" 
});
Chaining Multiple Configurations
var request = client
    .Authorize(token: "abc123")
    .Get("/api/v1/basket", new { includeItems = true });

3. Send the Request

Send the request and handle the response.

<details open> <summary><strong>Get HttpResponseMessage</strong></summary>

using HttpResponseMessage response = await request.SendAsync();

if (response.IsSuccessStatusCode)
{
    var content = await response.Content.ReadAsStringAsync();
    Console.WriteLine(content);
}

</details>

<details> <summary><strong>Deserialize Response Automatically</strong></summary>

// Automatically deserialize JSON response to typed object
UserCreatedResponse result = await request.SendAsync<UserCreatedResponse>();

Console.WriteLine($"Created user: {result.Id}");

</details>

<details> <summary><strong>Direct Execution (No SendAsync)</strong></summary>

// The request returns Task<HttpResponseMessage>, so you can await directly
using var response = await client
    .Authorize(token: "abc123")
    .Post("/api/users", new { Name = "John" });

</details>


๐Ÿ“š API Reference

Request Creation Methods

Method Description
Get(path, query?) Create GET request
Post(path, body?) Create POST request
Put(path, body?) Create PUT request
Delete(path) Create DELETE request
Patch(path, body?) Create PATCH request

Configuration Methods

Method Description
Authorize(token) Add Bearer token authorization
Authorize(username, password) Add Basic authentication

Execution Methods

Method Description
SendAsync() Send request and return HttpResponseMessage
SendAsync<T>() Send request and deserialize response to T

๐Ÿงช Testing with AwesomeAssertions

Pair this library with Fluent.Client.AwesomeAssertions for expressive test assertions:

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

๐Ÿ“ฆ Install: dotnet add package Fluent.Client.AwesomeAssertions


๐Ÿ‘ฅ Maintainers


๐Ÿ’ฌ Support

For support, please open a GitHub issue. We welcome bug reports, feature requests, and questions.


๐Ÿ“„ License

This project is licensed under the terms of the MIT open source license. Please refer to the LICENSE file for the full terms.

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.1.0 39 3/5/2026
1.0.2 129 2/6/2026
1.0.1 129 1/10/2026
1.0.0 99 1/9/2026
1.0.0-preview.2 83 1/9/2026
1.0.0-preview.1 57 1/9/2026