Skip to content
NLNuvyntra Labs

Versus Refit

Both libraries use the same idea: declare a REST API as a C# interface, generate the HttpClient implementation, and leave transport to the standard .NET HTTP stack. Refit is the mature, general-purpose client. HttpForge is a MauiEssentials-shaped subset for Android, iOS, Mac Catalyst, and Windows. It is not a drop-in Refit replacement.

HttpForgeRefit
ManualRestService.For<T>(http)RestService.For<T>(http)
DIAddHttpForgeClient<T>(...)AddRefitClient<T>()
MAUI hostUseHttpForge()No MAUI-specific host API
CapabilityHttpForge 1.0.1Refit 15
Interface + [Get]/[Post]/[Put]/[Delete]/[Patch]/[Head]YesYes
Path, [AliasAs], [Query], [Body], [Header]/[Headers]YesYes
Multipart (StreamPart / ByteArrayPart / FileInfoPart)YesYes
CancellationTokenYesYes
Task<IApiResponse<T>>YesYes
HTTP vs transport exceptionsApiException / ApiRequestExceptionApiException / ApiRequestException
Source-generated client and request constructionYesYes (Refit 14+)
Compile-time diagnosticsHFG001–HFG006Yes (richer analyzer set)
System.Text.Json + JsonSerializerContext / AOTYesYes
IHttpClientFactory + DelegatingHandlerYesYes (Refit.HttpClientFactory)
Query objects, collection formats, naming presetsNo (v1)Yes
[Timeout], [Url], [PathPrefix], optional segmentsNo (v1)Yes
SSE / IAsyncEnumerable / JSON LinesNo (v1)Yes
Authorization header value getterNo (v1)Yes
Newtonsoft.Json / XML / reflection fallbackNoYes (optional packages)
First-party stub testing packageNo (v1)Refit.Testing
Retry / cache / tokens / resumeCompose sibling pluginsHost-owned
Target matrixnet10.0 + Android / iOS / Mac Catalyst / WindowsBroader (.NET 8–11, WinUI, Blazor, Uno, .NET Framework)

Mature general-purpose typed REST client. Refit on NuGet

Versus sibling HTTP plugins

NeedStart with
Typed REST in a MauiEssentials appPlugin.Maui.HttpForge
Already on Refit, or need Refit’s full surfaceRefit
A few HttpClient callsHand-written HttpClient
Retry / circuit / offline POST queuePlugin.Maui.ApiResilience
CacheFirst / SWR GET cachePlugin.Maui.ApiCache
Tokens / 401 refreshPlugin.Maui.SecureSession or ApiResilience
Resumable uploadPlugin.Maui.SmartUpload

HttpForge keeps the declarative contract and source generation. It leaves mobile networking problems to sibling packages instead of embedding retry, cache, offline queue, or upload resume in the REST DSL.

When to choose HttpForge

  • You want a Refit-style typed REST client that matches the MauiEssentials catalog.
  • You need Android, iOS, Mac Catalyst, and Windows on net10.0.
  • You want IHttpClientBuilder composition with ApiResilience, ApiCache, SecureSession, or SmartUpload.
  • You prefer compile-time failure (HFG00x) over a reflection fallback.

Stay on Refit when the team already standardized on it, or when you need query objects, streaming, Newtonsoft/XML, or Refit.Testing. Use hand-written HttpClient for a handful of calls. Use sibling plugins when the question is retry, cache, tokens, or resume — not the REST contract.