RESTCLIENT.NET / API REFERENCE
Source API reference
Explore 34 public types and 105 members, exported directly from the C# source and XML documentation.
Download the API index · JSON schema
Exhaustion
Exhaustion.ExhaustionAnalyzer— Analyzer that enforces exhaustive pattern matching for closed type hierarchies.
Outcome
Outcome.HttpError<TError>— Represents HTTP-specific errors that can occur during web requests. This sealed hierarchy ensures complete error handling coverage for HTTP operations. Follows the functional programming principle of making illegal states unrepresentable by using a discriminated union instead of inheritance hierarchies.Outcome.HttpError<TError>.ErrorResponseError— Represents an HTTP error response from the server. This occurs when the server responds with an error status code (4xx, 5xx) but the response body can be parsed into a structured error format. This enables rich error handling where API errors can be strongly typed and contain detailed information about what went wrong.Outcome.HttpError<TError>.ExceptionError— Represents an error caused by an exception during the HTTP operation. This typically occurs due to network issues, timeouts, or other infrastructure problems. Examples: Network unreachable, connection timeout, DNS resolution failure.Outcome.ResultExtensions— Extension methods that provide additional functional programming utilities for Result. These methods enable more fluent and expressive Result-based code.Outcome.Result<TSuccess, TFailure>— A discriminated union representing either a successful result or a failure. This type enforces explicit error handling and eliminates the need for exceptions in business logic, following the Railway Oriented Programming pattern. The Result type is a closed hierarchy - only Ok and Error instances can exist, ensuring complete pattern matching coverage and type safety.Outcome.Result<TSuccess, TFailure>.Error<TSuccess, TFailure>— Represents a failed computation containing an error of type TFailure. This is the "sad path" case where something went wrong. In functional programming, this represents the Left side of an Either type, allowing for explicit error handling without exceptions.Outcome.Result<TSuccess, TFailure>.Ok<TSuccess, TFailure>— Represents a successful computation containing a value of type TSuccess. This is the "happy path" case where everything worked as expected. In functional programming, this represents the Right side of an Either type or the Some case of an Option type with additional context.Outcome.Unit— Represents a void return type or a type with only one value.
RestClient.Net
RestClient.Net.BuildRequest<TParam>— Represents a function that builds all parts of an HTTP request from a typed parameter.RestClient.Net.DeleteAsync<TSuccess, TError, TParam>— Delegate for executing DELETE requests that return a Result with typed success and error responses.RestClient.Net.Deserialize<T>— Represents an asynchronous function that deserializes an HTTP response message into a typed object.RestClient.Net.GetAsync<TSuccess, TError, TParam>— Delegate for executing GET requests that return a Result with typed success and error responses.RestClient.Net.GetRelativeUrl<TParam>— Represents a function that constructs a relative URL from a typed parameter.RestClient.Net.HeadAsync<TSuccess, TError, TParam>— Delegate for executing HEAD requests that return a Result with typed success and error responses.RestClient.Net.HttpAction— Represents an asynchronous HTTP operation that sends a request and returns a response. This delegate encapsulates the core functionality of executing HTTP requests with support for optional request content, headers, and cancellation.RestClient.Net.HttpClientExtensions— Extension methods forHttpClientthat returnResult{TOk, TError}.RestClient.Net.HttpClientFactoryExtensions— Provides extension methods for IHttpClientFactory to simplify HTTP operations.RestClient.Net.HttpRequestParts— Represents the parts of an HTTP request including URL, body, and headers.RestClient.Net.OptionsAsync<TSuccess, TError, TParam>— Delegate for executing OPTIONS requests that return a Result with typed success and error responses.RestClient.Net.PatchAsync<TSuccess, TError, TRequest>— Delegate for executing PATCH requests that return a Result with typed success and error responses.RestClient.Net.Pollyfill— Polyfill extensions for .NET Standard 2.1 compatibility.RestClient.Net.PostAsync<TSuccess, TError, TRequest>— Delegate for executing POST requests that return a Result with typed success and error responses.RestClient.Net.PutAsync<TSuccess, TError, TRequest>— Delegate for executing PUT requests that return a Result with typed success and error responses.RestClient.Net.Serialize<T>— Represents an asynchronous function that serializes a typed object into HTTP content.RestClient.Net.Utilities.ProgressReportingHttpContent— Represents an HTTP content type that reports progress during upload and download operations.
RestClient.Net.McpGenerator
RestClient.Net.McpGenerator.McpServerGenerator— Generates MCP server code from OpenAPI specifications.
RestClient.Net.OpenApiGenerator
RestClient.Net.OpenApiGenerator.CodeGenerationHelpers— Helper methods for code generation.RestClient.Net.OpenApiGenerator.ExtensionMethodGenerator— Generates C# extension methods from OpenAPI operations.RestClient.Net.OpenApiGenerator.GeneratorResult— Represents the result of code generation.RestClient.Net.OpenApiGenerator.ModelGenerator— Generates C# model classes from OpenAPI schemas.RestClient.Net.OpenApiGenerator.OpenApiCodeGenerator— Generates C# extension methods from OpenAPI specifications. This uses the Microsoft.OpenApi library to parse OpenAPI documents and generate code https://github.com/microsoft/OpenAPI.NET. See the tests here https://github.com/microsoft/OpenAPI.NET/tree/main/test/Microsoft.OpenApi.Tests to see how the API works.RestClient.Net.OpenApiGenerator.ParameterInfo— Parameter information for OpenAPI operations.RestClient.Net.OpenApiGenerator.UrlParser— Parses base URLs and paths from OpenAPI documents.