NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
NuGet, #313 most downloaded on NuGet
Type-safe REST API clients for .NET, generated from annotated interfaces with build-time source generation, direct request construction, System.Text.Json defaults, and support for trimming and AOT.
Latest stable
17.0.0
Last release 3 days ago
16 Nov 2026
Ships unpredictably
gaps range from 9 days to 13 months
Most releases are documented
notes for 52 of the last 60 stable releases
13 versions withdrawn
withdrawn after publishing
127 years old
91 releases · first in 1900
Drag across the ruler to compare, or tap a release to open it.
a879553c87c9e7608b05b8d014e6a6e0f698cc50 ensure tasks are loaded from the correct location for both transitive and build directories. [ #619 ]
/ from hostUrlThis list of changes was auto generated.
d835e88640a501461b1258fd681c644cc68e0d72 Merge pull request #612 from reactiveui/update-core
Your coding agent can read these notes before it upgrades. Set up the MCP server →
d835e88640a501461b1258fd681c644cc68e0d72 Merge pull request #612 from reactiveui/update-core
a5006e1bed9e1347299e2cd3b2fb0a29876c1034 Update to latest mock and test libs
20f4cf1012a3059ac71147e9ee958901857e259e Build with .NET Core SDK 3
00b9d8185b15e70103c795eea51f957f1b1e5472 Code style formatting
c1d02f0bdd147d2ba5f41974e4c8e5e0525743e3 Fix template formatting
913d617b3a6b704b269addd58c723c34062f08cf Point to the correct 461 dir
be2c586a9b037f44128325002db8cf6153e29e2b Use full namespace to void potential dup imports
c45197bb75cba3585d852840ed0321dd9db2b1fd Code style
026fe00dc940ddbcc9490203ad3c6c3bb9f51f29 Fix warnings
6fa96c655520d9a13ff25aedb99441c522e189eb Update test refs <details><summary><b>See more</b></summary>
9e91a9c4ecc707581c380a73a490665c8f4f70b0 Add support for the new buildTransitive, so direct references aren't needed to run the targets [ #598 ]
0dab28981bf749fddb17202b46aeb5f12b50770b Update deps to use latest Roslyn.
5e1f273ba90c4638aaf7f2e57cc4ca54af7e9c6b Merge pull request #611 from reactiveui/build-updates
c5555cee1be535a4a8be81775c6ffa7a936d4a83 Merge pull request #608 from Styxxy/Styxxy-issue-605
5c33b7fc1e4a7dd402532b3a3cee1801d302e1f4 Merge pull request #606 from felipebaltazar/options-attribute
b86ddcb9d7d1062d6577762b9d878e34d2f91b96 Update depenencies
6d9b31646a324af4d0a0b4b2576e0281eea4ba13 Merge branch 'master' into Styxxy-issue-605
76448d8da4cceeb8ce1596b8f8e99fc715f8f26b remove Attribute from name
c5efc776d59638c069728054fddd615e2e3e588c exclude from Obfuscation
b44e75a8e3dbd020672be5ff33479ca479075bd5 OptionsWithBodyDetected removed
8db866b9c60eaf7126a4889eefaa257654d8cfbd Options Attribute
846f5f828b226b5e6e21565f1344fd8ed0353e1e Merge pull request #590 from stevewgh/custom-serializer-bug
4fe01b30ea4c27dbc4605b3c36a084b0c0f4793c Fixed deadlock when serializing content + added test coverage.
3fce69b9a7a59a98cf607c7e5c62876e4dcd1165 Merge pull request #584 from MariusVolkhart/mv/multiForm
0960ce093c42a56924f488514cf4689e0b3c7328 Merge pull request #586 from MariusVolkhart/mv/improveErrorMessaging
48208e879687e64504c6d659c0f435a466a07e35 Merge pull request #571 from stevewgh/custom-serializers
3b678e4eb1a987aace4c5912fa443e0c89877519 Provide additional information during errors
c63b62c7164a70a32fa74c7dcfbd50fd4b23b534 !fixup 303a3578bb11e1f5053360a367e029e6ab489306
303a3578bb11e1f5053360a367e029e6ab489306 !fixup dfdad56b01cd9fd8cdb314ded52ed5abfd4ad374
4efa19c810c92b67f1f7f965cb201a47b102874f Merge pull request #585 from MariusVolkhart/mv/docs
cc05c3a9feea80200309f40beed9cbe4b304883f Made IContentSerializer.SerializeAsync generic
f4d83d8410c2a8a1cf2e3a01c0cbf1c608b25309 Expand XMLDocs for QueryAttribute and CollectionFormat
dfdad56b01cd9fd8cdb314ded52ed5abfd4ad374 !fixup Add support for url form encoding collections
8a01a1a3ea3161086e39d10e7c670e73a5173243 Add support for url form encoding collections
babaed0dd77d226dd404f6902db2a0d5734baf3e Added missing ConfigureAwait(false)
6d3a5f474267aadbee05ce226e9b85150d5401a4 Added missing ConfigureAwait(false) & fixed deadlock on ValidationApiException.Content
7a387ed26dc21222b122eb86db5278e255981270 Changes made in response to PR feedback
89a2c34ec7d989b601bf15dff4e9cafb3fc3326d Merge branch 'master' into custom-serializers
741b7b6b61c3be66ac28c442bd637bc1e3dacbcc Isolated Content Serialization continued
27d6fb48655d02d78ac8f425a70bf6cefe063069 Isolated Content Serialization
This list of changes was auto generated.</details>
Nothing published for this version
fix early response stream closing. (#538) @Veikedo
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Bugfix release with two main fixes:
Bugfix release with two main fixes:
https://github.com/paulcbetts/refit/milestone/7?closed=1
New feature release of Refit with the following notable enhancements:
New feature release of Refit with the following notable enhancements:
ApiResponse<T>)These were possible because of contributions from the community, thank you!
Doc updates forthcoming.
Full list of fixes: https://github.com/paulcbetts/refit/milestone/6?closed=1
Nothing published for this version
Nothing published for this version
This version adds many bug fixes since the last release and has the following notable new features:
This version adds many bug fixes since the last release and has the following notable new features:
dotnet build. This support requires the .NET Core 2 SDK and will not work with the 1.x SDK. Projects can still target any supported target frameworkNothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
## What's New _Release notes soon_
Release notes soon
Methods decorated with Multipart attribute will be submitted with multipart content type. At this time, multipart methods support the following parame
Methods decorated with Multipart attribute will be submitted with multipart content type.
At this time, multipart methods support the following parameter types:
For byte array and Stream parameters, use AttachmentName parameter attribute to specify the
name for the attachment. For FileInfo parameters, the file name will be used.
public interface ISomeApi
{
[Multipart]
[Post("/users/{id}/photo")]
Task UploadPhoto(int id, [AttachmentName("photo.jpg")] Stream stream);
}
Add support for the PATCH HTTP method (#115, #119, thanks @cristi-badila)
Bug Fixes:
Refit now allows you to control JSON serialization, via passing in a new RefitSettings type into RestService.For :
Refit now allows you to control JSON serialization, via passing in a new RefitSettings type into RestService.For<T>:
var gitHubApi = RestService.For<IGitHubApi>("https://api.github.com",
new RefitSettings {
JsonSerializerSettings = new JsonSerializerSettings {
ContractResolver = new SnakeCasePropertyNamesContractResolver()
}
});
Refit now prints diagnostic information inside VS when an interface can't be generated
Thanks to @bennor, you can now define generic interfaces that apply to multiple APIs:
Thanks to @bennor, you can now define generic interfaces that apply to multiple APIs:
public interface IReallyExcitingCrudApi<T, in TKey> where T : class
{
[Post("")]
Task<T> Create([Body] T paylod);
[Get("")]
Task<List<T>> ReadAll();
[Get("/{key}")]
Task<T> ReadOne(TKey key);
[Put("/{key}")]
Task Update(TKey key, [Body]T payload);
[Delete("/{key}")]
Task Delete(TKey key);
}
// Later, in another part of town...
var userApi = RestService.For<IReallyExcitingCrudApi<User, string>>("http://api.example.com/users");
var adminApi = RestService.For<IReallyExcitingCrudApi<Admin, string>>("http://api.example.com/admins");
Thanks to @carl-berg, types that are serialized in the URL query string can now define custom formatting, via a new RefitSettings class that is optionally passed to RestService.For.
Because of the compile-time code generation mentioned above, Refit 2.0 now has full support for WinRT (Windows Store) and Windows Phone 8.1 Universal
Because of the compile-time code generation mentioned above, Refit 2.0 now has full support for WinRT (Windows Store) and Windows Phone 8.1 Universal applications too!
2.0.1 is an Oops release to fix a PLib packaging issue as well as bump the NuGet package versions. This release also saves some space by removing unne
2.0.1 is an Oops release to fix a PLib packaging issue as well as bump the NuGet package versions. This release also saves some space by removing unnecessary PDBs.
Refit 2.0 uses a completely different system to generate the backing classes for your interfaces. In Refit 1.0, these classes would be generated at ru
Refit 2.0 uses a completely different system to generate the backing classes for your interfaces. In Refit 1.0, these classes would be generated at runtime using Castle.Core, which worked on most platforms, but fails on any Ahead-of-Time compiled platform, such as Xamarin.iOS.
Refit 2.0 instead generates classes at compile-time, by analyzing your app's source files with Roslyn, and generates a new RefitStubs.cs file that will be compiled along with your class. As well as enabling Xamarin.iOS support, this class is easily subclassed and extended via partial classes, so customizing individual method behavior is now much easier
Observables in Refit 1.x are backed by AsyncSubject, meaning that they replay a single result to subscribers, even after the network request ends. In Refit 2.0, Observables now do no work until Subscribed to, and each Subscription will generate a new network request, in line with Retrofit. Observables in Refit 2.0 now also will cancel network operations if the Subscription is disposed, allowing you to efficiently cancel requests if they are no longer needed.
Before:
var observable = someRestService.ReturnsAnObservable();
var result1 = await observable;
var result2 = await observable;
// result2 is just a replayed result1, the network request was made when
// we called ReturnsAnObservable regardless if anyone cared.
result1 == result2;
>>> true
After:
// Does nothing
var observable = someRestService.ReturnsAnObservable();
// Makes a web request
var result1 = await observable;
// Makes a *different* web request
var result2 = await observable;
result1 == result2;
>>> maybe?
When POSTing bodies serialized via BodySerializationMethod.UrlEncoded, the AliasAs tag now also works on properties in the model class:
Before:
public interface IMeasurementProtocolApi
{
[Post("/collect")]
Task Collect([Body(BodySerializationMethod.UrlEncoded)] Measurement measurement);
}
public class Measurement
{
public string t { get; set; } // This isn't even the worst of them
}
await api.Collect(new Measurement { t = "what even is t?" });
After:
// This part doesn't change
public interface IMeasurementProtocolApi
{
[Post("/collect")]
Task Collect([Body(BodySerializationMethod.UrlEncoded)] Measurement measurement);
}
// This stuff does
public Measurement
{
[AliasAs("t")]
public string Type { get; set; }
}
await api.Collect(new Measurement { Type = "event" });
``` cs public interface IDummyHttpApi { [Get("/bar/{id}")] Task FetchSomeStuff(int id);
public interface IDummyHttpApi
{
[Get("/bar/{id}")]
Task<string> FetchSomeStuff(int id);
[Get("/bar/{id}?baz=bamf")]
Task<string> FetchSomeStuffWithHardcodedQueryParameter(int id);
}
RestService.For<IDummyHttpApi>("http://api.com/foo")
public interface IDummyHttpApi
{
[Get("/bar/{image}/{width}x{height}")]
Task<byte[]> GetImageData(string image, int width, int height);
}
public interface IDummyHttpApi
{
[Post("/foo/bar/{id}")]
IObservable<string> PostSomeUrlEncodedStuff([AliasAs("id")] int anId, [Body(BodySerializationMethod.UrlEncoded)] Dictionary<string, string> theData);
}
Thanks to @bennor, Refit now supports adding request headers to both individual methods as well as to entire classes via the [Header] attribute. Here'
Thanks to @bennor, Refit now supports adding request headers to both individual methods as well as to entire classes via the [Header] attribute. Here's an example:
[Headers("X-Emoji: :rocket:")]
public interface IGitHubApi
{
[Get("/users/list")]
Task<List> GetUsers();
[Get("/users/{user}")]
[Headers("X-Emoji: :smile_cat:")]
Task<User> GetUser(string user);
[Post("/users/new")]
[Headers("X-Emoji: :metal:")]
Task CreateUser([Body] User user, [Header("X-Emoji")] string emoji);
}
Thanks to @dahlbyk, methods can return Task for HTTP requests that don't have a response with any information (i.e. "DeleteXYZ" that only signals if i
Thanks to @dahlbyk, methods can return Task for HTTP requests that don't have a response with any information (i.e. "DeleteXYZ" that only signals if it worked or not)
## Refit 1.0.0 Initial Release
Initial Release
One column per quarter.