{"full_name":"reactiveui/refit","owner":"reactiveui","name":"refit","shard":"1","url":"https://github.com/reactiveui/refit","description":"The automatic type-safe REST library for .NET. Refit turns a REST API into a C# interface and generates the HttpClient implementation, with support for HttpClientFactory, pluggable serializers and a testing package.","homepage":"https://www.reactiveui.net/documentation/refit/","topics":["dotnet","dotnet-core","http","xamarin","c-sharp","json","xml"],"tag_pages":["c-sharp","dotnet","dotnet-core","http","json","xamarin","xml"],"language":"C#","license":"NOASSERTION","avatar":"https://avatars.githubusercontent.com/u/2327577?v=4","created_at":"2013-07-22T20:11:57Z","pushed_at":"2026-11-15T02:32:54Z","metrics":{"stars":9585,"forks":780,"watchers":160,"issues":1033,"prs":1231,"releases":92,"issues_open":1,"issues_closed":1032,"prs_open":1,"prs_closed":321,"prs_merged":909,"discussions":107},"growth":{"day":{"stars":1,"forks":0,"base_day":"2026-11-15"}},"history":{"dates":["2026-11-10","2026-11-11","2026-11-12","2026-11-13","2026-11-14","2026-11-15","2026-11-16"],"stars":[9579,9581,9582,9583,9583,9584,9585],"forks":[781,781,780,780,780,780,780],"watchers":[null,160,160,160,160,160,160],"issues_open":[null,1,1,1,1,1,1],"prs_open":[null,3,3,3,4,2,1]},"boards":{},"same_owner":[{"full_name":"reactiveui/splat","name":"splat","shard":"1","boards":{}}],"issues":[{"number":1667,"title":"Dependency Dashboard","comments":0,"created_at":"2024-02-17T00:24:32Z"}],"discussions":[{"number":2358,"title":"How to test multipart with SSE response?","comments":1,"category":"Q&A","created_at":"2026-10-15T14:17:07Z"},{"number":2354,"title":"How to test multipart?","comments":1,"category":"Q&A","created_at":"2026-10-07T15:02:24Z"},{"number":2349,"title":"Complicating the retrieval of the error content","comments":1,"category":"General","created_at":"2026-10-03T01:47:49Z"},{"number":2314,"title":"How to debug?","comments":2,"category":"Q&A","created_at":"2026-08-18T09:01:32Z"},{"number":2300,"title":"LoggingHttpMessageHandler changes HttpHeaders added with TryAddWithoutValidation when Trace logging is enabled","comments":1,"category":"General","created_at":"2026-08-10T07:01:06Z"},{"number":2283,"title":"RF006","comments":2,"category":"Q&A","created_at":"2026-07-30T09:18:18Z"},{"number":2279,"title":"Refit 13.1: Can a parameter no longer be both a path parameter and a header?","comments":2,"category":"Q&A","created_at":"2026-07-26T08:55:33Z"},{"number":2215,"title":"IApiResponse.EnsureSuccessStatusCodeAsync","comments":1,"category":"General","created_at":"2026-07-14T11:07:41Z"}],"latest_release":{"name":"16.4.0","tag":"v16.4.0","published_at":"2026-10-17T16:15:48Z","body":"## Summary\n\nRefit 16.4.0 adds opt-in HTTP-aware retries, new query naming and relative URL options, and fixes for parameter binding and response handling. Existing clients keep their current behavior unless you enable the new options.\n\n### HTTP-aware retries\n\n`HttpRetryHandler` works with Refit clients and ordinary `HttpClient` calls. It needs no extra resilience package or changes to your API interface.\n\n- By default, it allows three retries after the first send for GET, HEAD, OPTIONS and TRACE. It retries HTTP 408, 429, 500, 502, 503 and 504, plus `HttpRequestException`. A 403 retries only when the configured delay reader finds a valid timing hint.\n- The default reader respects standard `Retry-After` headers. `RetryDelayProviders.Azure`, `.Aws`, `.GitHub` and `.Jira` also read provider-specific timing headers. Custom readers can use `ReadHeader` with seconds, milliseconds, Unix timestamps or date formats.\n- When no valid hint is available, retries use exponential backoff starting at one second and capped at 30 seconds. Full jitter randomly spreads attempts within that interval. You can disable jitter or choose symmetric variation with `RetryJitterMode.Symmetric`.\n- Server hints are never shortened by jitter. A hint above `MaxDelay` returns the response rather than retrying too early. `ServerDelayJitterRatio` can add a small positive variation to a server delay.\n- Each attempt uses a fresh request with copied headers, options and content metadata. Request bodies are buffered once, with a one MiB default limit. Failed responses are disposed; the final response remains caller-owned. Cancellation covers buffering, sends and waits.\n\n### Quick start\n\nPut the retry handler in the client's handler chain, then create your Refit client as usual:\n\n```csharp\nusing Refit;\n\nvar handler = new HttpRetryHandler(new HttpRetryOptions\n{\n    MaxRetries = 3,\n    DelayProvider = RetryDelayProviders.GitHub,\n})\n{\n    InnerHandler = new HttpClientHandler(),\n};\n\nusing var client = new HttpClient(handler)\n{\n    BaseAddress = new Uri(\"https://api.github.com\"),\n};\nvar api = RestService.ForGenerated<IGitHubApi>(client);\n```\n\n`IGitHubApi` is your existing Refit interface. Omit `DelayProvider` to use standard `Retry-After` handling. With `Refit.HttpClientFactory`, register a fresh handler for the client:\n\n```csharp\nservices.AddRefitGeneratedClient<IGitHubApi>()\n    .ConfigureHttpClient(static client =>\n        client.BaseAddress = new Uri(\"https://api.github.com\"))\n    .AddHttpMessageHandler(static () => new HttpRetryHandler(new HttpRetryOptions\n    {\n        DelayProvider = RetryDelayProviders.GitHub,\n    }));\n```\n\nSet `MaxRetries = 0` to disable retries. Use `ShouldRetry` to replace the response rules, and `BaseDelay` / `MaxDelay` to tune waits. POST, PUT, PATCH and DELETE require `RetryUnsafeMethods = true`; enable this only when replay is safe for the endpoint, such as when it supports an idempotency key. Avoid unbounded streaming uploads and stacking this handler with another retry strategy.\n\nAn authentication handler inside the retry handler runs on every attempt. `HttpClient.Timeout` bounds the whole call, including retry waits. For deterministic tests, `Refit.Testing` adds `RetryReply.After`, `RetryReply.Header` and `StubHttp.CreateRetryHandler`, with `TimeProvider` support.\n\n### Other changes\n\n- `[Query(Name = \"client_id\")]` names a query parameter or form field. `[AliasAs]` still takes precedence. The positional `[Query(\"...\")]` argument remains a nesting delimiter, not an alias; the new opt-in diagnostic RF016 helps catch that mistake.\n- `[Url(AllowRelative = true)]` accepts relative as well as absolute URLs, using normal URI resolution against `HttpClient.BaseAddress`. Existing encoded queries are retained when appending query parameters. Plain `[Url]` still requires an absolute URL.\n- `RefitSettings` now groups options under `Serialization`, `Url`, `Exceptions` and `Requests`. Existing top-level properties remain available and refer to the same","is_prerelease":false},"readme":true,"readme_zh":false,"news":[],"stale":false,"snapshot_at":"2026-11-16T09:23:14Z","history_start":"2026-09-06"}