THE FUNCTIONAL HTTP TOOLKIT FOR .NET ↗ OPEN SOURCE
Every outcome.
In view.
The network is unpredictable. Your code doesn’t have to be. Make every HTTP outcome explicit with typed results, pattern matching, and exhaustiveness checks.
200 OK → Your deserialized response, wrapped in a typed success.
var message = result switch
{
OkPost(var post) => post.Title,
ErrorPost(ResponseErrorPost(var error, var status, _)) => $"HTTP {status}",
ErrorPost(ExceptionErrorPost(var exception)) => exception.Message
};
Interactive illustration · No requests leave your browser · Type aliases explained in the docs
02 / DESIGNED FOR THE REAL WORLD
Confidence is a type.
Errors become data.
Success, response errors, exceptions. Represent what happened in the return type.
Result<T, E> ↗ 02 — EXHAUSTIONCatch the missing case.
Find missing switch branches at build time. Bounded analysis reports when a hierarchy exceeds its limits.
Meet the analyzer ↗ 03 — HTTPCLIENTKeep your HttpClient.
Extend the client you already use. Keep your handlers, connection pools, and dependency injection.
IHttpClientFactory ↗ 04 — OPENAPIFrom spec to safe calls.
Turn OpenAPI specifications into typed C# clients, models, and result aliases.
Generate a client ↗ 05 — MCPMake your API a tool.
Expose API operations through generated Model Context Protocol servers.
Explore MCP ↗ 06 — REFERENCEStraight from the source.
Browse API signatures and XML documentation exported directly from the C# source.
Read the reference ↗03 / FROM FIRST CALL TO PRODUCTION
One small install. A clearer way to code.
Familiar C#. Explicit outcomes. Start with one request, then build from there.
Installation guide ↗dotnet add package RestClient.Netusing RestClient.Net;
using Urls;
var result = await httpClient.GetAsync(
"https://api.example.com/posts/1".ToAbsoluteUrl(),
deserializeSuccess: DeserializePost,
deserializeError: DeserializeError
);
// All outcomes stay in the return value.
// Add your aliases and handle each branch.04 / NOTES FROM THE WORKBENCH
Announcing RestClient.Net v6 - Type-Safe REST for C#
RestClient.Net v6 brings discriminated unions to C# REST calls with compile-time exhaustiveness checking.
Read article ↗January 18, 2026Migrating from Traditional HttpClient to RestClient.Net
Step-by-step guide to migrating your existing HttpClient code to RestClient.Net with functional error handling.
Read article ↗January 15, 2026Functional Error Handling in C# with RestClient.Net
Learn how discriminated unions and exhaustiveness checking eliminate runtime crashes in your REST calls.
Read article ↗