A type-safe REST API client library for .NET that simplifies remote endpoint communication through interface definitions.
RestEase is a type-safe REST API client library for .NET that allows developers to define remote endpoints as C# interfaces. It automatically generates implementations for these interfaces, handling HTTP requests and responses with strong typing. The library simplifies consuming REST APIs by reducing boilerplate code and providing compile-time safety.
.NET developers building applications that consume RESTful APIs, especially those needing type-safe client code, customization of HTTP interactions, or compatibility with platforms like .NET Native and iOS.
Developers choose RestEase for its balance of simplicity and flexibility—offering an intuitive interface-based approach while allowing deep customization of serialization, headers, and HTTP behavior. Its integration with HttpClientFactory, Polly, and support for source generators make it robust for production use.
Easy-to-use typesafe REST API client library for .NET Standard 1.1 and .NET Framework 4.5 and higher, which is simple and customisable. Inspired by Refit
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Defines REST endpoints as C# interfaces with attributes like [Get] and [Post], ensuring compile-time safety and reducing boilerplate, as demonstrated in the Quick Start with automatic implementation generation.
Allows overriding serialization, deserialization, query parameters, and headers through custom classes like ResponseDeserializer, detailed in the Controlling Serialization section for tailored HTTP interactions.
Works on .NET Framework 4.5.2+, .NET Standard, and supports .NET Native/iOS via a source generator, with built-in integration for HttpClientFactory and Polly for resilience policies.
Supports Task<T>, Task<string>, Task<HttpResponseMessage>, Task<Response<T>>, and Task<Stream>, enabling handling of various response needs like raw streams or full HTTP messages.
Relies on Newtonsoft.Json for serialization by default, which can conflict with projects standardized on System.Text.Json or add unnecessary dependencies, as admitted in the Controlling Serialization section.
Interfaces must be public or configured with friend assemblies, adding complexity for internal or sealed designs, as noted in the Interface Accessibility part of the README.
The RestEase.SourceGenerator requires the .NET 5 SDK or higher for optimal use, limiting compatibility with older toolchains or projects not yet upgraded, as highlighted in the Using RestEase.SourceGenerator section.
RestEase is an open-source alternative to the following products: