RESTCLIENT.NET
Menu
EN
↗ GitHub

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.

01 / THE REQUEST LAB

HTTP → RESULT<T, E>

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.

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.Net
using 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

Better ways to build.

Read the journal ↗