VitoRestbox 1.0.0
See the version list below for details.
dotnet add package VitoRestbox --version 1.0.0
NuGet\Install-Package VitoRestbox -Version 1.0.0
<PackageReference Include="VitoRestbox" Version="1.0.0" />
<PackageVersion Include="VitoRestbox" Version="1.0.0" />
<PackageReference Include="VitoRestbox" />
paket add VitoRestbox --version 1.0.0
#r "nuget: VitoRestbox, 1.0.0"
#:package VitoRestbox@1.0.0
#addin nuget:?package=VitoRestbox&version=1.0.0
#tool nuget:?package=VitoRestbox&version=1.0.0
π VitoRestbox
VitoRestbox is a clean, expressive HTTP request builder for .NET, designed to simplify REST API calls and enrich your application's communication with external services. Inspired by the name Vitoβderived from the Latin word vita, meaning βlifeββthis library brings clarity, vitality, and composability to your HTTP interactions.
β¨ Features
β
Fluent, sentence-like API for building HTTP requests
β
Supports all HTTP verbs: GET, POST, PUT, PATCH, DELETE
β
Built-in JSON serialization with customizable options
β
Header and authentication injection
β
Flexible .WithHeaders(...) builder pattern
β
Lifecycle hooks:
BeforeSendfor request inspectionAfterSendfor response handlingOnFailurefor error trackingOnExceptionfor graceful fallback
β Timeout configuration with.WithTimeout(...)
β Exception control with.SuppressExceptions(...)
β Sync and async execution support
β Works seamlessly withHttpClientand DI containers
π Quick Start
var result = await VitoRestboxRequest
.New(httpClient)
.To("https://api.example.com/users")
.WithBearerToken("your-token")
.Post(new { name = "Reza" })
.SendAsync<UserResponse>();
π§ Fluent Header Builder
You can inject multiple headers using chained or multiple lambdas:
.WithHeaders
(
h => h.Add("Authorization", "Bearer xyz"),
h => h.Add("X-Request-ID", Guid.NewGuid().ToString())
)
Or use a single chained builder:
.WithHeaders(h => h.Add("Authorization", "Bearer xyz").Add("X-Request-ID", Guid.NewGuid().ToString()))
β± Timeout & Exception Control
Set a timeout for the request:
.WithTimeout(15) // Timeout after 15 seconds
Suppress exceptions and handle failures manually:
.SuppressExceptions() // Prevents exceptions from being thrown
π¦ Installation
dotnet add package VitoRestbox
Or via NuGet Package Manager:
Install-Package VitoRestbox
π§ͺ Testing
VitoRestbox is fully testable with xUnit, FluentAssertions, and custom HttpMessageHandler mocks. See VitoRestboxRequestTests.cs for examples.
π Philosophy
In Latin, vita means "life"βand VitoRestbox aims to bring life to your API calls by making HTTP communication readable, composable, and expressive. Whether you're building microservices, SDKs, or internal tools, this library helps you express intent and outcome with precision.
π€ Author
Reza Ghadimi
π LinkedIn
π GitHub Profile
π¦ VitoRestbox Repository
π License
MIT License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net9.0
- Microsoft.Extensions.Http (>= 9.0.9)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.