Skip to content
Nuvyntra 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.1.0Refit 15
Interface + [Get]/[Post]/[Put]/[Delete]/[Patch]/[Head]YesYes
Path, [AliasAs], [Query], [Body], [Header]/[Headers]YesYes
Query objects, collection formats, camel/snake/kebabYesYes
[Timeout], [Url], [PathPrefix], optional {id?}YesYes
[QueryName] valueless flags, [FormObject]YesYes
Multipart (StreamPart / ByteArrayPart / FileInfoPart)YesYes
CancellationTokenYesYes
Task<IApiResponse<T>>YesYes
SSE / IAsyncEnumerable / JSON LinesYesYes
Request-body compressiongzip / brotliYes (15.2+)
Authorization header value getterYes (attach only; absolute URI)Yes
HTTP vs transport exceptionsApiException / ApiRequestExceptionApiException / ApiRequestException
Source-generated client and request constructionYesYes (Refit 14+)
Compile-time diagnosticsHFG001–HFG010Yes (richer analyzer set)
System.Text.Json + JsonSerializerContext / AOTYesYes
IHttpClientFactory + DelegatingHandlerYesYes (Refit.HttpClientFactory)
Newtonsoft.Json / XMLOptional packagesRefit.Newtonsoft.Json / Refit.Xml
First-party stub testing packagePlugin.Maui.HttpForge.TestingRefit.Testing
Reflection fallbackNo (generated-only)Refit.Reflection
Retry / cache / tokens / resumeCompose sibling pluginsHost-owned
Target matrixnet10.0 + Android / iOS / Mac Catalyst / WindowsBroader (.NET 8–11, WinUI, Blazor, Uno, .NET Framework)
NeedHttpForgeRefit
Core generated clientPlugin.Maui.HttpForgeRefit
DI / IHttpClientFactoryIncludedRefit.HttpClientFactory
Newtonsoft.JsonPlugin.Maui.HttpForge.NewtonsoftJsonRefit.Newtonsoft.Json
XML (XXE-safe)Plugin.Maui.HttpForge.XmlRefit.Xml
Test stubsPlugin.Maui.HttpForge.TestingRefit.Testing
Reflection fallbackNot plannedRefit.Reflection

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 (HFG001–HFG010) over a reflection fallback.

Stay on Refit when the team already standardized on it, needs a reflection fallback, or targets a broader framework matrix. 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.

Discussion

Comment on Plugin.Maui.HttpForge. The thread lives on this component's GitHub repository (nuvyntralabs/Plugin.Maui.HttpForge). Sign in with GitHub — Giscus uses Discussions, Utterances uses Issues.