
melbournedeveloper/restclient.net
Developer tools이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
MCP 생성기를 사용해 C#에서 REST 호출을 만드는 가장 안전한 방법
개요
OpenAPI 사양에서 MCP 서버를 생성하세요!! 함수형 프로그래밍, 타입 안전성, 최신 .NET 패턴으로 처음부터 구축되었습니다. 원래 RestClient.Net 의 후속 모델입니다. 이 라이브러리는 타입 안전성과 기능 설계에 있어 타협하지 않는 접근 방식을 가지고 있습니다: - - IHttpClientFactory.CreateClient()를 통한 HttpClient 라이프사이클 관리 지원 - - 예외 없는 명시적 오류 처리 - - Exhaustion을 통한 컴파일 시 보장 - - 인터페이스 없는 순수 함수 - OpenAPI 3.x 사양에서 - - 컴파일 시 안전을 위해 닫힌 계층 타입으로 결과 >을 반환함 (Outcome 패키지) - - 예측 가능한 오류 처리를 위한 예외 투지 없음 - - 내장된 다운로드/업로드 진행 추적 - - 관습 기반 재시도 정책 및 복원력 패턴 지원 - - 전반적으로 현대적인 비동기 패턴 - - IHttpClientFactory와 함께 동작.
개요(AI 번역)
**C#**에서 REST 호출을 가장 안전하게 하는 방법
새로워! OpenAPI 사양에서 MCP 서버를 생성하세요!!
함수형 프로그래밍, 타입 안전성, 최신 .NET 패턴으로 처음부터 구축되었습니다. 원래 RestClient.Net 의 후속 모델입니다.
무엇이 다른지
이 라이브러리는 타입 안전성과 기능 설계에 있어 타협하지 않는 접근 방식을 가지고 있습니다:
- HttpClient 확장 기능 - [[T0]를 통해 HttpClient 라이프사이클 관리와 함께 작동합니다.
- 결과 유형 - 예외 없는 명시적 오류 처리
- 전복성 검사 - 소진을 통한 컴파일 시 보장
- 함수 합성 - 인터페이스가 없는 순수 함수
특징
- **OpenAPI 3.x 사양에서 MCP 서버와 클라이언트 코드를 생성하세요.
- 결과 타입 - 컴파일 시 안전을 위해 닫힌 계층 타입으로
Result >를 반환 (결과물 패키지) - Zero Exceptions - 예측 가능한 오류 처리를 위한 예외 투지 없음
- 진행 상황 보고 - 내장된 다운로드/업로드 진행 상황 추적 기능
- 폴리 통합 - 협약 기반 재시도 정책 및 복원력 패턴 지원
- Async/Await Only - 현대 비동기 패턴 전반에 걸쳐 사용됩니다
이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.
README
원문 README의 일부입니다. 원문 보기.
RestClient.Net
The safest way to make REST calls in C#
New! Generate MCP servers from OpenAPI specs!!!
Built from the ground up with functional programming, type safety, and modern .NET patterns. Successor to the original RestClient.Net.
What Makes It Different
This library is uncompromising in its approach to type safety and functional design:
- HttpClient extensions - Works with HttpClient lifecycle management via
IHttpClientFactory.CreateClient() - Result types - Explicit error handling without exceptions
- Exhaustiveness checking - Compile-time guarantees via Exhaustion
- Functional composition - Pure functions with no interfaces
Features
- Generate an MCP Server and client code from an OpenAPI 3.x spec.
- Result Types - Returns
Result>with closed hierarchy types for compile-time safety (Outcome package) - Zero Exceptions - No exception throwing for predictable error handling
- Progress Reporting - Built-in download/upload progress tracking
- Polly Integration - Support for convention-based retry policies and resilience patterns
- Async/Await Only - Modern async patterns throughout
- HttpClient Extensions - Works with
IHttpClientFactory.CreateClient()for proper pooled connections and DNS behavior handling - Exhaustiveness Checking - Uses Exhaustion for compile-time completeness guarantees (stopgap until C# adds discriminated unions)
The design focuses on discriminated unions for results, and adding the Exhaustion analyzer package gives you exhaustive pattern matching on type in C#. RestClient.Net is well ahead of the game. You can use discriminated unions with exhaustiveness checks in C# right now.
Installation
Install the core package:
dotnet add package RestClient.Net
RestClient.Net installs the Exhaustion analyzer. Is is a Roslyn analyzer that provides compile-time exhaustiveness checking for pattern matching. Without it, you lose one of RestClient.Net’s core safety guarantees.
Usage
Basic GET Request
A complete example making a GET request to JSONPlaceholder:
using System.Text.Json;
using RestClient.Net;
using Urls;
// Define models
설치
This server does not publish a one-line install command.
Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →