qmetrics.net

Refit

Type-safe REST HTTP client generator for .NET

Refit screenshot

Refit maps C# interfaces to HTTP calls using attributes for routes, queries, headers, and bodies. A compile-time source generator builds the client while you control HttpClient and serialization.

Overview

Refit lets .NET applications describe REST APIs as C# interfaces. Method attributes declare HTTP verbs, URL templates, query parameters, headers, and request bodies; the generated implementation is created at build time and invokes HttpClient with your chosen serializers.

Typical usage registers a JSON context for System.Text.Json source generation, reuses a configured HttpClient with a base address, and obtains a typed client through RestService.ForGenerated. You keep cancellation tokens, error handling, and shared settings such as authorization in your application code.

The library covers streaming responses, pagination helpers, multipart and form posts, pluggable Newtonsoft.Json or XML serializers, dependency injection registration, resilience and retry handlers, OpenTelemetry hooks, and test doubles for local HTTP replies.

Documentation targets recent .NET and C# releases, notes AOT constraints, and lists packages for HTTP-aware retries and deterministic testing. Refit is positioned as an alternative to hand-written HttpClient call sites with a contract-first interface.

Key features

  • Interface-driven HTTP clients
  • Compile-time source generation
  • System.Text.Json metadata support
  • HttpClientFactory integration
  • Streaming and pagination APIs
  • Multipart and form bodies
  • Local HTTP testing helpers
  • OpenTelemetry instrumentation

Use cases

  • Typed third-party API wrappers
  • Microservice client contracts
  • DI-registered HTTP clients
  • Native AOT friendly JSON clients
  • Testable API boundary layers

Tags

Similar software

axios

Promise-based HTTP client for browser and Node.js

Axios is a promise-based HTTP client for JavaScript environments in the browser and Node.js. It supports common request methods, configurable defaults, and interceptors for request and response handling.

★ 109.5k⟳ 2 days agoMIT

FastAPI

Python web framework for building APIs with type hints

FastAPI is a Python web framework for building APIs using standard type hints. It builds on Starlette and Pydantic and generates interactive OpenAPI documentation for the endpoints you define.

★ 105.1k⟳ 9 days agoMIT

OmniRoute

OpenAI-compatible AI gateway with provider routing

OmniRoute exposes one endpoint that routes chat requests across many LLM providers with quota-aware fallback and compression.

★ 90.7k⟳ todayMIT

Hoppscotch

Web, desktop and CLI API development ecosystem

Hoppscotch lets developers send HTTP, WebSocket, GraphQL, and related API requests from a lightweight client. Collections, environments, teams, and sync help organize testing across devices.

★ 81k⟳ 5 days agoMIT
Open Source Alternative to:Postman

NestJS

Progressive TypeScript framework for Node.js backends

Nest organizes Node server apps with modules, dependency injection, and first-party packages for auth, data, queues, and observability.

★ 77.2k⟳ todayMIT

JSON Server

Zero-code mock REST API from JSON data files

JSON Server turns a JSON or JSON5 database file into a REST API for local prototyping. It supports filtering, sorting, pagination, embedding relations, and static assets.

★ 75.7k⟳ 8 months agoMIT