<PackageReference Include="Refit" Version="15.0.0" />

Refit

Namespace with 81 public types

Classes

 AliasAsAttribute Override the key that will be sent in the query string.
 ApiException Represents an error that occurred after a response was received from the server.
 ApiRequestException Represents an error that occurred while sending an API request before a response could be received from the server.
 ApiResponse`1 Implementation of that provides additional functionalities.
 AttachmentNameAttribute Names an attachment in a multipart request.
 AuthorizeAttribute Add the Authorize header to the request with the value of the associated parameter.
 BodyAttribute Set a parameter to be sent as the HTTP request's body.
 ByteArrayPart Allows the use of a array in a multipart form body.
 CamelCaseUrlParameterKeyFormatter Provides an implementation of that formats URL parameter keys in camelCase.
 DefaultApiExceptionFactory Default Api exception factory.
 DefaultFormUrlEncodedParameterFormatter Default form Url-encoded parameter formatter.
 DefaultUrlParameterFormatter Default Url parameter formater.
 DefaultUrlParameterKeyFormatter Default Url parameter key formatter. Does not do any formatting.
 DeleteAttribute Send the request with HTTP method 'DELETE'.
 EncodedAttribute Marks a parameter value as already URL-encoded so Refit passes it through verbatim instead of escaping it — the equivalent of Retrofit's encoded = true. Applies to path segment values (including round-tripping {**param} segments), query values, and flags. The caller becomes responsible for producing valid encoded output; malformed values are sent as-is.
 FileInfoPart Allows the use of a object in a multipart form body.
 FormField`1 Describes a single form-url-encoded field for a strongly-typed body, allowing source-generated code to flatten a form body without reflection. The getter and all naming metadata are resolved at compile time by the Refit source generator; the runtime only formats the value using the configured .
 FormObjectAttribute Marks a complex-object parameter of a [Multipart] method so its public properties are written as individual multipart/form-data text parts (one part per property) instead of the default single serialized part.
 GeneratedParameterAttributeProvider Provides the attributes declared on a parameter, keyed by attribute type. Use instead when every attribute has the same type.
 GeneratedSingleTypeParameterAttributeProvider Provides the attributes declared on a parameter when every one of them has the same type, which needs neither a dictionary nor a flattening pass. Use when the parameter carries attributes of more than one type.
 GetAttribute Send the request with HTTP method 'GET'.
 HeadAttribute Send the request with HTTP method 'HEAD'.
 HeaderAttribute Add a header to the request.
 HeaderCollectionAttribute
 HeadersAttribute Add multiple headers to the request.
 JsonContentSerializer An obsolete JSON content serializer that has been replaced by serializers in dedicated packages.
 JsonLinesContent HTTP content that writes a sequence of values as JSON Lines (newline-delimited JSON): each element is serialized with the configured and emitted on its own line.
 KebabCaseUrlParameterKeyFormatter Provides an implementation of that formats URL parameter keys in kebab-case.
 MultipartAttribute Send the request as multipart.
 ObjectToInferredTypesConverter ObjectToInferredTypesConverter. From https://docs.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-converters-how-to?pivots=dotnet-5-0#deserialize-inferred-types-to-object-properties.
 OptionsAttribute Send the request with HTTP method 'OPTION'.
 PatchAttribute Send the request with HTTP method 'PATCH'.
 PathPrefixAttribute Prepends a shared route prefix to every method's relative path on the interface it decorates.
 PostAttribute Send the request with HTTP method 'POST'.
 ProblemDetails The object representing the details about a ValidationException caught by a service implementing RFC 7807.
 PropertyAttribute Used to store the value in HttpRequestMessage.Properties for further processing in a custom DelegatingHandler. If a string is supplied to the constructor then it will be used as the key in the HttpRequestMessage.Properties dictionary. If no key is specified then the key will be defaulted to the name of the parameter.
 PutAttribute Send the request with HTTP method 'PUT'.
 QueryAttribute Associated value will be added to the request Uri as query-string, using a delimiter to split the values. (default: '.').
 QueryConverterAttribute Flattens a query parameter with a hand-written instead of the source generator's declared-type walk, for shapes that are only known at runtime (an value, a polymorphic base type, a Dictionary<string, object>, and similar).
 QueryNameAttribute Renders the parameter value as a valueless query flag — a bare ?name segment with no =value — the equivalent of Retrofit's @QueryName. A collection produces one flag per element (?a&b&c); a argument (or element) is omitted. The value is rendered through like any other query value, and is URL-encoded unless the parameter also carries .
 QueryUriFormatAttribute Controls how query parameters are encoded into the request Uri.
 RefitSettings Defines various parameters on how Refit should work.
 RestMethodInfo Describes a single Refit REST method and the metadata used to build its request.
 RestMethodParameterInfo Describes a parameter of a REST method.
 RestMethodParameterProperty Describes a property used as part of a REST method parameter.
 SnakeCaseUrlParameterKeyFormatter Provides an implementation of that formats URL parameter keys in snake_case.
 StreamPart Allows the use of a generic in a multipart form body.
 SystemTextJsonContentSerializer A implementing using the System.Text.Json APIs.
 SystemTextJsonQueryConverter`1 An that flattens a query parameter by walking the JsonTypeInfo of the configured , reusing a registered JsonSerializerContext so arbitrary (including polymorphic) types flatten without hand-written code. Attach it with [QueryConverter(typeof(SystemTextJsonQueryConverter<MyType>))].
 TimeoutAttribute Applies a per-call timeout, in milliseconds, to a Refit interface method.
 UrlAttribute Marks a parameter as supplying the complete, absolute request URI, dispatching the call to that URL (which may be a different host) and bypassing the client's BaseAddress. This is Refit's equivalent of Retrofit's @Url.
 ValidationApiException An ApiException that is raised according to RFC 7807, which contains problem details for validation exceptions.

Structures

 GeneratedQueryStringBuilder Appends query parameters to a relative request path without reflection, matching the escaping, ordering, null-omission and collection-format semantics of the reflection request builder. Used by source-generated request construction; the API is also callable directly by hand-written AOT-friendly clients.

Enumerations

 BodySerializationMethod Defines methods to serialize HTTP requests' bodies.
 CollectionFormat Collection format defined in https://swagger.io/docs/specification/2-0/describing-parameters/ .
 ParameterType Specifies how a REST method parameter is treated.
 RequestBodySerializationMode Controls how Refit serializes JSON request bodies.
 StreamingContentFormat Describes how a streamed response body is framed when deserializing an .
 UrlResolutionMode Defines how Refit combines the client's base address with a method's relative URL.

Static Classes

 ApiResponseExtensions Convenience helpers for working with and .
 GeneratedRequestRunner Request body content creation for source-generated requests: JSON, JSON Lines, and URL-encoded forms.
 HttpRequestMessageOptions Contains Refit-defined properties on the HttpRequestMessage.Properties/Options.
 RequestBuilder Provides static methods for creating request builders for Refit interface types. This class enables the generation of strongly-typed HTTP client implementations based on interface definitions and optional settings.
 RestService Creates Refit interface implementations.
 UniqueName Builds the unique generated type name for a Refit interface. This matches the name Refit uses when registering a client with IHttpClientFactory, so it can be used to resolve or configure that same named client (for example services.AddHttpClient(UniqueName.ForType<T>())).

Abstract Classes

 ApiExceptionBase Represents an error that occurred while sending an API request.
 HttpMethodAttribute Base attribute describing the HTTP method used to send a request.
 MultipartItem Base type for multipart form items that carry a file name and optional content metadata.

Interfaces

 IApiResponse Base interface used to represent an API response.
 IApiResponse`1
 IFormUrlEncodedParameterFormatter Provides form Url-encoded parameter formatting.
 IHttpContentSerializer Provides content serialization to .
 IQueryConverter`1 Flattens a query parameter value into query-string pairs by hand, for shapes the source generator cannot flatten from the declared type (an value, a polymorphic base type, a Dictionary<string, object>, and similar). Attach an implementation to a parameter with .
 IRequestBuilder Defines a method for creating a delegate that executes a REST API method with the specified parameters and returns the result.
 IRequestBuilder`1 Defines a generic contract for building requests with a specified result type.
 IReturnTypeAdapter`2 Adapts a deferred asynchronous HTTP call producing a into the return type surfaced by a Refit interface method. Implement this to teach Refit a new return shape (for example IObservable<T> or Result<T>).
 IStreamingContentSerializer An optional capability for an that can deserialize a response body incrementally into an . Refit uses this for interface methods that return , reading items as they arrive instead of buffering the whole response.
 ISynchronousContentDeserializer An optional capability for an that can deserialize an already-buffered response body string synchronously. Refit uses this for and , which let callers peek at an error body from inside an exception filter (catch (ApiException ex) when (ex.TryGetContentAs<Error>(out var error))), where awaiting is not allowed by the CLR.
 ISynchronousContentSerializer An optional capability for an that can serialize a request body synchronously (buffered or streamed). Refit uses this when is or , allowing the System.Text.Json source-generated fast-path to engage. The fast-path runs through the synchronous serialization primitives (SerializeToUtf8Bytes / Serialize(Utf8JsonWriter, ...)); the built-in SerializeAsync(Stream) used by JsonContent bypasses it and uses the metadata logic instead.
 IUrlParameterFormatter Provides Url parameter formatting.
 IUrlParameterKeyFormatter Provides a mechanism for formatting URL parameter keys, allowing customization of key naming conventions.