HTTP & APIs
Plugin.Maui.HttpForge
Source-generated typed REST client — Refit-shaped, MauiEssentials-aligned
Current NuGet 1.0.1
A type-safe, source-generated HTTP REST client for .NET MAUI on Android, iOS, Mac Catalyst, and Windows. Declare the API as a C# interface; HttpForge generates the HttpClient implementation at compile time.
Install
dotnet add package Plugin.Maui.HttpForgePackage ID: Plugin.Maui.HttpForge
Overview
Plugin.Maui.HttpForge is the contract layer: declare GET/POST/PUT/DELETE/PATCH/HEAD as a C# interface and the source generator emits the HttpClient implementation — no runtime reflection request builder. It is a MauiEssentials-shaped subset of Refit for Android, iOS, Mac Catalyst, and Windows, not a drop-in Refit replacement. Retry, cache, token refresh, and resumable uploads stay on ApiResilience, ApiCache, SecureSession, and SmartUpload; AddHttpForgeClient returns IHttpClientBuilder so those handlers chain on the same client.
Current release
- Publish the packed net10.0-windows TFM (merged from the Windows CI nupkg). Source-generated REST client for Android, iOS, Mac Catalyst, and Windows.
Full upgrade map for the 3 September 2026 hardening wave: Hardened plugin releases.
Capabilities
- Interface + [Get] / [Post] / [Put] / [Delete] / [Patch] / [Head] compiled to HttpClient calls.
- Path parameters, [AliasAs], [Query], [Body], [Header] / [Headers], CancellationToken.
- Multipart uploads with StreamPart, ByteArrayPart, and FileInfoPart.
- Task<IApiResponse<T>> for non-throwing 4xx/5xx; ApiException vs ApiRequestException.
- System.Text.Json by default; optional JsonSerializerContext for AOT.
- UseHttpForge(), AddHttpForgeClient<T>(), or RestService.For<T>() without the host.
- Compose ApiResilience, ApiCache, SecureSession, and SmartUpload on IHttpClientBuilder.
- Compile-time diagnostics HFG001–HFG006. Generated-only — no reflection fallback.
Documentation
Documentation
Interface contract, attributes, multipart, errors, JSON/AOT, analyzers, and what v1 leaves to sibling plugins.
Getting started
UseHttpForge, AddHttpForgeClient, and recipes for ApiResilience, ApiCache, SecureSession, and SmartUpload.
Comparison
Versus Refit, hand-written HttpClient, ApiResilience, ApiCache, SecureSession, and SmartUpload.
- .NET MAUI
- REST
- HttpClient
- Refit
- C#
- Mac Catalyst
- Windows